Flash MX introduces a rich ActionScript API for working with text in movies. Prior versions didn't allow much more than being able to control the value displayed in manually created text fields. The TextField class is used to create and manipulate text at runtime (though the text itself can be created either at runtime or authoring time). Through methods and properties of a text field you can alter text visibility, change the position of the text within the movie, enable user input, and much more. In addition, there are two "helper" classes TextFormat and Selection that play a supporting role. TextFormat objects are used to apply formatting options such as font, font size, indentation, and margins to text fields. The Selection object allows programmatic control over keyboard focus and is helpful for selecting and deselecting text fields and the text within them. Text fields share similar properties with MovieClip and Button objects to control an object's position, rotation, and visibility, plus others shown in Table 8-1 (for a complete list of TextField properties, refer to the online help under Help ActionScript Dictionary).
|