A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Animated Rollover, RollOut Style Pop ups

  1. #1
    Fetch me my veggie shake ramon
    Join Date
    Feb 2003
    Location
    UK
    Posts
    19

    Animated Rollover, RollOut Style Pop ups

    Please help anyone who feels that they are able to!

    I have a problem, in reprogramming my portfolio I wish to make an interface where by if the viewer were to Roll over a button, information would emerge, and on roll off, the information returns in a reverse of the emergence animation (Does that make sense?) I've managed to make it do so by complicated means (i.e minimal use of action script) but cannot make it so that if the user were to roll off before roll over sequence has finished the animation simply reverses. All mine does is jump to the end of roll over sequence and then play out the reverse. I have limited Script knowledge but any help would be really appreciated.
    Learn thinking, not software.

  2. #2
    Senior Member Computer Dork's Avatar
    Join Date
    Mar 2001
    Location
    St. Louis
    Posts
    1,026
    ok - once you read through this you will slap yourself in the head because it sounds so simple. The trick is to never play the movie.

    (inside the button MC) - for this example we will pretend that your button MC's have only 10 frames inside them.

    First open your MC that you want to use as a button. Then you need to make a new layer, and put a blank MC on the stage - anywhere. Give this an instance name of "smarty". Right click "smarty" and drop out the actions panel.

    Code:
    onClipEvent(enterFrame)  {
    	if ((_parent.backwards)&&(_parent._currentframe >= 1))  {
    		_parent.gotoAndStop(_parent._currentframe-1);
    	}else{
    		_parent.backwards=false;
    	}
    	if ((_parent.forwards)&&(_parent._currentframe<10))  {
    		_parent.gotoAndStop(_parent._currentframe+1);
    	}else{
                    _parent.forwards=false;
            }
    }
    ok - we are now done inside the clip. back out to your main stage (or whereever you have the buttons housed) and put this on each of the buttons:
    Code:
    on(rollOver)  {
    	this.forwards=true;
    	this.backwards=false;
    }
    
    on (rollOut)  {
    	this.backwards=true;
    	this.forwards=false;
    }
    That's it! Hope this will help you.

  3. #3
    Fetch me my veggie shake ramon
    Join Date
    Feb 2003
    Location
    UK
    Posts
    19
    Thank you!
    Learn thinking, not software.

  4. #4
    Senior Member Computer Dork's Avatar
    Join Date
    Mar 2001
    Location
    St. Louis
    Posts
    1,026
    not a problem.

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