Jump to content
Search Community

Using TotalProgress doesn't include delays?

Ephezius test
Moderator Tag

Recommended Posts

Hey folks -

 

Here is what I've done:

  • I've created an introduction animation for my tool
  • Once animated, everything is in place and the too is ready for user interaction
  • I've created a resize event so I can recalculate width/height of stage
  • The resize event removes everything and re-runs the init() function to recreate everything
  • I've captured the totalProgress time of each animation at the point of resize

Here is what I'm trying to do:

  • If the animation hasn't run at all at the point of resize, I'd like the animations to run as normal once the resize event is fired
  • If the animation has run completely, I don't want it to run at all (i.e., totalProgress = 1)
  • If the animation is anywhere in progress, I want the animation to skip to that point in the animation (e.g., 60%)

Here's the problem:

 

When I use code like this...

var animation:TweenMax = TweenMax.to (obj, 1, {delay:1, x:50})
animation.totalProgress = _captured progress;

... the delay is totally ignored. Meaning if I have several successive tweens, they overlap each other.

 

Is there a way to assign progress in TimelineMax? Any other ideas on how to do this?

Link to comment
Share on other sites

Yes, putting all your tweens into a TimelineMax would be ideal if you have multiple tweens that need to run as part of a group or sequence. That way you only need to track the progress of 1 element, the TimelineMax. It will also spare you from having to manage individual delay properties of each tween.

 

Using v12 (recommended)

 

myTimeline.progress(.5) // sets progress to .5 or the half-way point
myTimeline.progress() // gets progress

 

v11

myTimeline.progress = .5; //sets
myTimeline.progress // gets

 

 

And just for assurance, yes, delay is never accounted for in a tween or timeline's progress.

Link to comment
Share on other sites

And just for assurance, yes, delay is never accounted for in a tween or timeline's progress.

 

Thanks, but is there any way to account for delays? Right now the resize events have several delays on each part of the timeline... if I resize the screen and the init() function is recalled, it's not seamless at all...

Link to comment
Share on other sites

Right now the resize events have several delays on each part of the timeline

 

 

I'm sorry, I really don't know what that means.

 

It would be very helpful if you could provide a very simple set of files that illustrates exactly what you are doing. No need to post your production files, just something very simple, perhaps a single animation sequence with 2 or 3 tweens.

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