I need to access each children after i dynamically added them to the stage , but i`m having problems figuring out how .
On click it adds the image to the stage , and I need to make them glow one at a time , with a for() , but I cant figure out how to name them each with its own name ( name + i ) to access them later on .
Thank you in advance
stage.addEventListener(MouseEvent.MOUSE_DOWN, clicky);
var i = 1;
function clicky(event:MouseEvent):void
{
i++;
var fl_MyInstance:LibrarySymbol = new LibrarySymbol();
addChild(fl_MyInstance);
var myStageX:Number = Math.round(event.stageX);
var myStageY:Number = Math.round(event.stageY);
fl_MyInstance.x = myStageX;
fl_MyInstance.y = myStageY;
if(myStageX<150){
fl_MyInstance.scaleX = fl_MyInstance.scaleY = 1-(myStageX/300);
}else{
fl_MyInstance.scaleX = fl_MyInstance.scaleY = 0.5;
}
}
EDIT: Thank you for your answers . I will try to do it with an array , considering that i want to make them removable later . The point of the project is to create stars across the stage where you click and have a dot move from one star to another making them glow when it hits them .