apache-flexflex4flex3flex4.5

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?


Solution

  • 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