Jump to content
Search Community

Does killing a tween consistently call its onComplete?

NickWoodward

Go to solution Solved by GreenSock,

Recommended Posts

NickWoodward
Posted

Hey all, pretty much the title really - just looking to rely on the onComplete when an animation is killed early.

I've made a demo here that seems to confirm it (double click the square quickly), but thought I'd double check that it's expected behaviour because I couldn't see it mentioned in the docs.

Thanks!

Nick

  • Solution
GreenSock
Posted

onComplete fires when the playhead reaches the very END of the animation, so if you're killing it early, it shouldn't call onComplete. But perhaps you're looking for onInterrupt? 

NickWoodward
Posted
2 minutes ago, GreenSock said:

onComplete fires when the playhead reaches the very END of the animation, so if you're killing it early, it shouldn't call onComplete. But perhaps you're looking for onInterrupt? 

Ah, I made a stupid mistake with my demo, just found it! Strange that there was similar behaviour in my other SCCE, but I ended up running the code outside of the onComplete anyway, so it doesn't matter. Good to know definitively that it only runs on completion - I mean obviously that was what I initially thought, but what I was seeing was confusing me. Didn't know about onInterrupt too, so thanks, that'll be useful!

 

 

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