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.
Asked
Active
Viewed 1,160 times
0
-
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 Answers
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