• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Text > Creating Text Elements

Creating Text Elements

Flash creates four types of text elements: static text labels, static text blocks, input text blocks, and dynamic text blocks (Figure 4.2). We'll discuss input and dynamic text blocks later in the chapter. The following describes static text elements and how they work.

Figure 4.2. The four types of text elements that Flash creates: Static text labels and static text blocks for displaying static information, input text blocks for accepting user input, and dynamic text blocks for displaying up-to-date info that Flash can generate on its own.


Static Text Elements

In contrast to input text blocks and dynamic text blocks, whose contents can change while your movie is playing, the contents of static text elements cannot be changed outside of the authoring environment. Thus, when you create a static text label or static text block, you edit the text so that it appears exactly the way you want in your movie, where it will remain static.

A text label is simply text that continues on a single line until you manually insert a line break by pressing either the Enter key or the Return key. This type of text object does not wrap text automatically, as do most of today's word-processing applications. Instead, text labels allow you to determine what word will appear at the end of each line (Figure 4.3). Text labels are best used for small sections of text that contain one or two words.

Figure 4.3. Text labels expand as you type text into them and are best suited for short sections of text.


Static text blocks have a fixed width. This means that you assign a width to your text block when you create it, and then any text you type into it will "wrap" to the next line based on the width you defined (Figure 4.4). Text blocks are used for displaying paragraphs of text.

Figure 4.4. Text in a text block automatically wraps to the next line.


To create a static text label:

1.
On the toolbar, choose the Text tool, or press the T key.

2.
With the Text Options panel open, select Static Text from the menu of choices.

3.
With the Character panel open, set the text attributes—font, font size, and color—that you want to use for this label.

Move the cursor to the stage area, where it will turn into a crosshair with a small A in its bottom right corner. The center of the crosshair indicates the bottom left corner of any new text labels created.

4.
Click on the stage where you want to place your text label.

A small box with a circle in its top right corner and a blinking insertion point appears. This is an empty text label.

5.
Enter the text you desire, and the text label will automatically expand to accommodate it.

Tip

If you click elsewhere before entering text, your empty text label will disappear.

Be careful in choosing your font for text elements. Due primarily to antialiasing, some fonts are hard to read at small sizes—especially when viewed in the final presentation. If you can't enlarge your text, you can select one of three special fonts from the font pop-up list: _sans, _serif, or _typewriter. These fonts will always be displayed with antialiasing turned off.


To create a static text block:

1.
On the toolbar select the Text tool, or press the T key.

2.
With the Text Options panel open, select Static Text from the menu of choices.

3.
With the Character and Paragraph panels open, set your text attributes for the block, including font, font size, and color.

Move the cursor to the stage, where it will turn into a crosshair with a small A in its bottom right corner. The center of the crosshair indicates the bottom right corner of any new text blocks you create.

4.
Click and drag from left to right to define the width of your text block, then release to complete the action.

A rectangle with a small square in its top right corner and a blinking insertion point appears.

5.
Enter the text you want, and the text block will automatically wrap text to the width you defined.

Tip

Once you've set any options on the various text panels (as in Steps 2 and 3) for both static text blocks and static text labels, these settings will be used for all new text elements (until you change them).

Any text you type may initially appear rough. To obtain smoother-looking text, from the View menu choose Antialias Text.


To change the width of a text block:

1.
On the toolbar select the Arrow tool, or press the V key.

2.
Click and drag the text block's resize handle. Any text in the block will be automatically reformatted to fit the new size (Figure 4.5).

Figure 4.5. Resizing a text block automatically reformats any text within it.


To change a text block to a label, or vice versa:

  • Double-click the resize handle of the text element.

Input and Dynamic Text Elements

Input and dynamic text elements serve a different function than static text elements. Thus, it stands to reason that you create them in a different way as well. Because input and dynamic text fields need to accommodate an unknown amount of text, you are able to drag their size vertically as well as horizontally when creating them. Although you create input and dynamic text elements in the same way, you will need to configure them differently to work in your movie.

To create an input or dynamic text element:

1.
On the toolbar select the Text tool, or press the T key.

2.
With the Text Options panel open, select either Input or Dynamic Text from the menu of choices.

3.
With the Character and Paragraph panels open, set the text attributes you want to use for this element, including font, font size, and color.

Move the cursor to the stage area, where it will turn into a crosshair with a small A in its bottom right corner. The center of the crosshair indicates the bottom right corner of any new text blocks you create.

4.
Click and drag from left to right and from top to bottom to define the width and height of your text element, then release to complete the action.

A rectangle with a small square in its bottom right corner and a blinking insertion point appears.

5.
Enter the text you want, and the text element will automatically wrap to the width you defined.

If these text elements are so dynamic, though, why bother to set text attributes or input text (as described in Step 5 above)? First, by typing in text, you can display what will appear initially (for example, instructions for an input box). That text, then, can subsequently be erased by the user or replaced dynamically (Figure 4.6). Second, by using the Character and Paragraph panels to set text attributes, you can define the default attributes that will be used for user- or dynamically-entered text. For more information, see "Powering Input and Dynamic Text Elements with Rich-Text Formatting" later in this chapter.

Figure 4.6. Any text you type into an input text block—for example, user instructions—will be displayed in that text element until it's replaced by user-entered text.


You can also leave an input or dynamic text element empty and then use ActionScript to dynamically fill it. This is an option when you want to display a dynamic message to your user or accept user input when requesting information (look for more on this later in the chapter and also in Chapter 14, "Building Advanced Interactivity with ActionScript" ).

To change the width or height of an input or dynamic text element:

1.
On the toolbar select the Arrow tool, or press the V key.

2.
Click and drag the text elements's resize handle horizontally or vertically to resize its width or height, respectively. Any text will be automatically reformatted to fit the new size.

Tip

You can turn a dynamic text element into a static one by simply selecting it on the stage with the Arrow tool and then changing its definition on the Text Options panel.


  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint