all groups > flash (macromedia) > september 2005 >
You're in the

flash (macromedia)

group:

Animated Rollovers (in/out)


Animated Rollovers (in/out) levisternberg
9/3/2005 8:16:38 PM
flash (macromedia): ive given up. i've looked at various tutorials and forums. i need direct help

i want a button to animate in on rollover and reverse animate on rollout.
also if the mouse rolls OUT while the rollover animation is not complete it
should reverse at that exact point so there is no frame skippage.

i have very little knowledge of actionscript so if someone could give me some
code to just paste in i'll be happy.
Re: Animated Rollovers (in/out) NSurveyor
9/3/2005 8:26:00 PM
Make an animation inside a movieclip. Give that moviecip the instance name,
my_btn. Then, on the frame my_btn is on, add:

my_btn.stop();
my_btn.onRollOver = function(){
this.onEnterFrame = function(){
this.nextFrame();
if(this._currentframe==this._totalframes){
this.onEnterFrame = null;
}
}
}
my_btn.onRollOut = function(){
this.onEnterFrame = function(){
this.prevFrame();
if(this._currentframe==1){
this.onEnterFrame = null;
}
}
}
Re: Animated Rollovers (in/out) levisternberg
9/3/2005 9:35:43 PM
well my movieclip has to have a stop action at the first and last frames or
else it would just loop right when one opens the movie so how does the script
work then.

i understand the whole concept of OnRollOver:( ) and OnRollOut:( ) when those
events occur, then they can trigger other events. and i know how to link those
events to the movie timeline. but how can i affect timelines within
movieclips. does it have something to do with trace or _root ? i can figure
it out once i know what function opens up editing of a movieclip's own timeline.
Re: Animated Rollovers (in/out) levisternberg
9/3/2005 9:36:09 PM
Re: Animated Rollovers (in/out) levisternberg
9/3/2005 9:37:12 PM
Re: Animated Rollovers (in/out) levisternberg
9/3/2005 9:39:35 PM
Re: Animated Rollovers (in/out) NSurveyor
9/3/2005 9:42:01 PM
Re: Animated Rollovers (in/out) levisternberg
9/3/2005 9:53:29 PM
Re: Animated Rollovers (in/out) NSurveyor
9/3/2005 10:01:24 PM
Have a movieclip with the animation in it. Click on your movieclip. Open the
Properties Panel. Type in: my_btn where it says: <Instance Name>. Click on the
current frame on the timeline. Open up the Actions panel. Paste in:

my_btn.stop();
my_btn.onRollOver = function(){
this.onEnterFrame = function(){
this.nextFrame();
if(this._currentframe==this._totalframes){
this.onEnterFrame = null;
}
}
}
my_btn.onRollOut = function(){
this.onEnterFrame = function(){
this.prevFrame();
if(this._currentframe==1){
this.onEnterFrame = null;
}
}
}

Say, what version of Flash are you using? Flash MX 2004, Flash MX, Flash 5,
Flash 4 or earlier...?
Re: Animated Rollovers (in/out) levisternberg
9/7/2005 12:00:00 AM
Re: Animated Rollovers (in/out) NSurveyor
9/7/2005 12:00:00 AM
AddThis Social Bookmark Button