A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: help with the Kirupa's 'infinite menu'

  1. #1
    Junior Member
    Join Date
    Aug 2008
    Posts
    1

    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.

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518

    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;
    		}
    	}
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center