Did a search and found nothing so if it has been coverd sorry.
I want a button that whne u rollover does the aniamtion but if u rollout it stops where it is and plays back.
Up until now i have jsut been putting hte same aniamtion in the Up state and in the over state jsut reversed. So when the button is in its up state it jsut plays the reverse of the over state. This cna lead to a choppy look cause if you mouse off fast enough it looks like it jumps to the last frame then plays.
I’ve uploaded a FLA of my current way of doing button aniamtions BUTTON FLA
*note if the user rolls off the button and off the movie clip too quickly it will freeze in its rewind motion and will stay there until the user rolls over it again. But you don’t need to worry about this unless your movie is right next to the edge of the movie’s border.
I say obfuscate the darn thing!!
[AS]myMovieClip.onEnterFrame = function() {
var hit = this.hitTest(_root._xmouse, _root._ymouse, true);
this.gotoAndStop(this._currentframe+hit-!hit);
};[/AS]
There are a couple (surely more) things you could try…
Store the instance name of the MovieClips in an Array
[AS]myClips = [myClip1, myClip2, etc, etc];
for (i=0; i<myClips.length; myClips++) {
myClips*.onEnterFrame = function() {
var hit = this.hitTest(_root._xmouse, _root._ymouse, true);
this.gotoAndStop(this._currentframe+hit-!hit);
};
}[/AS]
Define it as a Method
[AS]MovieClip.prototype.backAndForth = function() {
this.onEnterFrame = function() {
var hit = this.hitTest(_root._xmouse, _root._ymouse, true);
this.gotoAndStop(this._currentframe+hit-!hit);
};
};
myClip1.backAndForth();
myClip2.backAndForth();
etc.backAndForth();
etc.backAndForth();[/AS]