Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

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

Chapter 2. Working with Events and Functions > Adding to the dynamic text field

Adding to the dynamic text field

Right now, when your movie loops over the opening animation, the text field is instructed to display the number representing the times the animation has played. The number is accurate, but it is not elegant user feedback. Let’s make the information in the text field more useful by adding some prose to the field to make a complete sentence.

1.
With the Actions panel and the timeline visible, select the loop frame (frame 2) in the actions layer of the timeline.

2.
In the Actions panel, change the code that currently reads:

info_txt.text = String(count);

so that it reads:

info_txt.text = "The animation has played " + String(count) + "x.";

The plus signs are used to concatenate (or join) the literal text (in quotes) with the value of the count variable to form a sentence.

3.
Save your work and test the movie once more. The text field should now read: “The animation has played 1x (2x, 3x, and so on).”


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint