Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
bastiank

Paused Tweens inside a Timeline don't start playing

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

One more question about pause behaviour of timelines and tweens:

 

if you do the following:

 

var tl = new TimlineMax({paused:true});

var tween = new TweenMax(element, duration, {someVars, paused:true}); // pause the tween upon creation

tl.insert(tween);

tl.play(); // ==> nothing happens

 

Isn't the timeline supposed to play the containing tweens?

 

If I only pause the timeline upon creation and not the tween, that will be inserted afterwards, everything works fine.

 

I think that the timeline should overwrite the paused state of it's containing elements.

 

 

Thanks for a short hint!

 

Bastian

Link to comment
Share on other sites

This is by design, not a bug. Here's an excerpt from a thread that addresses this question at http://forums.greensock.com/topic/2705-nested-timelines-problem/page__p__6426#entry6426

 

When you pause a tween or timeline, it remains paused until you unpause it. Otherwise, it would cause problems. For example, what if you put a tween into a timeline and want to pause it based on some user interactivity but the rest of the timeline should play? If playing a parent always forced all its children to play as well, it would lead to some frustrating behavior. Don't pause a tween/timeline if you don't want it to be paused or just make sure you unpause it when you want it to be able to play. TweenLite/Max/TimelineLite/Max respects your instructions in terms of the playability (is that a word?) of your tweens/timelines, as it should.

 

See what I mean?

  • Like 1
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.
×