Use toBitmapData.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@721 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2008-11-24 23:14:47 +00:00
parent cecdbfa320
commit 66386a90af
@@ -22,15 +22,8 @@ public class SimpleIconButton extends SimpleButton
*/
public function SimpleIconButton (icon :*)
{
var bmp :BitmapData;
if (icon is Class) {
icon = new (Class(icon))();
}
if (icon is BitmapData ) {
bmp = BitmapData(icon);
} else if (icon is Bitmap) {
bmp = Bitmap(icon).bitmapData;
} else {
var bmp :BitmapData = ImageUtil.toBitmapData(icon);
if (bmp == null) {
throw new Error("Unknown icon spec: must be a Bitmap or BitmapData, or a Class " +
"that becomes one.");
}