# {f}MX- mouse actions

**URL:** <https://forum.kirupa.com/t/f-mx-mouse-actions/130963>\
**Category:** Uncategorized\
**Created:** [December 10, 2004, 3:23am UTC](https://forum.kirupa.com/t/f-mx-mouse-actions/130963 "2004-12-10T03:23:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kip](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@kip](https://forum.kirupa.com/u/kip)\
**Post date:** [December 10, 2004, 3:23am UTC](https://forum.kirupa.com/t/f-mx-mouse-actions/130963/1 "2004-12-10T03:23:36Z")

</div>

Hoy hoy  
I have a scroll going that I need to stop when the mouse has left the window that the MC is playing in. can someone help out or point me in the right direction?

here is what I have:

onClipEvent (load)  
{  
xcenter=500;  
speed=1/30;  
}  
onClipEvent (enterFrame)  
{  
var distance=\_root.\_xmouse-xcenter;  
\_x-=(distance\*speed);  
if (\_x \> 0) \_x=1;  
if (\_x \< -560) \_x=-560;  
}

I need it to work with this function.

Thanks in advance  
Kip
