I would like to know if I can get an error or some other problems when I try to tween several objects like this and using an onComplete-property:
TweenLite.to(restartBtn, .5, {alpha:0});
TweenLite.to(mainMenuBtn, .5, {alpha:0, onComplete:quitFadeIn});
What I want to do is fade out several objects at once and when they finished a special function gets called. Are there other possibilities when using tweenlite available or do I have to use timelinelite?
Your sample code should work without any errors and if you're limited to TweenLite, this is a perfectly good method to use.
If you can use TweenMax which is the same as TweenLite, just with more features, you can use something like this to tween multiple items:
TweenMax.allTo([restartBtn, mainMenuBtn], .5, {alpha:0, onComplete:quitFadeIn});
and this would stagger the fades by .2 seconds
TweenMax.allTo([restartBtn, mainMenuBtn], .5, {alpha:0, onComplete:quitFadeIn}, -.2);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With