Tweener Documentation
AS2 and AS3.
... onComplete:value, ...
value
:Function — A function that is called immediately after a tweening is completed. It is called once regardless of the number of properties involved on the tweening. The function scope (in which the event is executed) is the target object itself, unless specified by the onCompleteScope
parameter.
// Fades a movieclip out, then automatically makes it invisible (AS2) hideWay = function() { this._visible = false }; myMovieClip._visible = true; myMovieClip._alpha = 100; Tweener.addTween(myMovieClip, {_alpha:0, time:1, delay:4, onComplete:hideAway});
// Similarly, with an anonymous function myMovieClip._visible = true; myMovieClip._alpha = 100; Tweener.addTween(myMovieClip, {_alpha:0, time:1, delay:4, onComplete:function() { this._visible = false; }});
The reference passed to this property is a reference to the function only. This roughly means you do not use any kind of parenthesis or parameters when passing the function you wish to call - you need to use the onCompleteParams parameter for that. See the onStart method notes for more information and examples.
onStart, onUpdate, onCompleteParams, onCompleteScope, onOverwrite