Packagecom.greensock.plugins
Classpublic class ColorMatrixFilterPlugin
InheritanceColorMatrixFilterPlugin Inheritance FilterPlugin Inheritance TweenPlugin

ColorMatrixFilter tweening offers an easy way to tween a DisplayObject's saturation, hue, contrast, brightness, and colorization. The following properties are available (you only need to define the ones you want to tween): HINT: If you'd like to match the ColorMatrixFilter values you created in the Flash IDE on a particular object, you can get its matrix like this:

import flash.display.DisplayObject;
import flash.filters.ColorMatrixFilter;

function getColorMatrix(mc:DisplayObject):Array {
var f:Array = mc.filters, i:uint;
for (i = 0; i < f.length; i++) {
if (f[i] is ColorMatrixFilter) {
return f[i].matrix;
}
}
return null;
}

var myOriginalMatrix:Array = getColorMatrix(my_mc); //store it so you can tween back to it anytime like TweenMax.to(my_mc, 1, {colorMatrixFilter:{matrix:myOriginalMatrix}});


USAGE:

import com.greensock.TweenLite;
import com.greensock.plugins.TweenPlugin;
import com.greensock.plugins.ColorMatrixFilterPlugin;
TweenPlugin.activate([ColorMatrixFilterPlugin]); //activation is permanent in the SWF, so this line only needs to be run once.

TweenLite.to(mc, 1, {colorMatrixFilter:{colorize:0xFF0000}});

Copyright 2010, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.



Public Properties
 PropertyDefined by
 InheritedchangeFactor : Number
TweenPlugin
Public Constants
 ConstantDefined by
 InheritedVERSION : Number = 1.32
[static]
TweenPlugin