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

Chapter 10. Controlling Text > Tweening Dynamic Text

Tweening Dynamic Text

If you convert dynamic text boxes into symbols, you can apply motion tweens to them, just as you can with other symbol instances. This lets you create titles and banners that not only can be dynamically updated, but that can move across the screen, rotate, and shrink or grow in size. For example, imagine a blimp traveling across the Stage with a giant scoreboard attached to its side. By having the dynamic text box as the scoreboard on the blimp graphic, you can update scores or have messages appear as the blimp floats. A stock ticker-tape monitor could be created this way as well, with the stock prices moving across the screen. Or you could create a game that displays the current status of an individual player right next to the player's icon, even as it moves around the Stage.

To create a moving dynamic text box:

1.
Select the text tool, and drag out a text box.

2.
In the Text Options panel, choose Dynamic Text and Single Line in the two pull-down menus. Give this text box a variable name, and embed the entire font outline (Figure 10.23).

Figure 10.23. Name your dynamic text variable display, and embed all font outlines.


3.
Choose Insert > Convert to Symbol from the main toolbar menu. Name your symbol, and select Graphic Behavior in the dialog box that appears. Click OK.

Flash puts your Dynamic Text box inside a graphic symbol and places an instance of it on the Stage.

4.
Select your graphic instance, and choose Insert > Convert to Symbol. Name your symbol, and select Movie Clip Behavior in the dialog box that appears. Click OK.

Flash puts your graphic symbol inside a movie-clip symbol and places an instance of it on the Stage.

5.
In the Instance panel, name the movie-clip instance.

6.
Enter symbol-editing mode for your movie-clip symbol.

Your movie-clip symbol contains a graphic instance that contains your dynamic text box.

7.
Create a motion tween of the graphic instance moving across the Stage (Figure 10.24).

Figure 10.24. On the blimp scoreboard movie-clip Timeline, tween the graphic instance that contains the dynamic text. This graphic moves across the Stage behind a mask of the scoreboard.


8.
Return to the root Timeline. Select the text tool, and drag out another text box below the movie-clip instance.

9.
In the Text Options panel, choose Input Text and Single Line. Give this text box a variable name (Figure 10.25).

Figure 10.25. Name the input text box message.


10.
Select the movie-clip instance, and open the Actions panel. Choose Actions > onClipEvent. Select the enterFrame event.

11.
Choose Actions > set variable. In the Variable field, enter the target path to the dynamic text variable. In the Value field, enter the target path to the input-text variable. Check the Expression box next to the Value field (Figure 10.26).

Figure 10.26. Assign the dynamic text variable called display to the input text variable called message.


The dynamic text box is continuously updated with the contents of the input text box.

12.
Test your movie.

When your viewer enters information in the input text box, it is assigned to the dynamic text box in the movie-clip animation, and the updated text moves across the screen (Figure 10.27).

Figure 10.27. The dynamic text box (top) tweens any message your viewer enters in the input text box (bottom).



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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