this is my loop. Basically I want to loop through every instance on the stage with the prefix of hotspot. I.E. - hotspot1, hotspot2, hotspot3, and so on.
Anyway, I do this, and get a reference error when i is greater than the amount of hotspot movieclips.
then I try this:Code:for (var i:uint = 1; this["hotspot"+i]; i++) { trace(i); this["hotspot"+i].alpha = 0; trace(this["hotspot"+i].alpha); }
and nothing happens.Code:for (var i:uint = 1; i<this["hotspot"+i]; i++) { trace(i); this["hotspot"+i].alpha = 0; trace(this["hotspot"+i].alpha); }
Then if I enter the total number of hotspot movieclips on stage it works, but I want it to count them, instead of me doing it. I.E. - this works:
Any ideas? ThanksCode:for (var i:uint = 1; i<16; i++) { trace(i); this["hotspot"+i].alpha = 0; trace(this["hotspot"+i].alpha); }




Reply With Quote