Hey everyone,
I have a function inside a for loop and in that function i am using the counter of the loop (the letter i) as a variable but it seems like inside the function the value of i gets reset.
Here is my code:
siteMenu=[“Profile”,“My work”,“Links”];
_root.createEmptyMovieClip(“mainMC”,200);
for(i=0;i<siteMenu.length;i++){
_root.createEmptyMovieClip(“MyButton”+i,100+i);
_root[“MyButton”+i]._x=100;
_root[“MyButton”+i]._y=100+(15i);
}
_root[“MyButton”+i].onRelease=function(){
loadMovie(siteMenu+".swf",“mainMC”);
}
}
The problem is how can i get around this thing so i can loadMovie according to the value of i.
Thanks for your help guys!