# Stopping a HitTestObject after a certain frame

**URL:** <https://forum.kirupa.com/t/stopping-a-hittestobject-after-a-certain-frame/310340>\
**Category:** flash\
**Created:** [June 8, 2010, 1:01am UTC](https://forum.kirupa.com/t/stopping-a-hittestobject-after-a-certain-frame/310340 "2010-06-08T01:01:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stanford151](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@stanford151](https://forum.kirupa.com/u/stanford151)\
**Post date:** [June 8, 2010, 1:01am UTC](https://forum.kirupa.com/t/stopping-a-hittestobject-after-a-certain-frame/310340/1 "2010-06-08T01:01:22Z")

</div>

I am placing my code within frames and using the code below to hit test an object. After the animated object leaves the stage, the hit test starts getting errors because it is now looking for an object that isn’t there. NULL

```
 Code:

```

```auto
var o1:MovieClip;
o1.addEventListener(Event.ENTER_FRAME, o1hit);
function o1hit(Event) {
    if (circle_mc.hitTestObject(o1)) {
        playerLives-=1;
        gotoAndStop(2);
    }
}

```

So the question is: How can I get the Hit Test to stop after a certain frame? …Or does it have to do with the EventListener?
