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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 7. Using Arrays and Loops in Act... > Examining the starting file

Examining the starting file

To begin this project, open the Lessons > Lesson07 > Start > lesson07_start.fla file. The main Timeline of the lesson07_start.fla file has four layers. The bottom background layer contains a static background graphic created using Flash CS5 Professional’s new and improved Deco tool. The basket layer contains an instance of a movie clip symbol that contains a graphic of a basket. This has been given the instance name of basket_mc. The text layer has two text fields with the instance names of field1_txt and field2_txt. The actions layer is empty. You will place all the code for this lesson in Frame 1 of this top layer. Before that, however, let’s take a closer look at the movie clips that will be used in this project.

1.
With the Properties panel visible, select the basket_mc movie clip in the basket layer.

2.
Double-click the basket_mc clip on the Stage to view the clip’s Timeline. Notice that the clip’s Timeline has three layers and 20 frames. The basket layer contains the static image of the basket. The fruit layer has a new keyframe every five frames. The first frame of the fruit layer contains no content. Each subsequent keyframe in this layer contains increasing amounts of fruit.

3.
The actions layer of the Basket clip has an action on the first frame. With the Actions panel visible, select Frame 1 of the clip’s actions layer.

Notice that there is a stop() action on Frame 1. When the Flash project is played, this action will prevent the movie clip from going beyond its first frame. This means that at the beginning of the game, there will be no fruit in the basket. As your user collects fruit in the basket, ActionScript that you will create later in this lesson will send the user to the later frames in this Timeline to create the illusion that the basket is being filled with fruit.

4.
In the upper-left corner above the Stage, click the tab labeled Scene 1 to return to the main Timeline. The remaining graphics and functionality for this project will be added using ActionScript in Frame 1 of the main Timeline.


  

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