# getChildIndex() question

**URL:** <https://forum.kirupa.com/t/getchildindex-question/271280>\
**Category:** flash\
**Created:** [September 20, 2008, 8:21pm UTC](https://forum.kirupa.com/t/getchildindex-question/271280 "2008-09-20T20:21:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gawa](https://avatars.discourse-cdn.com/v4/letter/g/b77776/32.png) [@gawa](https://forum.kirupa.com/u/gawa)\
**Post date:** [September 20, 2008, 8:21pm UTC](https://forum.kirupa.com/t/getchildindex-question/271280/1 "2008-09-20T20:21:58Z")

</div>

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.
