# \_x following mouse

**URL:** <https://forum.kirupa.com/t/-x-following-mouse/51454>\
**Category:** flash\
**Created:** [May 13, 2004, 2:33am UTC](https://forum.kirupa.com/t/-x-following-mouse/51454 "2004-05-13T02:33:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramo\_integ](https://avatars.discourse-cdn.com/v4/letter/r/b782af/32.png) [@ramo\_integ](https://forum.kirupa.com/u/ramo_integ)\
**Post date:** [May 13, 2004, 2:33am UTC](https://forum.kirupa.com/t/-x-following-mouse/51454/1 "2004-05-13T02:33:05Z")

</div>

onClipEvent (load){  
\_x = 0;  
speed = 8;  
}  
onClipEvent (enterFrame){  
endX = \_root.\_xmouse;  
\_x +=(endX-\_x)/speed;  
}

that’s my code for my movie clip to follow the mouse ( i actually use it for navigation purposes)…but the fault is it follow the mouse all over the screen (well only on the x- axis) … i only want it to be over the nav , indicating what button ur on…how would i do that and have it stay on the button that i have clicked??
