Working with Text in Macromedia Flash 8
Flash's text tool doesn't just create graphic-objects in the shape of letters, it creates text boxes filled with live type; in the authoring environment, the contents of a text box are fully editable. As you create text elements, you must decide how they will be used in the published movie and assign them a text-type property. If you want the end user to interact with a text field (for example, to enter personal information), set the text box's text-type property to input. If you want to update the text at runtime (for example, using ActionScript to download and display new basketball scores to a sports site), set the text-type property to dynamic. If the text will just sit there looking pretty, set the text-type property to static.
Flash 8 uses a new text-rendering engine called Flash Type, which makes fonts more legible (especially at small sizes). This legibility shows up in the authoring environment, as you create your movies, but it also comes into play for your end users if you publish your files for Flash Player 8 (see Chapter 16).
In this chapter, you learn about using static text. The manipulation of input and dynamic text fields requires a more advanced level of ActionScripting than this book can cover; if you need to know more, check out Macromedia Flash 8 Professional Advanced; Visual QuickPro Guide, from Peachpit Press.
Using the Text Tool
The text tool creates blocks of editable text. You can set the text to read horizontally or vertically. You can also apply a variety of text attributes to text—including text and paragraph styles.
To create a single line of text for use as a graphic element
- In the Tools panel, select the text tool or press T (
Figure 3.1 Select the text tool in the Tools panel to start creating text boxes on the Stage.
- Move the pointer over the Stage.
The pointer turns into a crosshair with a letter A in the bottom-right corner (
Figure 3.2 The text-tool pointer.
- Click the Stage at the spot where you want your text to start.
Flash creates a resizable text box with a blinking insertion point, ready for you to enter text (
Figure 3.3 Click the Stage with the text tool to create a text box. The round resize handle indicates that the text box does not have word wrap turned on.
- Start typing your text.
The text box grows to accommodate whatever you type (
Figure 3.4 As you type, the box grows horizontally to accommodate your text. The text won't wrap.
- When you finish typing, click elsewhere on the Stage or change tools. Flash hides the text box, leaving just the text visible. When you click this text with the selection tool, Flash selects the text box so that you can reposition it or change the text's attributes directly.
To create a text box with set width and word wrap
- With the text tool selected in the Tools panel, click the Stage at the spot where you want your text to start.
- Move the pointer over any of the resize handles. The pointer changes to a double-headed arrow.
- Click and drag one of the handles until your text box is as wide as you want it (
Figure 3.5 Click and drag any resize handle to create a text box with a specific width. The top-right handle changes to a square, indicating that the text you enter will wrap to fit the column width of the text box. The text box continues to grow in length—but not width—as you enter more text.
- Release the mouse button. The blinking insertion point appears in the text box.
- Enter your text. Flash wraps the text horizontally to fit inside the column that the text box defines. The box automatically grows longer (not wider) to accommodate your text.