0 Replies Latest reply on Feb 26, 2008 5:33 PM by Dustin_C

    Apply different styles to text within a Text field?

    Dustin_C
      I am working on an application that consumes a user-generated HTML file and displays it on part of a Flex screen. The main problem is HTML can look something like this (for example):

      Hello <span class="greeting">Mr. Smith</span>, how are you doing <span class="title>today</span>.

      Unfortunately, the Flex Text control only accepts a single style that is applied to all text within the control and the htmlText property only allows for very basic HTML markup and does not include support for applying styles to a part of the text.

      I've thought about creating a series of Text controls (each with its own style as needed) and putting them together in an HBox. However, this messes up word wrapping if the text exceeds the width of its container.

      Anyone have any ideas how to solve this problem?

      Thanks!

      Dustin