Ramakrishnan
Ramakrishnan

Reputation: 3

Different font size in Label in Flex?

I would like to display a set of Text like this "DISCONTINUED (02-02-2012) Crocin" in label. But i need smaller font size for Date. How can I set the value to Label so that I can display smaller size font for Date.

I only need to assign a single string to label? like this "DISCONTINUED (02-02-2012) Crocin"

Is this possible in flex?

Upvotes: 0

Views: 2045

Answers (3)

Sagar Rawal
Sagar Rawal

Reputation: 1442

its possible in FLEX by 2 ways.

(1)

<mx:Text width="550">
    <mx:htmlText>
        <![CDATA[
        <b><font size="26">DISCONTINUED </font><font size="18">(02-02-2012) Crocin</font>
        ]]>
    </mx:htmlText>
</mx:Text>

(2)

Embed htmlText in Text area and change the CSS file as follows to feel like a Label. Change its selectable and editable property to false and don't forget to give height and width.

TextArea 
{
    leading: 0;
    backgroundAlpha: 0;
    borderStyle: none;
}

For more CSS changes visit THIS LINK

Have a nice Day

Upvotes: 3

rejo
rejo

Reputation: 3350

<mx:Text width="550">
        <mx:htmlText>
            <![CDATA[
            <b><font size="26">DISCONTINUED </font><font size="18">(02-02-2012) Crocin</font>
            ]]>
        </mx:htmlText>
</mx:Text>

You can also bring htmlText in label also.

<mx:Label width="600" height="100">
        <mx:htmlText>
            <![CDATA[
            <b><font size="26">DISCONTINUED </font><font size="18">(02-02-2012) Crocin</font>
            ]]>
        </mx:htmlText>
    </mx:Label>

Upvotes: 0

Stian
Stian

Reputation: 1289

Yes this can be done. Take a look at this document from Adobes LiveDoc:

http://livedocs.adobe.com/flex/3/html/help.html?content=textcontrols_04.html

Upvotes: 0

Related Questions