Jump to content
Search Community

Delete eventCallback in TweenMax instance in as2 not working

vortac test
Moderator Tag

Recommended Posts

I have created a TweenMax instance with an onComplete Callback in as2 using the scope parameter. Everything works fine. When I try to delete the eventCallback with

instance.eventCallback("onComplete",null);

it does not remove the callback.

I also have tried the following, nothing works

instance.eventCallback("onComplete",null,"onCompleteScope:this");
instance.eventCallback("onComplete",null,null,"onCompleteScope:this");
instance.eventCallback("onComplete",null,[],"onCompleteScope:this");
instance.eventCallback("onComplete",null,this);

and so on...

Nothing seems to work and actually remove the callback from the tween.

You mention a 4th parameter in the docs but there is an example missing how to correctly implement scope.

 

Can anyone tell me the correct syntax?

Any help much appreciated!

Link to comment
Share on other sites

Sorry, I can not replicate this behavior. 

From my test removing the eventCallback works fine with AS2 verions 12.1.5

 

import com.greensock.*;


// give tween onComplete callback
var tween = TweenMax.to(mc, 1, {_x:200, onComplete:done});


//remove callback
tween.eventCallback("onComplete", null);


//never fires
function done() {
trace("done");
}


trace(TweenLite.version); //12.1.5

If you continue to believe there is a problem in the latest AS2 release version, please provide a very simple demo that clearly replicates the issue.

 

 

 

removeCallback-AS2.zip

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