Boundry for Infinite menu- - -

Hi all! :slight_smile:

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

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

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:

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

http://www.saintsandsoldiers.com/

it’s the panaroma effect used.

Thanks again!!!

Wow dude, nice work, nice.

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! :slight_smile:

any help…please?