# Infinite menu needs to stop

**URL:** https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110
**Category:** flash
**Created:** [July 28, 2004, 3:15pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110 "2004-07-28T15:15:13Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![obey1](https://avatars.discourse-cdn.com/v4/letter/o/fbc32d/32.png) [@obey1](https://forum.kirupa.com/u/obey1)
#### Post date: [July 28, 2004, 3:15pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/1 "2004-07-28T15:15:13Z")

</div>

i have an infinite scrolling menu that works great. now, of course, it needs to stop whenever the mouse is not over the MC. any ideas? heres the script as written now:

```auto

_root.onEnterFrame = function() {
	_root.menu_mc._y += (.5*Stage.height-_ymouse)/10;
	if (menu_mc._y<-701) {
		menu_mc._y = 0;
	}
	if (menu_mc._y>0) {
		menu_mc._y = -701;
	}
};

```

to recap, when the mouse is over the menu, it needs to scroll. when it is NOT over the menu, it needs to stop. Thanks.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 3:22pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/2 "2004-07-28T15:22:22Z")

</div>

```auto
_root.menu_mc.onRollOver=funcion(){
 this.scroll=true
 }
 _root.menu_mc.onRollOut=funcion(){
 this.scroll=false
 }
 _root.menu_mc.onEnterFrame = function() {
 if(this.scroll==true){
 this._y += (.5*Stage.height-_ymouse)/10;
 if (this._y<-701) {
 this._y = 0;
 }
 if (this._y>0) {
 this._y = -701;
 }
 }
 };

```

or

```auto
_root.menu_mc.onRollOver=funcion(){
 this.onEnterFrame = function() {
 this._y += (.5*Stage.height-_ymouse)/10;
 if (this._y<-701) {
 this._y = 0;
 }
 if (this._y>0) {
 this._y = -701;
 }
 };
 }
 _root.menu_mc.onRollOut=funcion(){
 delete(this.onEnterFrame)
 }
    

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 3:55pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/3 "2004-07-28T15:55:48Z")

</div>

doesn’t work out. the menu is at a stand still. even when i changed “funcion” to “function”. anymore ideas?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 4:17pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/4 "2004-07-28T16:17:11Z")

</div>

huh?!  
\_root.menu\_mc.onRollOver=function(){  
this.onEnterFrame = function() {  
this.\_y += (.5\*Stage.height-\_ymouse)/10;  
if (this.\_y\<-701) {  
this.\_y = 0;  
}  
if (this.\_y\>0) {  
this.\_y = -701;  
}  
};  
}  
\_root.menu\_mc.onRollOut=function(){  
delete(this.onEnterFrame)  
}

if you roll over the mc, it starts scrolling. :h:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 4:22pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/5 "2004-07-28T16:22:41Z")

</div>

no…the menu sits in one spot…no scrolling when i rollOver it.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 5:00pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/6 "2004-07-28T17:00:03Z")

</div>

would there be any way to create variables for the menu using rollOver/rollOut (such as maybe rollOver=true and rollOut=false), then tell the menu “if…menu=true, play the scrolling menu”

not sure how to word all of this…thats where the help comes in. any help would be cool! thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 8:22pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/7 "2004-07-28T20:22:18Z")

</div>

anybody have ANY ideas…or am i SOL?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 11:02pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/8 "2004-07-28T23:02:49Z")

</div>

I still don’t see any problem

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 11:08pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/9 "2004-07-28T23:08:32Z")

</div>

> it needs to stop whenever the mouse is not over the MC.

what about

```auto
_root.onEnterFrame = function() {
	if(_root._xmouse<200){
	_root.menu_mc._y += (.5*Stage.height-_ymouse)/40;
	if (menu_mc._y<-701) {
		menu_mc._y = 0;
	}
	if (menu_mc._y>0) {
		menu_mc._y = -701;
	}
	}
};

```

where 200 is the border between menu and the rest of the movie

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 11:09pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/10 "2004-07-28T23:09:33Z")

</div>

well i would go for mcgivers option =)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 29, 2004, 3:12pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/11 "2004-07-29T15:12:48Z")

</div>

mcgiver…your script worked great for your movie. the problem (and i’m not sure why) is that on my movie, my scrolling menu has several different buttons within it that link to other MCs. with your script i could either have the buttons active (and the menu would not scroll) OR i could have the menu scroll (and the buttons wouldn’t work)…i have no idea what was keeping the both of them from working together.???

2nd day…your script worked out great. thanks

thanks for the help from both of you (and anyone else who took the time to help out). THANKS AGAIN

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 29, 2004, 3:50pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/12 "2004-07-29T15:50:47Z")

</div>

of course.  
if you call an on method on a parent clip, all “on” stuff inside gets disabled.

just for the records:  
some way to avoid that would be i.e.:

\_root.menu\_mc.sometransparentmc.onRollOver=function(){  
this.onEnterFrame = function() {  
\_parent.\_y += (.5\*Stage.height-\_ymouse)/10;  
if (\_parent.\_y\<-701) {  
\_parent.\_y = 0;  
}  
if (\_parent.\_y\>0) {  
\_parent.\_y = -701;  
}  
};  
}  
\_root.menu\_mc.sometransparentmc.onRollOut=function(){  
delete(this.onEnterFrame)  
}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 29, 2004, 3:55pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/13 "2004-07-29T15:55:25Z")

</div>

right…thats good to know. so you DO learn something new everyday, who knew (well…you of course). anyway, thanks again. by the way, i like your “pocket tanks” game you have going on with your posts…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 24, 2004, 1:31pm UTC](https://forum.kirupa.com/t/infinite-menu-needs-to-stop/59110/14 "2004-09-24T13:31:50Z")

</div>

all i did to stop mine from rolling:

changed:

```auto
onClipEvent (load)...

```

to:

```auto
on(rollOver)...

```

and added:

```auto
on(rollOut) {
   speed=0;
}

```

at the end.

seemed to work ok.
