Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Big Dave

pause timeline not working

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

Hello,

 

I'm a fairly experienced Greensock user (AS3) making the transition to the GSAP (JS) version.

 

I'm working up a simple animation using TweenMax in the latest Edge Animation application. The code below is working fine until I try to pause the timeline. When I uncomment the pause command the animation will not play, comment it out and it plays fine.

 

Am I missing something simple here?

 

 

var tl = new TimelineMax();

 

tl.to(c3b1, .35, {opacity:0.0}, 1.5);

 

tl.staggerTo([c1b1, c1b2, c1b3, c1b4, c2b1, c3b1, c3b2], .35, {opacity:1.0 , scale:1}, 0);

 

//tl.pause();

 

tl.to(c3b2, .35, {x:680}, 2.5);

 

Thanks for any insight you can offer.

 

David

Link to comment
Share on other sites

Well, first of all, welcome - I know things can feel a little funky when you jump from AS3 over to JS (in general). Hopefully you'll at least feel comfortable working with GSAP.

 

On to your question...

 

I'm confused - you want the timeline to play even though it's paused? From what you're describing, it sounds like it is behaving exactly as it should.

Link to comment
Share on other sites

Thank you for the prompt reply to my question.

 

I wanted the timeline to pause after the first two tweens and before the last one. Just as In the sequence that it appears.

 

I planned to insert a button to call the "tl.play();" command after the pause. But it seems as though "tl.pause();" pauses the timeline at the beginning instead of after the first two tweens.

 

Best,

 

David

Link to comment
Share on other sites

I think you meant something like this:
 

 

var tl = new TimelineMax();
tl.to(c3b1, .35, {opacity:0.0}, 1.5);
tl.staggerTo([c1b1, c1b2, c1b3, c1b4, c2b1, c3b1, c3b2], .35, {opacity:1.0 , scale:1}, 0);
tl.call(function() { tl.pause(); });
tl.to(c3b2, .35, {x:680}, 2.5);


Or you could just use a tweenTo() to tween to a specific spot (and then stop), like:
 

tl.tweenTo(2.2);


In which case you wouldn't need that tl.call() in there at all.

Oh, and make sure you snag the latest files because the timeline API changed recently - see http://www.greensock.com/v12-api-change/ for details.

Link to comment
Share on other sites

Jack,

 

Thank you, both solutions work fine.

 

I was thinking that the "tl.pause();" was just appended to the timeline. I obviously need to do some more reading of the JS doc. You have the patience of a saint...

 

Great products, keep up the good work.

 

Best,

 

David

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