# Trace child index number?

**URL:** <https://forum.kirupa.com/t/trace-child-index-number/327496>\
**Category:** Uncategorized\
**Created:** [March 5, 2012, 11:34am UTC](https://forum.kirupa.com/t/trace-child-index-number/327496 "2012-03-05T11:34:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeponkz](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@jeponkz](https://forum.kirupa.com/u/jeponkz)\
**Post date:** [March 5, 2012, 11:34am UTC](https://forum.kirupa.com/t/trace-child-index-number/327496/1 "2012-03-05T11:34:18Z")

</div>

Hey guys I want to know the index number of the object when I clicked it…

trace(mc.getChildAt(0)) = display the object at the index 0 lets say the output is [object] button

now I want to reverse it…

when i click the object button

button.addEventListener(MouseEvent.CLICK, onClick)

function onClick(e:MouseEvent)  
{  
trace(e.currentTarget.???)

//I want to trace what index number is that button, the output should be “0”

}
