Jump to content
Search Community

Get time remaining in TweenMax using onUpdate?

sideDoor test
Moderator Tag

Recommended Posts

TweenMax instances have currentTime, currentProgress, totalTime, etc. properties (TweenLite has a few less).

 

You can use onUpdateListener and a TweenEvent to get to the tween instance through e.currentTarget and then you have access to those currentTime properties.

Link to comment
Share on other sites

  • 2 years later...

Hi,

 

How can I do this to throwprops plugin?

 

ThrowPropsPlugin.to(mc, {throwProps:{

y:{velocity:yVelocity, max:bounds.top, min:bounds.top - yOverlap, resistance:300}

}, onUpdate:blitMask.update, ease:Strong.easeOut

}, 10, 0.3, 1);

I want to determine what is the remaining time, how far has it travelled, how many more remaining, etc. Thanks!

Link to comment
Share on other sites

The ThrowPropsPlugin.to() method returns a TweenLite instance. You can use that to figure out the duration, how much time has elapsed, etc.

 

var tween:TweenLite = ThrowPropsPlugin.to(...);

//then later (assumes v12)...
trace("duration: "+tween.duration()+", current time: "+tween.time());

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...