Jump to content
GreenSock

OxXxigen

remove eventCallback

Moderator Tag

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

tween.eventCallback("onUpdate", null);

 

  • Like 1
Link to comment
Share on other sites

tween can only have one callback ?

Link to comment
Share on other sites

3 minutes ago, OxXxigen said:

tween can only have one callback ?

 

Correct - one callback for each event type.

 

You can have onStart, onComplete, onUpdate, etc. But if you create a second one for an event, it will overwrite the first.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Yep, but if you need to call more than one function, you could just nest them. 

animation.eventCallback("onUpdate", function() {
    yourFunc1();
    yourFunc2();
});

 

  • Like 2
Link to comment
Share on other sites

  • 1 year later...
  • 10 months later...
On 5/7/2019 at 8:27 PM, PointC said:

But if you create a second one for an event, it will overwrite the first.

~Is still true in 3.7.1 because I could see callbacks not getting removed if we add a new one~

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