Hi, I’m starting to experiment with for loops for the first time in flash. As practice I’ve got 5 images (named img1, img2 etc) and 5 buttons (btn1, btn2 etc). All the images are set visible false initially; they then appear with each corresponding button press (btn 1 shows img 1etc). The code I’ve used is
for (j=0; j<5; j++) {
_root[“img”+j]._visible = 0;
_root[“btn”+j].onPress = function() {
_root[“btn”+j]._visible = 1;
};
}
I thought this code would work, but obviously it doesn’t, could anyone point out were I’m going wrong?
Thank you kindly.