hi all! trying to learn as3 and here is the scenario:
i have a movieclip on the stage with instance name “holder”.
i have another movieclip in the library set for export with baseclass “clip”. inside this mc is a dynamic textfield having an instance name of “a_txt”.
i created 3 instances of the “clip” object using a for() loop as shown in the code below:
var newClip:clip;
for(var i:uint = 0; i < 3; i ++)
{
newClip = new clip();
newClip.a_txt.text = “text” + i.toString();
newClip.y = i * 20;
newClip.addEventListener(MouseEvent.CLICK, doThis);
holder.addChild(newClip);
}
function doThis(event:MouseEvent):void
{
// trace the index value of the event.target
}
my question is how do i get the index value of the 3 instances i created? or is my whole approach to my objective a little off?
many thanks for your help.