Flash CS3 Documentation |
|||
| Learning ActionScript 2.0 in Adobe Flash > Working with Text and Strings > About text fields | |||
A dynamic or input text field is a TextField object (an instance of the TextField class). When you create a text field in the authoring environment, 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 by using the TextField and TextFormat classes.
You can use the user interface to create several kinds of text fields, or you can use ActionScript to create text fields. You can create the following kinds of text fields in Flash:
Static text Use static text to display characters that do not need to change, to display small amounts of text, or to display special fonts that are not available on most computers. You can also display uncommon fonts by embedding characters for dynamic text fields.
Dynamic text Use dynamic text fields when you need to display characters that are updated or that change at runtime. Also, you can load text into dynamic text fields.
Input text Use input text fields when you need to capture user input. Users can type in these text fields.
Text components You can use TextArea or TextInput components to display or capture text in your applications. The TextArea component is similar to a dynamic text field with built-in scroll bars. The TextInput component is similar to an input text field. Both components have additional functionality over their text field equivalents; however, they add more file size to your application.
|
NOTE |
|
All text fields support Unicode. For information on Unicode, see About strings and the String class |
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 Using Flash.
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).
In Flash Player 7 and later, you can apply Cascading Style Sheet (CSS) styles to text fields using the TextField.StyleSheet class. You can use CSS styles 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 Sheet styles.
You can also assign HTML formatted text, which might 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). In Flash Player 8 and later, you can also dynamically load PNG, GIF, and progressive JPEG images (Flash Player 7 does not support progressive JPEG images). The text wraps around the embedded media similar to how a web browser wraps text around media embedded in an HTML document. For more information, see Image tag.
For information on the terminology that compares text, strings, and more, see the introduction for this chapter, Working with Text and Strings.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000878.html