# Hit test

**URL:** <https://forum.kirupa.com/t/hit-test/36559>\
**Category:** Uncategorized\
**Created:** [November 28, 2003, 5:39am UTC](https://forum.kirupa.com/t/hit-test/36559 "2003-11-28T05:39:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cubed](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@cubed](https://forum.kirupa.com/u/cubed)\
**Post date:** [November 28, 2003, 5:39am UTC](https://forum.kirupa.com/t/hit-test/36559/1 "2003-11-28T05:39:29Z")

</div>

Okay I have two movie clips on my main timeline. (red and con) i have con do a hit test

```auto

onClipEvent (enterFrame) {
    if (_root.con, hitTest(_root.red)) {
        hit = 1;
    } else {
        hit = 0;
    }
}

```

hit is a text box inside con. This, so far, works just like the code says. The mc “con” has two frames. The first frame contains:

```auto
stop();
if (hit == 1) {
    gotoAndStop(2);
}
if (hit=! 1) {
    gotoAndStop(1);
}

```

and the second frame contains

```auto
stop();

```

So, the mc “con” is supposed to goto frame two when hit==1 and when hit=! 0 it should goto frame one ( or just stay where it is). This whole part doesnt seem to work and I cant figure out why.
