When i use this code to toggle a bitmap to color or black & white, it works fine when running in the scaleform Gfx player in Animate, however when running in the game engine, the image simply disappears.
private function ToggleImageColor(img:Bitmap, bColor:Boolean):void
{
if (bColor) {
img.filters=[];
} else {
var red:Number = 0.2225;
var green:Number = 0.7169;
var blue:Number = 0.0606;
var matrix:Array= [red, green, blue, 0, 0,
red, green, blue, 0, 0,
red, green, blue, 0, 0,
0, 0, 0, 1, 0];
var cmf:ColorMatrixFilter = new ColorMatrixFilter();
cmf.matrix = matrix;
img.filters=[cmf];
}
}
It is as soon as I apply the ColorMatrixFilter to img.filters that the image disappears.
Anyone know why? Or any other ideas of how to render a bitmap in grayscale?