I cannot figure out what my object instance names are because of how I am generating them and adding them to the stage...
var circles:Array = new Array() //Declare array for displaying multiple objects
function spawn(evt:MouseEvent):void { //MouseEvent trigger, working
for (var i:int = 0; i<5; i++) { //Run five times
circles[i] = new circle(); //Make a new circle
stage.addChildAt(circles[i],1); //Layer control, no problem
circles[i].x = (stageCenterWidth*Math.random()*5)/(Math.random()*10);
circles[i].y = (stageCenterHeight*Math.random()*5)/(Math.random()*10);
}
}
stageCenterHeight and stageCenterWidth are just variables containing the center points of the stage so I do not calculate every time.
I make a new circle every time the for
loops runs. However, after this function executes a few times I will call another function who's purpose is to play frame 2 of the circles all at the same time.
Question: How can I target the circles that I have now spammed all over the screen so that I can use something like circles.gotoAndPlay(2);
?