Share Posted January 19, 2010 Hello, What would be the best way to do a quick Vibrating / Shake effect that eases into still? I can't figure it out- using AS2 or AS3? Thanks. Link to comment Share on other sites More sharing options...
Share Posted January 19, 2010 You should be able to use the RoughEase tool/class for this sort of thing. http://blog.greensock.com/roughease/. (note: it was just updated to make this even easier) Link to comment Share on other sites More sharing options...
Author Share Posted January 20, 2010 Thanks for the tip, I played with the roughEase a bit- I think i will need more time to experiment with it because I found an easier solution that worked for me. However my only problem is that TweenMax seems to be sticking on the first time it runs the tween... (i have the function running from a button release). On the 2nd click it plays fine, lag/hang. Is there some sort of initializing I should be doing? A portion of my AS2 code: import com.greensock.*; import com.greensock.plugins.*; import com.greensock.easing.*; TweenPlugin.activate([TransformMatrixPlugin, ColorMatrixFilterPlugin, VisiblePlugin, EndArrayPlugin]); function invalidTween(item:MovieClip):Void { TweenMax.to(item,0.3,{colorTransform:{redMultiplier:3}, delay:0.1}); TweenMax.to(item,0.5,{colorTransform:{redMultiplier:1}, ease:Quad.easeInOut, delay:0.5}); TweenMax.to(item,0.1,{repeat:2, _y:item._y+(1+Math.random()*2), _x:item._x+(1+Math.random()*2), delay:0.1, ease:Expo.easeInOut}); TweenMax.to(item,0.1,{_y:item._y+(Math.random()*0), _x:item._x+(Math.random()*0), delay:0.3, onComplete:onFinishTween, ease:Expo.easeInOut}); if (TweenMax.isTweening(item)) { trace("HEY WE ARE TWEENING OK?"); search_mc.enabled = false; search_mc.gotoAndStop(1); } function onFinishTween() { trace("finished"); search_mc.enabled = true; } } Link to comment Share on other sites More sharing options...
Share Posted January 20, 2010 Looks like you're using a nested function for the onComplete - nested functions are almost always a BAD idea because they get deleted as soon as the parent function finishes running. So the tween ends up trying to call a function that doesn't exist anymore. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now