I have a ImageButton class that extends SimpleButton. I need it to generate the 3 button states (up, down, over) from just one image. The up state will be the regular image, the over state will have the non-blank parts of the image slightly tinted, and the down state will be a kind of glow (I’m assuming this can be achieved with some kind of filter).
Right now I have
public class ImageButton extends SimpleButton
{
public function ImageButton(image:Bitmap)
{
var originalData:BitmapData = image.bitmapData;
var stateData:Array = new Array();
for (var i:uint = 0; i < 3; i++)
{
var newData:BitmapData = new BitmapData(
originalData.width, originalData.height, true,
0x00FFFFFF);
newData.copyPixels(originalData, originalData.rect, new Point(0, 0));
stateData.push(newData);
}
var upImage:Bitmap = new Bitmap(stateData[0]);
var overImage:Bitmap = new Bitmap(stateData[1]);
var downImage:Bitmap = new Bitmap(stateData[2]);
super(upImage, overImage, downImage, upImage);
}
}
How can I apply filters or something to the 3 generated images so that they look like what I described? Help! :(