OZONE Asylum
Forums
Multimedia/Animation
Flash Actionscript: Elastic probs
This page's ID:
11487
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I have a piece of code, that when placed onto a symbol will make it "bounce" out with an elastic effect: onClipEvent (enterFrame) { [i]elastic effect[/i] } . That's all fine and dandy until I come to the problem of getting the elastic protrusion of the symbol to "retract" after a certain trigger in my movie. I was wondering if there is some kind of AS that can set a timer and/or set a trigger for a frame name/number without having to add a keyframe to trigger the retraction. Is this possible? Here is my code: [code] onClipEvent (load) { this.elasticScale = function(tar, accel, convert) { xScale = xScale * accel + (tar - this._xscale) * convert; yScale = yScale * accel + (tar - this._yscale) * convert; this._xscale += xScale; this._yscale += yScale; } } onClipEvent(enterFrame){ this.elasticScale(220,0.5,0.3) } [/code] Additionally, here is some other code that actually does what I need for a button symbol when you rollout. However, I can't rely on mouse interaction to trigger the retraction: [code] onClipEvent (load) { this.elasticScale = function(tar, accel, convert) { xScale = xScale * accel + (tar - this._xscale) * convert; yScale = yScale * accel + (tar - this._yscale) * convert; this._xscale += xScale; this._yscale += yScale; } } onClipEvent(enterFrame){ if(this.hitTest(_root._xmouse,_root._ymouse,true)){ this.elasticScale(125,0.7,0.4) }else if (!this.hitTest(_root._xmouse,_root._ymouse,true)){ this.elasticScale(100,0.7,0.4) } } [/code] Notice it goes to 125% the actual size on this.hitTest and retracts back to 100% on rollout... Any help is appreciated! [This message has been edited by Thumper (edited 03-11-2004).]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »