# removingChild from customclass

**URL:** <https://forum.kirupa.com/t/removingchild-from-customclass/290407>\
**Category:** flash\
**Created:** [June 14, 2009, 9:56am UTC](https://forum.kirupa.com/t/removingchild-from-customclass/290407 "2009-06-14T09:56:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SonOfChaos](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@SonOfChaos](https://forum.kirupa.com/u/SonOfChaos)\
**Post date:** [June 14, 2009, 9:56am UTC](https://forum.kirupa.com/t/removingchild-from-customclass/290407/1 "2009-06-14T09:56:53Z")

</div>

Okay, I’ve got a simple piece of hit detection below, when they detect a hit, they call a couple of custom functions from the classes. Well, I can’t use ‘removeChild’ here cause it would remove the object before the ‘die’ animation plays. So I figure I have to remove the object from the class. How? I am a noob so forgive me if I’ve skewered a few terms.

```auto

for(var b=0; b<blastArray.length;b++){
                for(var s=0; s<boxArray.length;s++){
                    if(blastArray**.hitTestObject(boxArray[s])){
                        trace('HIT!!!!');
                        boxArray[s].die();
                        blastArray**.hit();
                        //removeChild(boxArray[s]);
                        boxArray.splice(s,1);
                        //removeChild(blastArray**);
                        blastArray.splice(b,1);
                    }
                }
            }

```
