# getChildAt (strict/normal) problem

**URL:** <https://forum.kirupa.com/t/getchildat-strict-normal-problem/315739>\
**Category:** flash\
**Created:** [November 3, 2010, 6:25am UTC](https://forum.kirupa.com/t/getchildat-strict-normal-problem/315739 "2010-11-03T06:25:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vfistri1](https://avatars.discourse-cdn.com/v4/letter/v/d2c977/32.png) [@vfistri1](https://forum.kirupa.com/u/vfistri1)\
**Post date:** [November 3, 2010, 6:25am UTC](https://forum.kirupa.com/t/getchildat-strict-normal-problem/315739/1 "2010-11-03T06:25:20Z")

</div>

for example i have a public class Title with publicfunction destroy(); in it  
than in my main class i create 1 sprite and some Titles than i sprite.addChild(title) for every title i have created which works ok.  
i have tried invoking destroy method manually and it also works fine but when i try the following code flash builder reports error

```auto

            while(sprite.numChildren > 0){
                sprite.removeChildAt(0);
                sprite.getChildAt(0).destroy();
            }

```

error: 1061: Call to a possibly undefined method destroy through a reference with static type flash.display:DisplayObject.

I think the problem might be builder mybe can’t know that every child of sprite will be able to provide destroy(); method ( or in other words it shall be instance of class Title) … but how to tell him that it’s ok without exiting strict mode?
