Tweener Documentation
AS2 and AS3.
... onUpdate:value, ...
value
:Function — A function that is called every time a tweening updates its properties. The function scope (in which the event is executed) is the target object itself, unless specified by the onUpdateScope
parameter.
// Moves a movieclip, and reports its position in the process (AS2) reportPosition = function() { trace ("My _x is now " + this._x); }; Tweener.addTween(myMovieClip, {_x:100, time:1, onUpdate:reportPosition});
// Similarly, with an anonymous function Tweener.addTween(myMovieClip, {_x:100, time:1, onUpdate:function() { trace ("My _x is now " + this._x); }});
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 onUpdateParams parameter for that. See the onStart method notes for more information and examples.
onStart, onUpdateParams, onUpdateScope, onComplete, onOverwrite