Jump to content
Search Community

Code after tween start

moxol test
Moderator Tag

Recommended Posts

I have a TweenMax with duration of 0.4 seconds.

Immediatelly after TweenMax there are new function calls to some objects.

Since those function calls take some time, TweenMax doesn't animate object but finishes tweening without animation.

 

I understand why is that happening, but is there some solution to this, so that animation runs smoothely?

Link to comment
Share on other sites

You have a few options:

  1. Create the tween on the next frame (you could simply listen for an ENTER_FRAME event or use a TweenLite.delayedCall() that's very short, like 0.001 seconds so that it definitely calls the function on the next frame, that way you don't need to worry about removing any ENTER_FRAME event listener)
    -OR-
  2. Set useFrames:true on your tween so that it isn't time-based. Keep in mind that you'll need to define your duration (and delay, if any) in frames instead of seconds.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...