One more cool tween to add to this thread, so I can point people to it for future reference.
A spring-effect in which the button is scaled with a spring-like motion. Here's the script:
And a sample FLA file demonstrating the effect is enclosed.Code:onClipEvent (load) { this.speed = 0; // current tween velocity this.tScale = 100; // target scale this.stiffness = .3; // (from 0-1 or so) spring stiffness - large numbers make the spring 'stiffer' this.damping = .8; // (from 0-1) affects rate of decay - lower numbers make spring settle faster } // spring animation code onClipEvent (enterFrame) { var ds = this.tScale - this._xscale; this.speed += ds*this.stiffness; this.speed *= this.damping; this._xscale += this.speed; this._yscale += this.speed; } // we set the desired xcales/yscale here on (rollOver) { this.tScale = 120; } on (rollOut) { this.tScale = 100; }




Reply With Quote