# \[MX2004\]hitTest problem

**URL:** <https://forum.kirupa.com/t/mx2004-hittest-problem/188768>\
**Category:** Uncategorized\
**Created:** [May 10, 2006, 4:15pm UTC](https://forum.kirupa.com/t/mx2004-hittest-problem/188768 "2006-05-10T16:15:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mr\_vai](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mr\_vai](https://forum.kirupa.com/u/mr_vai)\
**Post date:** [May 10, 2006, 4:15pm UTC](https://forum.kirupa.com/t/mx2004-hittest-problem/188768/1 "2006-05-10T16:15:54Z")

</div>

hello all!  
i have written a little script for a navigation menu and basically all i want to do is to use hitTest to check if the cursor is on the navigation, and if so i want to play a simple shape tween opening animation, and if the cursor is out of the navigation i want to play a shape tween closing animation sounds simple enough right? but for some reason it doesnt run through the animation it just going there and stops, well heres the code…

```auto

onClipEvent (enterFrame)
{
    var Mousex = _root._xmouse;
    var Mousey = _root._ymouse;

    if (this.hitTest(Mousex,Mousey)) 
    {
    this.gotoAndPlay("On");
    } else {
    this.gotoAndPlay("Off");
    }
}

```

Ive included a screen capture of the animation as well

Thanks for watching:)
