This may be a stupid questions but I can’t find it.
I’d like to refer to movieClip onStage by looping though it for example, I have 10 movieclips name slot1 – slot12 then in my code
var hole:MovieClip;
function checkHit():void {
hole = pirate.slot3; // My problem is here how do i change this slot3 to slot 4,5,6 ...
}
I know we can do a loop and i read about addChild but I dont want to keep creating new MC since they are already on stage.
Thank you!
You can loop through the movie clips using the square brackets notation. For example: