Hello stackoverflow users, i have a question at witch i cant find answer and i really need to solve this small problem, the idea is with the same button im creating some circles, but right now i need each of them to have their own properties so during the program i can edit them, and i think if it is possible to make and Array with the properties of the Child, in my case the colour of the circle, and the text what is in it.
the code how i create the circles is :
if (i<9 && mouseX<400 && mouseY<350 && mouseX>15 && mouseY>15 && event.target.name!=add_s )
{
i++;
q=i;
var btn:Sprite = new Sprite();
btn.graphics.beginFill(0x0099FF, 1);
btn.graphics.drawCircle(mouseX, mouseY, 15);
btn.graphics.endFill();
cordX[i]=mouseX;
cordY[i]=mouseY;
btn.mouseEnabled=true;
var s:String = String(q);
btn.name=s;
var textField = new TextField();
textField.mouseEnabled=false;
textField.text = i;
textField.width = 10;
textField.height = 17;
textField.x = mouseX-5; // center it horizontally
textField.y = mouseY-8; // center it vertically
btn.addChild(textField);
this.addChild(btn);
}
My question is: Is it possible to make an array of Childs, so i can acces each circles parameters. Please help
For example instead of ---> btn.graphics.beginFill(0x0099FF,1); to be btn[1].graphics.beginFill(0x0099FF,1); where btn[1] is the first circle and in future so i can edit this parameters...