Desaturate/greyscale a movieclip in As3
I recently needed to have a movieclip go black and white on rollover. ColorMatrix to the rescue. Below is a function which will desaturate a passed DisplayObject.
desaturate(clip);
// convert passed clip to greyscale
function desaturate(obj:DisplayObject)
{
var r:Number=0.212671;
var g:Number=0.715160;
var b:Number=0.072169;
var matrix:Array = [r, g, b, 0, 0,
[...]