I’d like to limit the scrolling of the Infinite Menu to an area NEAR the menu and not when the cursor is anywhere on the stage.
See the original tutorial for the Infinite Menu:
I’m assuming that, to do this, I would need to use an if/else script with the condition being a rectangle of coordinates on the stage and a result of a scrolling menu when the cursor is within those coordinates.
I found this code on another thread for a similar menu idea but can’t figure it out how to fit the Infinite Menu script into it (see http://www.kirupaforum.com/forums/showthread.php?t=61563&highlight=mouse+coordinates for entire thread):
onClipEvent(load){
this._x=0; //set original x
this._y=0; //set original y
divider=5; //speed
numx=this._x; //numx is destination x
numy=this._y; //numy is destination y
}
onClipEvent(enterFrame){
if(_xmouse>300) {
numx=-1; //set destination x
}
else{
numx=9; //set destination x
}
x=numx-_x; //setup variable named x
this._x+=x/divider; //see the x transition
//y=numy-_y; //setup variable named y
//this._y+=y/divider; //see the y transition
}
onClipEvent (load) {
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endY = _root._ymouse;
_y += (endY-_y)/speed;
}
And here’s the Infinite Menu code I’d like to use as the result of the coordinates coding:
onClipEvent (load) {
ycenter = 375;
speed = 10/100;
}
onClipEvent (enterFrame) {
var distance = _root._ymouse-ycenter;
_y += -(distance*speed);
if (_y>0) {
_y = -596;
}
if (_y<-596) {
_y = 0;
}
}
Thanks for any help!!