# hiTest bug, or am I just stupid?

**URL:** <https://forum.kirupa.com/t/hitest-bug-or-am-i-just-stupid/314057>\
**Category:** programming\
**Created:** [September 17, 2010, 1:27am UTC](https://forum.kirupa.com/t/hitest-bug-or-am-i-just-stupid/314057 "2010-09-17T01:27:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ikazuchi](https://avatars.discourse-cdn.com/v4/letter/i/8dc957/32.png) [@ikazuchi](https://forum.kirupa.com/u/ikazuchi)\
**Post date:** [September 17, 2010, 1:27am UTC](https://forum.kirupa.com/t/hitest-bug-or-am-i-just-stupid/314057/1 "2010-09-17T01:27:58Z")

</div>

Long story short, I created a plane shooting @ the boss. When the bullet hits Boss, it is removed. When the boss’ life hits 0, it is removed. Both are removed via this.parent.removeChild(this).

The problem is that after the boss “dies” (no syntax/runtime errors), the hitTestObject still seem to be active. I now have this blank spot where the Boss used to be that is detecting and removing the bullet.

hitTest code:

```auto
if (this.hitTestObject(target)){
     this.removeEventListener(Event.ENTER_FRAME, moveBullet);
     MovieClip(this.parent).removeChild(thisBullet);
     target.hit(25);
   }

```

remove code:

```auto
this.removeEventListener(Event.ENTER_FRAME, eFrameEvents);
   if(this.parent){
    this.parent.removeChild(this);
   }

```

Maybe i am overlooking something so minute?
