Flash 8 Documentation |
|||
| Learning ActionScript 2.0 in Flash > Working with Text and Strings | |||
Many of the applications, presentations, and graphics that you create with Macromedia Flash Professional 8 or Macromedia Flash Basic 8 include some kind of text. You can use many different kinds of text. You might use static text in your layouts, but dynamic text for longer passages of text. Or you might use input text to capture user input, and text in an image for your background design. You can create text fields with the Flash authoring tool, or use ActionScript.
One way to display text is to use code to manipulate how strings appear before they are loaded and displayed on the Stage at runtime. You can work with strings in an application in several ways, such as sending them to a server and retrieving a response, parsing strings in an array, or validating strings that the user types into a text field.
This chapter describes several ways to use text and strings in your applications, focusing on using code to manipulate text.
The following list describes terminology used in this chapter.
Alias Aliased text does not use color variations to make its jagged edges appear smoother, unlike anti-aliased text (see following definition).
Anti-alias You use anti-aliasing to smooth text so the edges of characters that appear onscreen look less jagged. The Anti-Alias option in Flash makes text more legible by aligning text outlines along pixel boundaries, and is particularly effective for clearly rendering smaller font sizes.
Characters Characters are letters, numerals, and punctuation that you combine to make up strings.
Device fonts Device fonts are special fonts in Flash that are not embedded in a SWF file. Instead, Flash Player uses whatever font on the local computer that most closely resembles the device font. Because font outlines are not embedded, a SWF file size is smaller than using embedded font outlines. However, because device fonts are not embedded, the text that you create with these fonts looks different than expected on computer systems that do not have a font installed that corresponds to the device font. Flash includes three device fonts: _sans (similar to Helvetica and Arial), _serif (similar to Times Roman), and _typewriter (similar to Courier).
Fonts Sets of characters with a similar font face, style, and size.
String A sequence of characters.
Text A series of one or more strings that can be displayed in a text field, or within a user interface component.
Text fields A visual element on the Stage that lets you display text to a user. Similar to an input text field or text area form control in HTML, Flash lets you set text fields as editable (read-only), allow HTML formatting, enable multiline support, password masking, or apply a CSS stylesheet to your HTML formatted text.
Text formatting You can apply formatting to a text field, or certain characters within a text field. Some examples of text formatting options that can be applied to text are: alignment, indenting, bold, color, font size, margin widths, italics, and letter spacing.
For more information on text, see the following topics:
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00001414.html