2 Replies Latest reply on Oct 15, 2007 8:49 PM by theQmaster

    Formatting text

    theQmaster
      Hello,

      I started playing with flex and I reached a point where I have no good answer.

      I have a stack view and I added a new one view but I'm having difficulties finding the right component to write that view with a formated text. Using mx:labels and mx:text is not the best way to go. Can anyone if is possible to write a formated text in a view(canvas)

      I the text will have title, subtitle, bullet points and paragraphs and since Flex is using a mxml it should be a easy way to do that or it isn't ?

      TIA,
      Q

        • 1. Re: Formatting text
          ntsiii Level 3
          One way to do thie is uto use the htmlText property instead of the "text" property.

          htmlText supports a very limited subset of HTML, but does most of what you are asking.

          If you want more, then you will need to make your own component.

          Tracy
          • 2. Re: Formatting text
            theQmaster Level 1
            Thanks Tracy!

            Indeed this htmlText is better but I cannot format it as "advertised" - what do I missed ?

            Here what I try to do...

            <mx:Text width="100%" color="black" fontStyle="normal" fontSize="14">
            <mx:htmlText>
            <![CDATA[
            <h1 style="font-size:18px;color:red">
            Title
            </h1>
            <h2>
            Subtitle1
            </h2>
            <ul>
            <li>One</li>
            <li>Two</li>
            <li>Three</li>
            <li>Four</li>
            </ul>
            <h2>
            Subtitle2
            </h2>
            <h2>
            Subtitle3
            </h2>
            ]]>
            </mx:htmlText>
            </mx:Text>

            I assume I can work with <p> and lots of <br>..

            Thanks!
            Q

            quote:

            Originally posted by: ntsiii
            One way to do thie is uto use the htmlText property instead of the "text" property.

            htmlText supports a very limited subset of HTML, but does most of what you are asking.

            If you want more, then you will need to make your own component.

            Tracy