Added a setIcon() method to update the icon after construction.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@747 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2008-12-29 22:47:36 +00:00
parent 2817021c56
commit 2ae0b63aae
@@ -15,12 +15,20 @@ import flash.geom.ColorTransform;
public class SimpleIconButton extends SimpleButton
{
/**
* Constructor.
*
* Constructor. @see #setIcon()
*/
public function SimpleIconButton (icon :*)
{
setIcon(icon);
}
/**
* Update the icon for this button.
*
* @param icon a BitmapData, or Bitmap (from which the BitmapData will be extracted), or
* a Class that instantiates into either a BitmapData or Bitmap.
*/
public function SimpleIconButton (icon :*)
public function setIcon (icon :*) :void
{
var bmp :BitmapData = ImageUtil.toBitmapData(icon);
if (bmp == null) {