MC Tween: it saves the world.™

Home | Using MC Tween | Documentation | AS2 usage notes | Animation Types | Downloads | Examples | Extensions | Author & Disclaimer | Links

.onTweenUpdate()

Applies To

MovieClip, Sound, TextField

Availability

Flash 6 and above, using AS1 or AS2.

Usage

<MovieClip|Sound|TextField>.onTweenUpdate = <function>;

Parameters

function : The name of a function, in reference (object) form, or an anonymous function.

Returns

N/A

Description

Event handler; invoked when a tweening has update its assigned property. This function is called once for every tweened property, and receives the property name as a single string parameter. This function is defined once per object, not per tweening. This is useful when tweenings on a property must be replicated to other objects or properties.

This event handler works similarly to the MovieClip's built-in event handlers, like .onEnterFrame, .onRollOver, etc.

Examples

// Continually traces the value of an _x property of a MovieClip while tweening it
<MovieClip>.onTweenUpdate = function(propName) {
 if (propName == "_x") trace ("_x is now "+this._x);
};
<MovieClip>.xSlideTo(100, 1);

// Warns every time a property has been updated by a tweening on a TextField
<TextField>.onTweenUpdate = function(propName) {
 trace (propName + " has been updated!");
};

See Also

onTweenComplete()

MC Tween· Zeh Fernando, 2003-2006 · Proudly hosted at DreamHost · Disclaimer