O'Reilly logo

Flex 4 Cookbook by Garth Braithwaite, Joshua Noble, Todd Anderson, Marco Casario, Rich Tretola

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Text and TextFlows

The text components in Flex 4 have been updated to take advantage of the new text-rendering engine in Flash Player 10, referred to as the Flash Text Engine. To work with text in a Flex application, you’ll want to use the new components that utilize the Text Layout Framework: TextArea, RichText, and RichEditableText. Each of these components provides different functionality in a Flex application. The Label component provides simple, lightweight, basic text functionality. Label supports all of the properties of the GraphicElement, as well as bidirectional text and a limited subset of text formatting, but it doesn’t support hypertext or inline graphics. The RichText control supports HTML and, unlike Label, uses the TextFlow object model. It supports multiple formats and paragraphs but not scrolling, selection, or editing. Lastly, RichEditableText supports scrolling, selection, editing, and hyperlinks, as well as supporting all the functionality of the Label and RichText components. Label does not use the Text Layout Framework, relying solely on the Flash Text Engine, while the other two components leverage the Text Layout Framework built into Flex 4.

The Text Layout Framework also introduces the TextFlow class, which is an XML document of FlowElements that can be written using tags or using FlowElement classes. For instance, a paragraph within a TextFlow can be created using a <p> tag in a TextFlow XML document or by attaching a ParagraphElement directly ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required