# getChildAt with totalFrames

**URL:** <https://forum.kirupa.com/t/getchildat-with-totalframes/240463>\
**Category:** flash\
**Created:** [October 3, 2007, 6:59am UTC](https://forum.kirupa.com/t/getchildat-with-totalframes/240463 "2007-10-03T06:59:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickjv](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@patrickjv](https://forum.kirupa.com/u/patrickjv)\
**Post date:** [October 3, 2007, 6:59am UTC](https://forum.kirupa.com/t/getchildat-with-totalframes/240463/1 "2007-10-03T06:59:12Z")

</div>

I have a number of childs added in a movie, I’m using a for() loop to see if childs have reached the end of their individual timelines. If so, they’ll be removed. childs have been put in array ‘obj’ . Now when I trace

obj[j].currentFrame and obj[j].totalFrames

it results neatly in their momentary frame point and total frames value. But when I trace

getChildAt(j).currentFrame and getChildAt(j).totalFrames

I get error  
“1119: Access of possibly undefined property currentFrame through a reference with static type flash.display:DisplayObject.”

I need to go with the for() loop through the getChildAt(j) since obj[j] won’t work. Why? -\>  
Once childs are deleted then the stacking order obj[j] won’t remain value ‘j’ anymore … depth levels are changed and getChildAt(j) won’t point anymore to obj[j] … getChildAt(1) will be obj[2], then after next remove obj[3] and so on.

So the milion dollar question, what’s wrong with syntax

getChildAt(j).currentFrame

??  
anyone?  
P
