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:
@@ -15,12 +15,20 @@ import flash.geom.ColorTransform;
|
|||||||
public class SimpleIconButton extends SimpleButton
|
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
|
* @param icon a BitmapData, or Bitmap (from which the BitmapData will be extracted), or
|
||||||
* a Class that instantiates into either a BitmapData or Bitmap.
|
* 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);
|
var bmp :BitmapData = ImageUtil.toBitmapData(icon);
|
||||||
if (bmp == null) {
|
if (bmp == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user