# Can't stop a scrolling menu

**URL:** <https://forum.kirupa.com/t/cant-stop-a-scrolling-menu/182632>\
**Category:** flash\
**Created:** [March 20, 2006, 5:34am UTC](https://forum.kirupa.com/t/cant-stop-a-scrolling-menu/182632 "2006-03-20T05:34:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nugget699](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@Nugget699](https://forum.kirupa.com/u/Nugget699)\
**Post date:** [March 20, 2006, 5:34am UTC](https://forum.kirupa.com/t/cant-stop-a-scrolling-menu/182632/1 "2006-03-20T05:34:28Z")

</div>

I can’t seem to stop my scrolling menu. Its an infinate menu but instead of going around and around, I want it to stop at both ends once the user reaches the end. The code on the menu bar is as follows

```auto
 onClipEvent (load)
{
   xcenter=150;
   speed=1/10;
}
onClipEvent (enterFrame)
{
   var distance=_root._xmouse-xcenter;
   _x+=(distance*speed);
}
 onClipEvent (enterFrame)
{
   var distance=_root._xmouse-xcenter;
   _x+=(distance*speed);
   if (_x < 0) stop();
   if (_x > -1130) stop();
}

```

The attachment is the said file, if anyone can solve this problem I’d be ever so greatful, me and my beginner questions:crying:
