Search the Community
Showing results for tags 'eventcallback'.
-
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!
-
Hi, just wanted to let you know that it seems that clear() on a timeline does not remove eventCallbacks. It doesn't matter if they are set by the constructor or afterwards with eventCallback('eventtype', function) I'm using latest Chrome and the latest TweenMax & TimelineMax JS versions on Windows 8 (shouldn't matter) just try the following: var tl = new TimelineMax({onComplete: function() {console.log('complete');}}); tl.eventCallback('onComplete'); //returns function tl.eventCallback('onReverseComplete', function() {console.log('reversed');}); tl.clear(); tl.eventCallback('onReverseComplete'); // still there tl.eventCallback('onComplete'); // still there Although eventCallbacks get not killed, the containing tweens and timelines are removed and the totalDuration is 0 afterwards. Would be nice if someone could confirm that!
- 2 replies
-
- eventCallback
- clear()
-
(and 1 more)
Tagged with: