Working with text overview

A dynamic or input text field is a TextField object (an instance of the TextField class). When you create a text field, you can assign it an instance name in the Property inspector. You can use the instance name in ActionScript statements to set, change, and format the text field and its content using the TextField and TextFormat classes.

The methods of the TextField class let you set, select, and manipulate text in a dynamic or input text field that you create during authoring or at runtime. For more information, see Using the TextField class. For information on debugging text fields at runtime, see Displaying text field properties for debugging.

ActionScript also provides several ways to format your text at runtime. The TextFormat class lets you set character and paragraph formatting for TextField objects (see Using the TextFormat class). Flash Player also supports a subset of HTML tags that you can use to format text (see Using HTML-formatted text). Flash Player 7 and later supports the <img> HTML tag, which lets you embed not just external images, but also external SWF files, as well as movie clips that reside in the library *see Image tag (<img>)).

In Flash Player 7 and later, you can apply Cascading Style Sheets (CSS) styles to text fields using the TextField.StyleSheet class. You can use CSS to style built-in HTML tags, define new formatting tags, or apply styles. For more information on using CSS, see Formatting text with Cascading Style Sheets.

You can also assign HTML formatted text, which may optionally use CSS styles, directly to a text field. In Flash Player 7 and later, HTML text that you assign to a text field can contain embedded media (movie clips, SWF files, and JPEG files). The text will wrap around the embedded media, just as a web browser wraps text around media embedded in an HTML document. For more information, see Image tag (<img>).