Jump to content
Search Community

onComplete being called more than once

barryg test
Moderator Tag

Recommended Posts

removedObjs is an array of Objects.

The problem that's occurring is that gravityListener is being call for as many times as there are objects in the array when the tween is complete.

 

I need it to be called only once.

 

TweenMax.allTo(removedObjs, 0.5, {autoAlpha:0, onComplete:gravityListener}); 

Link to comment
Share on other sites

Thank You.

That was it and it works correctly now. I even put in a small stagger value for a cool effect.

 

I just looked at the docs on the allTo() Method. First it looks like I had it formatted incorrectly; so why did it even work?

I had the onComplete function grouped in the 3rd parameter with the 4th, 5th and 6th arguments set to Null.

Link to comment
Share on other sites

so why did it even work? I had the onComplete function grouped in the 3rd parameter with the 4th, 5th and 6th arguments set to Null.

 

You can use an onComplete in the 3rd parameter - it will be applied to EVERY tween which can actually be very useful in certain circumstances.

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