Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RollOut Action

Status
Not open for further replies.

Copierbw

Technical User
Sep 25, 2002
112
IE
When you have a button that activates a movie clip to start to play on the "RollOver" action and you have another function on the same button that activates when you "RollOut" for the same movie clip but only to reverse the frames(to the original position).
My question, can you tell the movie clip to start reversing from the current position with actionscript.
The problem, if you just reversed the frames, on "RollOut", the movieclip will begin from the end point and play, but what if the "RollOver" function haven't finished, then you will have a incomplete first movie part?
 
yes you can reverse the mc via actionscript:

make a square or whatever outside the stage and convert it into a mc and name it MCControl. then you edit the mc as follows:

1st frame:keyframe that says:

stop();


2nd frame:keyframe that says:

if(_root.pathToMovieClip._currenframe>1){
_root.pathToMovieClip.prevFrame();
}
else{
_root.pathToMovieClip.stop();
gotoAndStop(1);
}


3rd frame:keyframe that says :

if(_root.pathToMovieClip._currenframe>1){
_root.pathToMovieClip.prevFrame();
gotoAndPlay(2);
}
else{
_root.pathToMovieClip.stop();
gotoAndStop(1);
}

on the button you want to do the animation with you put:

on(rollover){
pathToAnimation.play();
}
on(rollout){
_root.MCControl.play();
}


think that should work, if not or something's unclear feel free to contact me.

sorry, i'm in a hurry now so no 100% guarantee for 0% mistakes.

regards

Firegambler
 
Thanks for the help, I'll try it and let you know....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top