Recipe 7.1. Adding Static Text to the Stage


Problem

You want to add static text to your Flash movie.

Solution

Select the Text tool, and in the Property inspector, select Static Text as the text type. Then draw the text field on the stage, and enter a text value.

Discussion

Static text refers to text that you can create at authoring time but that cannot be modified or controlled by ActionScript. Static text is ideal for labels (meaning labels that you place on the stage, not to be confused with labels for layers within the authoring environment) and for any text values you want to hardcode into your Flash movie. Static text is the most basic kind of text you can add to a movie, because it does not require (or even allow) you to assign it an instance name or use ActionScript to assign its values.

There are four basic steps to creating static text in your movie:

  1. Select the Text tool either by clicking on the Text button in the toolbar or by pressing the keyboard shortcut (T).

  2. Open the Property inspector (Window Properties) and make sure that Static Text is selected in the text type menu. The Property inspector appears in the lower portion of the Flash authoring application by default.

  3. When you release the mouse button to stop drawing the text field, the text field automatically becomes selected, and the text input cursor appears within it. Also, notice that the outline becomes a solid line to indicate that it is selected for input. At this point, you should either use the keyboard to enter text or use the Edit Paste command to paste text from the clipboard. If you deselect the text field without entering any text, Flash deletes the field and you will have to draw another.

After you have successfully created a static text field, you can reposition it on the stage using the Selection tool. You can also select and modify the text using the Text tool.




Flash 8 Cookbook
Flash 8 Cookbook (Cookbooks (OReilly))
ISBN: 0596102402
EAN: 2147483647
Year: 2007
Pages: 336
Authors: Joey Lott

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net