# Detecting Mice & Target Telling

**URL:** <https://forum.kirupa.com/t/detecting-mice-target-telling/256437>\
**Category:** Uncategorized\
**Created:** [April 3, 2008, 12:40am UTC](https://forum.kirupa.com/t/detecting-mice-target-telling/256437 "2008-04-03T00:40:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![miniPhat](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@miniPhat](https://forum.kirupa.com/u/miniPhat)\
**Post date:** [April 3, 2008, 12:40am UTC](https://forum.kirupa.com/t/detecting-mice-target-telling/256437/1 "2008-04-03T00:40:49Z")

</div>

Hey everyone ! Long time no see… .

So I’m trying to use a mouse detection script to basically Tell a MovieClip to goToAndStop a certain frame. … . .here’s the link to the project in focus.

[http://insitenetworks.com/5seasons/](http://insitenetworks.com/5seasons/)

when it opens, you’ll see my menu and how each button has a rollover. All the rollover effects are contained in “\_root.nav1.underz” mc and I’d love to detect the mouse when it’s a few pixels above the LOGIN button and a few pixels below the CONTACT US button to goToAndStop frame 1 of that Movie Clip “underz”. and not just above the text itself, but a rectangle shape that covered most off that inner area there… .I built an “invisible moat” to do the trick, but I know there’s got to be an Action to detect and tell.

I found this and thought it looked like it’s on the right track, but as I’m not affluent in AS I’m stuck for a solution. . .

this was placed on an actual rectangle MC. but not sure if it’s the best way to do it.

I was thinking like: if mouse is between x and y (or within a defined rectangle area) then do nothing (null?), but if mouse leaves that area then goToAndStop frame 1… . … sounds easy enough. … but is it ? I’m looking for a clean solution that won’t give it away like the moat does (changing the cursor to the hand, insinuating a clickable region)… . .

thx and looking forward to hearing from someone !

miniPhat… … . .

onClipEvent (mouseMove) {  
if (this.hitTest(\_root.\_xmouse, \_root.\_ymouse, true)) {  
trace(“Relative Mouse Position: (”+\_xmouse+", “+\_ymouse+”)");  
}  
}
