Category Archives: RichText (Spark)

Dynamically adding paragraphs to a Spark RichText control in Flex 4

The following example shows how you can dynamically add paragraphs to a TextFlow in a Spark RichText control by creating a new SpanElement (<span/>) and ParagraphElement (<p/>) object and then adding the spans and paragraphs to the textFlow object using the addChild() method.

Full code after the jump.

Continue reading Dynamically adding paragraphs to a Spark RichText control in Flex 4

Displaying HTML formatted text in a Spark RichText control in Flex 4

The following example shows how you can set HTML text in a Spark RichText control in Flex 4 by converting the HTML string to a TextFlow object using the static TextConverter.importToFlow() method and setting the textFlow property.

Full code after the jump.

Continue reading Displaying HTML formatted text in a Spark RichText control in Flex 4