# Boundry for Infinite menu- - -

**URL:** https://forum.kirupa.com/t/boundry-for-infinite-menu/64284
**Category:** Uncategorized
**Created:** [September 14, 2004, 8:53pm UTC](https://forum.kirupa.com/t/boundry-for-infinite-menu/64284 "2004-09-14T20:53:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![johnnyFlash](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@johnnyFlash](https://forum.kirupa.com/u/johnnyFlash)
#### Post date: [September 14, 2004, 8:53pm UTC](https://forum.kirupa.com/t/boundry-for-infinite-menu/64284/1 "2004-09-14T20:53:14Z")

</div>

Hi all! 🙂

I’ve searched around for an answer to this on the forums’ archives, but to no avail ☹

All i need to do is put a boundry for the infinite menu to stop at for the left and right.  
This is my code from the tut:  
[AS]  
onClipEvent (load)  
{  
xcenter=150;  
speed=1/10;  
}  
onClipEvent (enterFrame)  
{  
var distance=\_root.\_xmouse-xcenter;  
\_x+=(distance\*speed);  
if (\_x \> 0) \_x=-300;  
if (\_x \< -300) \_x=0;  
}  
[/AS]

And if there is already a thread about boundries for the infinite menu…can you just direct me there? **Thanks so, so much!**

Johnny

---

<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 15, 2004, 12:30am UTC](https://forum.kirupa.com/t/boundry-for-infinite-menu/64284/2 "2004-09-15T00:30:31Z")

</div>

Ok, ive decided to try something a little different.

Instead of the infinite menu, im going to be using buttons to move left and right.

So, on the left will be a button that moves the MC to the left, and vice versa for the button on the right.  
On the left button, i have:  
[AS]  
on (rollOver) {  
\_root.myMC.onEnterFrame = function(){  
var left = 146;  
var speed = 8;  
if (\_root.myMC.\_x \>= left) {  
this.\_x -= speed;  
}  
}  
}  
on (rollOut) {  
delete \_root.myMC.onEnterFrame  
}  
[/AS]  
This works at getting the MC to stop at 146 on the X axis. But, when i go to apply the code to my button on the right, it wont move to right.

What am i doing wrong? Please help :thumb:

---

<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 15, 2004, 7:11am UTC](https://forum.kirupa.com/t/boundry-for-infinite-menu/64284/3 "2004-09-15T07:11:21Z")

</div>

To give you all a visual of what im trying to do…check out this site

[http://www.saintsandsoldiers.com/](http://www.saintsandsoldiers.com/)

it’s the panaroma effect used.

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: [September 15, 2004, 10:39am UTC](https://forum.kirupa.com/t/boundry-for-infinite-menu/64284/4 "2004-09-15T10:39:09Z")

</div>

> [@johnnyFlash](#):
>
> To give you all a visual of what im trying to do…check out this site
> 
> [http://www.saintsandsoldiers.com/](http://www.saintsandsoldiers.com/)
> 
> it’s the panaroma effect used.
> 
> Thanks again!!!

Wow dude, nice work, nice.

---

<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 15, 2004, 4:29pm UTC](https://forum.kirupa.com/t/boundry-for-infinite-menu/64284/5 "2004-09-15T16:29:09Z")

</div>

no i didn’t make that site…i wish :p…thats an example of what i want to make; how the screen moves left and right and stops at certain points.

Need help urgently please! 🙂

---

<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 16, 2004, 2:13pm UTC](https://forum.kirupa.com/t/boundry-for-infinite-menu/64284/6 "2004-09-16T14:13:37Z")

</div>

any help…please?
