Jump to content
Search Community

ticker missing callbacks when adding callbacks on a callback

erikb test
Moderator Tag

Go to solution Solved by GreenSock,

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

Ran into an issue this evening.

 

If adding a callback to the ticker during a different ticker callback, there is a chance the ticker will miss some of the callbacks already scheduled.

 

In the console output for the pen, notice that a callback with priority 1 is skipped on frame 30.

 

I have implemented a hotfix of my own for this issue by modifying the TweenMax source for dispatchEvent.  I clone the list with a list.slice(0); before iterating through it.   New listeners will not be added until the next tick, but that is understandable behavior.

 

Thanks for looking into this.

See the Pen GqJadb?editors=0010 by jedierikb (@jedierikb) on CodePen

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