help with the Kirupa's 'infinite menu'
I would love to make this animation stop once the user rolls off the animation, so that its not whizzing by when the mouse is at the other end of the screen.
http://www.kirupa.com/developer/mx/infinite.htm
I dont really understand all the code that went into making this work, but I was able to manipulate it to fit my design. Any help tweaking the code so that it stops when the mouse is not over it would be appreciated.
Thanks.
Maybe you can adapt this to what you are trying to do...
Change the mask graphic into a movie clip and give it an instance name (ex: maskMC). Use an if statement with a hitTest, to see if the cursor is over the mask.
Code:
onClipEvent (load) {
xcenter = 150;
speed = 1 / 10;
}
onClipEvent (enterFrame) {
if (this._parent.maskMC.hitTest(_root._xmouse, _root._ymouse)) {
var distance = _root._xmouse - xcenter;
_x += (distance * speed);
if (_x > 0) {
_x = -300;
}
if (_x < -300) {
_x = 0;
}
}
}