omegacore
07-09-2008, 12:25 PM
So I have this flash button I'm making, I wanted a consistent animation so I wrote a bit of actionscript to manage the animation.
This button animation is 5 frames to the button up position and 5 frames back to the regular button position.
The idea behind the code is to collect the current frame from the movie clip and then jump to "the other side" of the animation.
For example, say you rollover the movie at frame 1, and then rolloff at frame 3. The code changes your timeline position to frame 7 and finishes the clip.
Code:
on (rollOver) {
playframe = this._currentframe;
gotoAndPlay(playframe);
}
on (rollOut) {
playframe = this._currentframe;
gotoAndPlay(10 - playframe);
}
The problem is that the button is sticky sometimes, and stays in the up position when you roll your mouse over it. I want the button to be flawless so how can I improve this method?
The button file is attached
thanks!
This button animation is 5 frames to the button up position and 5 frames back to the regular button position.
The idea behind the code is to collect the current frame from the movie clip and then jump to "the other side" of the animation.
For example, say you rollover the movie at frame 1, and then rolloff at frame 3. The code changes your timeline position to frame 7 and finishes the clip.
Code:
on (rollOver) {
playframe = this._currentframe;
gotoAndPlay(playframe);
}
on (rollOut) {
playframe = this._currentframe;
gotoAndPlay(10 - playframe);
}
The problem is that the button is sticky sometimes, and stays in the up position when you roll your mouse over it. I want the button to be flawless so how can I improve this method?
The button file is attached
thanks!