# onMouseMove if \_xmouse/\_ymouse play MC help

**URL:** <https://forum.kirupa.com/t/onmousemove-if--xmouse--ymouse-play-mc-help/164872>\
**Category:** flash\
**Created:** [October 5, 2005, 6:07pm UTC](https://forum.kirupa.com/t/onmousemove-if--xmouse--ymouse-play-mc-help/164872 "2005-10-05T18:07:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emolen](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@emolen](https://forum.kirupa.com/u/emolen)\
**Post date:** [October 5, 2005, 6:07pm UTC](https://forum.kirupa.com/t/onmousemove-if--xmouse--ymouse-play-mc-help/164872/1 "2005-10-05T18:07:05Z")

</div>

So here is the scenario:  
There is a touch screen which only detects onMouseMove and on(press) but nothing else, like on(rollOver) etc. I have a grid of MC’s that are placed in the following coordinates and triggered as follows:

onMouseMove=function(){  
if(\_xmouse\>=250 && \_xmouse\<=310 && \_ymouse\>=170 && \_ymouse\<=230)  
{\_root.fc\_2.mc.circle\_bt.gotoAndPlay(2)};

```
if(_xmouse&gt;=190 && _xmouse&lt;=250 && _ymouse&gt;=170 && _ymouse&lt;=230)
{_root.fc_1.mc.circle_bt.gotoAndPlay(2)};

```

etc.

the problem is that I only want the MC to play once upon entering the x y coordinates and again after the mouse re-enters etc, but if the mouse moves into the specified x y coordinates it plays from frame 2, but as soon as the mouse moves again or continues to move it continues to return to frame 2 because that’s what I’m telling it to do. Was thinking of adding a counter that would allow the MC to play all the way through, but I was hoping someone might have a suggestion to grid out the x and y coordinates and have it function as I wish.

Any ideas, is this clear, do I sound crazy???

PS I don’t think hitTests will work because it doesn’t know when it is over something it only knows where in the movie the mouse is.
