Greyscale to Colour Actionscript Example

After scowering the net for quite sometime I’ve managed to come up with a way to convert an image from greyscale to colour in actionscript.


import flash.filters.ColorMatrixFilter;
var nocolour:Array = [0.3086,0.6094,0.082,0,0,0.3086,0.6094,0.082,0,0,0.3086,0.6094,0.082,0,0,0,0,0,1,0];
var colour:Array = [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];
var greyscale:ColorMatrixFilter = new ColorMatrixFilter(nocolour);
var fullcolour:ColorMatrixFilter = new ColorMatrixFilter(colour);

target_mc.filters = [greyscale];

target_mc.onRollOver = function() {
        this.onEnterFrame = function () {
                this.filters = [fullcolour];
            }
        };
        target_mc.onRollOut = function() {
            this.onEnterFrame = function () {
                this.filters = [greyscale];
            }
};

The above code is basically setting the target_mc movieclip to greyscale by default, and then when you RollOver it changes to full colour, again RollOut changes back to greyscale.

My question for the guru’s is, how would you go about fading the transition, instead of it being just a straight jump?