# On mouseover. on a infinite menu

**URL:** https://forum.kirupa.com/t/on-mouseover-on-a-infinite-menu/128245
**Category:** Uncategorized
**Created:** [November 10, 2004, 7:55pm UTC](https://forum.kirupa.com/t/on-mouseover-on-a-infinite-menu/128245 "2004-11-10T19:55:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![snall](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@snall](https://forum.kirupa.com/u/snall)
#### Post date: [November 10, 2004, 7:55pm UTC](https://forum.kirupa.com/t/on-mouseover-on-a-infinite-menu/128245/1 "2004-11-10T19:55:20Z")

</div>

i’ve created av “infinite menu” a menu that moves in a direction depending on the position of the mouse. I need a little help to make it stop whenever the mouse aint over the menu.

Here’s the menu:  
[color=#003366][http://w1.314.telia.com/~u31451278/menytest.swf[/color][url=“http://w1.314.telia.com/menytest.swf”]](http://w1.314.telia.com/~u31451278/menytest.swf)

and here’s the code for the function:  
onClipEvent (load) {  
xcenter = 150;  
speed = 1/20;  
}  
onClipEvent (enterFrame) {  
var distance = \_root.\_xmouse-xcenter;  
\_x += (distance\*speed);  
if (\_x\>0) {  
\_x = -366.9;  
}  
if (\_x\<-366.9) {  
\_x = 0;  
}  
}

This is just a beta version so the grapics aren’t correct.

Could anyone help me please, it’s for a school project
