# Containing Mouse/Movie Movement

**URL:** <https://forum.kirupa.com/t/containing-mouse-movie-movement/186177>\
**Category:** flash\
**Created:** [April 19, 2006, 3:58pm UTC](https://forum.kirupa.com/t/containing-mouse-movie-movement/186177 "2006-04-19T15:58:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thesneak](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@thesneak](https://forum.kirupa.com/u/thesneak)\
**Post date:** [April 19, 2006, 3:58pm UTC](https://forum.kirupa.com/t/containing-mouse-movie-movement/186177/1 "2006-04-19T15:58:29Z")

</div>

I am making an interactive map and am trying to contain my mouse movement to only stay within a certain box instead of the whole page / flash movie template.

I have made a Movie Clip and given it an Instance Name of “menu”

This is the code I have used to make the mouse move all around at free will.  
[COLOR=“Grey”]difference = \_xmouse - arrow.\_x;  
arrow.\_x = arrow.\_x + (difference/delay);  
menu.\_x = - arrow.\_x;

difference = \_ymouse - arrow.\_y;  
arrow.\_y = arrow.\_y + (difference/delay);  
menu.\_y = - arrow.\_y;

//second frame

prevFrame();  
play();[/COLOR]

Here’s a link to the actual file so you can look at it and know exactly what I mean. \> [http://www.inkworth.com/smart/map.html](http://www.inkworth.com/smart/map.html) \<

I want to keep that mouse movement for that map inside the grey box so when I move outside of it, the map stops moving.

Can anyone help??

---

<div class="post-metadata">

**Author:** ![thesneak](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@thesneak](https://forum.kirupa.com/u/thesneak)\
**Post date:** [April 20, 2006, 2:16pm UTC](https://forum.kirupa.com/t/containing-mouse-movie-movement/186177/2 "2006-04-20T14:16:54Z")

</div>

Someone Suggested to me a HIT TEST? Does anyone know how to add this to the code at hand? so the movement inside the box only moves when the MOUSE IS MOVING OVER IT ??
