0

I have a Spark button with an icon, and I want to be able to scale it, as with an Image component, but I can't find any property for that. Is there any way to achieve that? Thanks.

zero323
  • 322,348
  • 103
  • 959
  • 935
user940016
  • 2,878
  • 7
  • 35
  • 56
  • How do you want to scale it? Do you want to scale the icon? Or the image? Is there any reason the scale9Grid / scaleX / scaleY / scaleZ properties won't work? http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#scale9Grid – JeffryHouser Jul 16 '13 at 11:37
  • Are these properties supposed to scale the image, not the component itself? – user940016 Jul 16 '13 at 12:02
  • If you set these properties on the image; they will scale the image. If you set them on the component; they will scale the component. – JeffryHouser Jul 16 '13 at 12:05
  • But the image is set by using the icon property of the Button component, so I can't apply it on the image. – user940016 Jul 16 '13 at 12:07
  • So,set the properties on the iconDisplay skin pat that represents the image: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/Button.html#SkinPartSummary – JeffryHouser Jul 16 '13 at 13:27

2 Answers2

0

You could look into Button Class, and then write a custom Class extends Button and implement what you want.

I remember that the icon is displaied by BitmapImage, you could get it's reference and then scale that.

mani
  • 1
  • 3
0

If you want to scale the icon; but not the button; you can do so by accessing the properties directly on the iconDisplay skin part:

myButtonInstance.iconDisplay.scaleX = 2;
myButtonInstance.iconDisplay.scaleY = 2;
myButtonInstance.iconDisplay.scaleZ = 2;

The properties used for scaling are scaleX, scaleY, and scaleZ. The BitMapImage also has a property called scaleMode

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59