From 2ae0b63aae3c268f90ea3435cd957978c7c5b043 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 29 Dec 2008 22:47:36 +0000 Subject: [PATCH] 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 --- src/as/com/threerings/flash/SimpleIconButton.as | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/as/com/threerings/flash/SimpleIconButton.as b/src/as/com/threerings/flash/SimpleIconButton.as index 71393a6c..687a8877 100644 --- a/src/as/com/threerings/flash/SimpleIconButton.as +++ b/src/as/com/threerings/flash/SimpleIconButton.as @@ -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) {