-
Fetch me my veggie shake ramon
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.
-
Senior Member
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.
-
Fetch me my veggie shake ramon
Learn thinking, not software.
-
Senior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|