Chapter 10. TEXT
Working with text can be a basic affair, such as drawing a text box in the Flash interface and populating it with text at authoring time, or as complex as your needs require, perhaps including the dynamic creation of individual text fields for every character in a string to create an animated text effect. Learning how to move from authoring-only manual manipulations to runtime ActionScript control, however, can dramatically improve your text-handling capabilities and open a lot of creative doors.
In this chapter we’ll focus mostly on how to display, populate, and format existing text data. We’ll cover:
Creating Text Fields. Text fields can be created with ActionScript like any display object, freeing you from the Flash Property Inspector and allowing you to create fields on the fly.
Setting Text Field Characteristics. How you set up your text field will determine how the field will appear and function.
Selecting Text. You can select segments of text fields using ActionScript by specifying the start and end of a selection block.
Formatting Text. Text can be formatted easily by creating a formatting object that can be applied to one or more text fields at any time, including partial content of these fields.
Formatting with HTML and Cascading Style Sheets. It is also possible to use a limited subset of supported HTML and Cascading Style Sheets (CSS) features to format and style your text globally or on a field-by-field basis. Both HTML and style sheets can be created internally ...
Get Learning ActionScript 3.0 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.