# Infinit menu and buttonlinking

**URL:** <https://forum.kirupa.com/t/infinit-menu-and-buttonlinking/50823>\
**Category:** flash\
**Created:** [May 6, 2004, 7:47pm UTC](https://forum.kirupa.com/t/infinit-menu-and-buttonlinking/50823 "2004-05-06T19:47:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefaan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Stefaan](https://forum.kirupa.com/u/Stefaan)\
**Post date:** [May 6, 2004, 7:47pm UTC](https://forum.kirupa.com/t/infinit-menu-and-buttonlinking/50823/1 "2004-05-06T19:47:14Z")

</div>

Hello I have a problem,  
When I use the following code then I can put a link in the buttons of the menu to go to another framelabel.

onClipEvent (load)  
{  
xcenter=294;  
speed=1/70;  
}  
onClipEvent (enterFrame)  
{  
var distance=\_root.\_xmouse-xcenter;  
\_x+=(distance\*speed);  
}

onClipEvent (enterFrame)  
{  
var distance=\_root.\_xmouse-xcenter;  
\_x+=(distance\*speed);  
if (\_x \> 0) \_x=-408;  
if (\_x \< -408) \_x=0;  
}

When add the following code above this the buttons don’t work anymore

on(rollOver){  
speed=1/30;  
}on(rollOut){  
speed=1/900;  
{

onClipEvent (load)  
{  
xcenter=294;  
}  
onClipEvent (enterFrame)  
{  
var distance=\_root.\_xmouse-xcenter;  
\_x+=(distance\*speed);  
}

onClipEvent (enterFrame)  
{  
var distance=\_root.\_xmouse-xcenter;  
\_x+=(distance\*speed);  
if (\_x \> 0) \_x=-408;  
if (\_x \< -408) \_x=0;  
}

I use this code to make the rolling menu stop when I roll out of it.  
Is there anyone who can help me with this.

Thanks
