MC Tween: it saves the world.™

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

.alphaTo()

Applies To

MovieClip, TextField

Availability

Flash 6.

Usage

<MovieClip|TextField>.alphaTo(opacity [, seconds, animation type, delay, callback, extra1, extra2]);

Parameters

opacity : desired _alpha value, usually from 0 to 100.

All other parameters are standard tween() related. Refer to the .tween() method for reference.

Returns

Nothing.

Description

Shortcut method; does a transition on the _alpha property of a MovieClip or TextField - a fade in or a fade out, in practical words.

Examples

// Makes a Movieclip appear from out of nothing, taking one second and using linear transition
<MovieClip>_alpha = 0;
<MovieClip>.alphaTo(100, 1, "linear");

// Makes a MovieClip fade out on 0.8 seconds and then turns it off for better Flash Player performance
<MovieClip>.alphaTo(0, 0.8, "linear", 0, function() { this._visible = false; });

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