Jump to content
GreenSock

ice-frog

what's should i do with my balls, pause()? addPause()?

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

i want my balls runs one by one ,when i click the 'play',it's done well
but when i click the 'reverse',the ball dose not run,i must click twice, then the ball run~~~



i think when i click 'reverse',the timeline pause() again,so i must click again...
is there any way to run well in 'reverse'? just like them in 'play'~~?

See the Pen raYoJP by bbzz7 (@bbzz7) on CodePen

Link to comment
Share on other sites

Hi ice-frog  :)

 

seems everything works fine as expected , tl play/reverse fired with one click .

Link to comment
Share on other sites

Hi ice-frog,

 

Thanks for providing the simple demo. Very helpful.

 

You should definitely use addPause() in this situation. http://greensock.com/docs/#/HTML5/GSAP/TimelineLite/addPause/

 

When you use call() to pause the timeline, there is often time that transpires between when the call() is called and the timeline actually gets paused.

 

So if you call a function at a time of 1.0 second that then uses tl.pause(), it may so happen that the pause doesn't happen until 1.01, then when you reverse from time of 1.01, you then hit the callback again at time of 1.0. This is exactly what you were experiencing.

 

-- to Diaco's credit, the timeline does reverse fine sometimes... the time-drift doesn't always happen.

 

addPause() was built specifically to handle that time-drift that happens when using callbacks to call the pause() function. 

  • Like 2
Link to comment
Share on other sites

Great explanation of addPause() Carl :)

  • Like 2
Link to comment
Share on other sites

I use the phone to record the new issue:



look at 00:26, and 01:12~~~  the balls run automatically~~
Link to comment
Share on other sites

I just wanted to acknowledge that there is indeed a bug with addPause() since version 1.15.0 and we'll get it patched up in the next release. Thanks so much for pointing this out, and I apologize for the hassle. 

  • Like 1
Link to comment
Share on other sites

Please see http://greensock.com/forums/topic/11329-timelinemax-addpause-internmittedly-not-respected/?p=45904for a preview copy of GSAP 1.15.2 that should resolve this issue. Please let us know if it works well for you. Again, I apologize for the glitch. 

thanks,carl,the addPause() works well now.

but,I have a new doubts that the call() mothed before addPause() ,It will be performed twice(when before pause() and after pause()),there is my pen:

See the Pen wByYym by bbzz7 (@bbzz7) on CodePen

Link to comment
Share on other sites

  • 2 weeks later...

This should all be resolved in 1.16.0 that was released today :)

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