tags:

views:

321

answers:

2

Hello :)
It is possible to bold some part of label in standard Button?
example:
ICON - normal_normal_text BOLD_BOLD_text

Thanks for help :)

A: 

You're probably better off using a Text or a Label and skinning it look like a button. Each of those has an .htmlText property which will take rudimentary tags like and , etc. Remember to set the .buttonMode and .useHandCursor properties to true and .mouseChildren to false for best button simulation.

Robusto
Thank you for your reply:) I'll try and I'll know whether I succeeded.
rudi888
I think this is a rather poor suggestion as you loose a lot of the standard button functionality such as states, etc.
quoo
+1  A: 

I don't think you can do this with a standard label, but FlexLib contains a CanvasButton component (http://flexlib.googlecode.com/svn/trunk/docs/flexlib/controls/CanvasButton.html) that allows you to add multiple children to a button that would work well to have two labels styled differently, or to better control the styling in a single label.

quoo
Or you can use a text and set the htmlText instead of the text property so that you can use <b> and <i> tags.
invertedSpear
I have tried using CanvasButton from FlexLib but in flex 4 it don't works.
rudi888
Ah, you should of mentioned that you're targeting flex 4. In flex 4 you should be able to create a normal button, and in your buttonskin when you draw the label, either draw two text fields, or otherwise style the text to show the bold and italic text. Here's an example of controling the icon / creating one label in flex 4 - you should be able to go from there: http://www.flexer.info/2009/06/12/how-to-skin-a-button-with-icon-in-flex-4-sdk-spark/
quoo