MC Tween: it saves the world.™

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

Special notice! While MC Tween is a nice extension and it will continue to work for AS1 and AS2 until the end of time, it is my duty to inform all citizens that I have switched the focus from further development on MC Tween to a new AS2 and AS3 extension, a real Class this time, called "caurina.transitions.Tweener" (or just Tweener). Tweener doesn't have as many features as MC Tween yet (for example, it doesn't have native filter tweens), and the documentation isn't 100% done, but it features a complete, more solid redesign with a few additional syntax features that were impossible to achieve with MC Tween. And it works the same for AS2 (including Flash Lite 2+) and AS3.

So, if you use MC Tween, or you're thinking about using it, I'd like to suggest you try Tweener instead. It follows all the principles of simplicity I tried to feature on MC Tween, but with a more powerful syntax. Tweener download, examples and documentation are available on Tweener's page. You can read more about this change on this blog post.

Thank you for your attention and sorry for this ugly box. And don't worry, this website will not be deleted or anything.

Notice for October 2008: also note that, if you are still interested in MC Tween and don't want to use class-based AS2 or AS3 solutions, Larry Benedict has taken the matter into his hands and updated MC Tween with some filter features that are not available in the latest version. You can read more about it (and download his version) here or here.

Documentation

» Introduction

Core Methods

» tween()

» stopTween()

Shortcut Methods

» alphaTo()

» bezierSlideTo()

» colorTo()

» colorTransformTo()

» frameTo()

» panTo()

» resizeTo()

» rotateTo()

» scaleTo()

» scrollTo()

» slideTo()

» volumeTo()

» xScaleTo()

» xSlideTo()

» yScaleTo()

» ySlideTo()

Rounded Shortcut Methods

» roundedBezierSlideTo()

» roundedSlideTo()

» roundedTween()

» roundedXSlideTo()

» roundedYSlideTo()

Flash 8 Filters Shortcut Methods

» bevelTo()

» blurTo()

» glowTo()

» xBlurTo()

» xGlowTo()

» yBlurTo()

» yGlowTo()

» xyBevelTo()

» xyBlurTo()

» xyGlowTo()

Auxiliary Functions

» getTweens()

» isTweening()

Auxiliary Methods

» lockTween()

» unlockTween()

» pauseTween()

» resumeTween()

Additional Events

» onTweenComplete

» onTweenUpdate

.colorTransformTo()

Applies To

MovieClip

Availability

Flash 6 and above, using AS1 or AS2.

Usage

<MovieClip>.colorTransformTo(ra, rb, ga, gb, ba, bb, aa, ab [, seconds, animation type, delay, callback, extra1, extra2]);
or
<MovieClip>.colorTransformTo(colorTransformObject [, seconds, animation type, delay, callback, extra1, extra2]);

Parameters

ra : Percentage desired for the R (red) color channel, usually from 0 to 100 (values from -1000 to 1000 are accepted). This parameter informs how much of the original channel will be maintained. The normal value for a static, non-colored MovieClip would be 100.

rb : The offset of tinting for the red channel, usually from 0 to 255 (values from -512 to 512 are accepted). This is added to the channel after the percentage transformation has taken place. The normal value for a static, non-colored MovieClip would be 0.

ga : Percentage desired for the G (green) color channel, usually from 0 to 100 (values from -1000 to 1000 are accepted). This parameter informs how much of the original channel will be maintained. The normal value for a static, non-colored MovieClip would be 100.

gb : The offset of tinting for the green channel, usually from 0 to 255 (values from -512 to 512 are accepted). This is added to the channel after the percentage transformation has taken place. The normal value for a static, non-colored MovieClip would be 0.

ba : Percentage desired for the B (blue) color channel, usually from 0 to 100 (values from -1000 to 1000 are accepted). This parameter informs how much of the original channel will be maintained. The normal value for a static, non-colored MovieClip would be 100.

bb : The offset of tinting for the blue channel, usually from 0 to 255 (values from -512 to 512 are accepted). This is added to the channel after the percentage transformation has taken place. The normal value for a static, non-colored MovieClip would be 0.

aa : Percentage desired for the A (alpha) channel, usually from 0 to 100 (values from -1000 to 1000 are accepted). This parameter informs how much opacity the object will have - it's just the same as the MovieClip's _alpha property, really. The normal value for a static, non-colored MovieClip would be 100.

ab : The offset opacity for the object's transparency. This is a bit tricky, but what it does is add more opacity when needed, even on areas where a MovieClip object is totally transparent. The normal value for a static, non-colored MovieClip would be 0.

colorTransformObject : This is a different way of doing the same thing. In this case, you can use color transformation objects (like you would with Color.setTransform()) to pass the parameters. The colorTransformObject would then be an object with properties called ra, rb, ga, gb, ba, bb, aa, and ab.

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

Also notice that all color parameters are optional - use undefined when a parameter has to be skipped. If a parameter value is not defined, it will not be tweened.

Returns

Nothing.

Description

Shortcut method; does a color transformation transition on a MovieClip object. While a bit confusing, the parameters used on this method are the equivalents of the attributes used on the native Color.setTransform() and allow for some powerful color transformation on MovieClips, including contrast and brightness controls.

The parameters used here are also directly related to the fields used on Flash's own "Advanced" color settings for a MovieClip.

Examples

// Creates a "dodge" look on a MovieClip in 2 seconds, using a "linear" transition
<MovieClip>.colorTransformTo(200, 0, 200, 0, 200, 0, undefined, undefined, 2, "linear");

// Tweens just the red channel of a MovieClip, in 0.6 seconds
<MovieClip>.colorTransformTo(200, undefined, undefined, undefined, undefined, undefined, undefined, undefined, 0.6, "linear");

// Inverts the MovieClips color altogether, in 2 seconds
<MovieClip>.colorTransformTo(-100, 256, -100, 256, -100, 256, 100, 0, 2, "linear");

// Does an alpha transition on a MovieClip - this is equivalent to alphaTo(100, 1)
<MovieClip>.colorTransformTo(undefined, undefined, undefined, undefined, undefined, undefined, 100, undefined, 1);

// Resets a MovieClip to its normal state, on 0.5 seconds
<MovieClip>.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 0.5); // The same as above, but using a colorTransformObject myCTO = new Object(); myCTO.ra = 100; myCTO.rb = 0; myCTO.ga = 100; myCTO.gb = 0; myCTO.ba = 100; myCTO.bb = 0; myCTO.aa = 100; myCTO.ab = 0; <MovieClip>.colorTransformTo(myCTO, 0.5); // The same as above, but using an in-line colorTransformObject <MovieClip>.colorTransformTo({ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0}, 0.5);

See Also

colorTo(), Color.setTransform()

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