Playing with Active Text in Flash

Static text gets the job done, giving information to your Web site visitors. But Flash can do so much more with text. Sometimes you don't want your text to be text at all, but rather prefer a bunch of individual letter shapes that you can bend, twist, move, and otherwise discombobulate. Flash's Break Apart command lets you do this.

If your design calls for getting information from your Web site visitors, you can do so by using a text input box, which is a field into which site visitors can input text.

And then there's dynamic text. The content of a dynamic text box is determined by a variable whose content can change at different points in your Flash movie. Dynamic text is a wonderful way to personalize information you present to visitors to your Flash Web site.

Breaking text apart

When you break apart a block of text, you can select each letter of text, a useful task if you want to animate the letters. If you apply the Break Apart command twice, you convert each letter into a vector object, which is a good thing if you want to create stylized letters. You can also apply a shape tween to a letter that has been converted into a vector object, which enables you to morph a letter into something else.

Alternatively, you can press Ctrl+B (Windows) or Cmd+B (Macintosh) to achieve the same result.

3. Repeat Step 2.

When you break apart text into vector objects, they can no longer be edited as text. You can, however, edit the individual objects with the Select tool, which is used to edit the path of the shape, or Subselection tool, which is used to edit the individual points that make up the shape.

Creating input text boxes

An input text box enables your Flash Web site visitors to input information, which is then stored in a variable. The contents of the variable can be used in other parts of your Flash movie; for example, you can display the contents of the variable in a dynamic text box. Here's how you create an input text box:

1. Select the Text tool.

2. Choose Window --> Properties to open the Properties Inspector.

3. Select the Input Text option from the Text Type drop-down menu.

The Properties Inspector is reconfigured to accept the parameters for input text.

4. Specify the font attributes.

5. Enter a name in the Var field.

This is the name for the variable that will store the information entered by the user.

6. Drag the Text tool on Stage to define the area that will be occupied by the input text box.

After entering a name in the Var field, you've provided Flash with everything it needs to know in order to store the information entered by visitors to your Flash Web site. To demonstrate the one-two punch of input text and dynamic text, create a new document by following the preceding steps, and then following the steps in the next section to create a dynamic text box using the same Var name you used with the input text box. When the movie is published or tested (Ctrl+Enter [Windows] or Cmd+Return [Macintosh]), the text entered in the input text box is mirrored in the dynamic text box.

Creating dynamic text

A dynamic text box enables you to display information that is stored in a variable. Dynamic text boxes are wonderful ways to display information previously input by a user or information you've assigned to a variable. For example, you can use a dynamic text box to display information entered by a Web site visitor — shipping information, for example. Follow these steps to create a dynamic text box:

1. Select the Text tool.

2. Choose Window --> Properties to open the Properties Inspector.

3. Select the Dynamic Text option from the Text Type drop-down menu.

The Properties Inspector is reconfigured to accept the parameters for dynamic text.

4. Specify the font attributes.

5. Enter a variable name in the Var field.

This is the name of the variable that contains the information you want to display in the dynamic text box.

Make sure you type the variable name correctly. Misspelled or mis-capitalized variable names translate into buggy Flash movies.

6. Drag the Text tool on Stage to define the area occupied by the dynamic text box.

When the movie is published, the dynamic text box displays the information stored in the variable that contains the same name you entered in the Var field in Step 5.