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.
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; } } }
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.
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...?
Don't see what you're looking for? Try a search.
|