onComplete
Availability
AS2 and AS3.
Usage
... onComplete:value, ...
Parameters
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.
Examples
// 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; }});
Notes
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 theonCompleteParams parameter for that. See the onStart method notes for more information and examples.
See also
onStart, onUpdate, onCompleteParams, onCompleteScope, onOverwrite