Share Posted July 7, 2012 Hi all, I started routinely using Tweenlite.to() static method instead of a Timer by setting a fake target (like 'this') and just putting a onComplete on the tweenvars object. I dunno if I should, what about the efficiency of that trick? TweenLite.to(this,2,{onComplete:myFunc}); function myFunc() { //My instructions... } Link to comment Share on other sites More sharing options...
Share Posted July 8, 2012 TweenLite has a built in method called delayedCall() that is perfect for your situation. TweenLite.delayedCall(2, myFunc); //myFunc will fire after 2 seconds function myFunc() { //My instructions... } delayedCall also takes an array of parameters for the function that is getting called. http://www.greensock...l#delayedCall() You may find it interesting that delayedCall actually creates a TweenLite instance behind the scenes that works similar to your method. delayedCall() just makes it easier to get the same end result with less code. Link to comment Share on other sites More sharing options...
Author Share Posted July 16, 2012 Thank you, that is perfect ! 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