onUpdate

Availability

AS2 and AS3.

Usage

... onUpdate:value, ...

Parameters

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.

Examples

// 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); }});

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 the onUpdateParams parameter for that. See the onStart method notes for more information and examples.

See also

onStart, onUpdateParams, onUpdateScope, onComplete, onOverwrite