# How to stop infinite Menu?

**URL:** https://forum.kirupa.com/t/how-to-stop-infinite-menu/49344
**Category:** flash
**Created:** [April 21, 2004, 8:51pm UTC](https://forum.kirupa.com/t/how-to-stop-infinite-menu/49344 "2004-04-21T20:51:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Azazel](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Azazel](https://forum.kirupa.com/u/Azazel)
#### Post date: [April 21, 2004, 8:51pm UTC](https://forum.kirupa.com/t/how-to-stop-infinite-menu/49344/1 "2004-04-21T20:51:46Z")

</div>

Hi all!

I was just wondering what I have to ad to this as to make the menu stop when someone drags over it… and the start again when they roll out?!

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

```
