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 3. Basic Game Framework: A Matching Game > Creating the Game Movie Clip

Creating the Game Movie Clip

In MatchingGameObject7.fla, there are three frames. Let’s skip right to the second frame. There, we can see a single movie clip. You might not even notice it at first because it is a completely empty movie clip and so appears as a small circle at the upper-left corner of the screen.

In the library, this movie clip is named MatchingGameObject7; and as shown in Figure 3.11, it is assigned the class MatchingGameObject7.

Figure 3.11. This movie clip will use the Matching GameObject7.as file as its class.


So, essentially, this movie clip takes over the entire game, and the main movie timeline is now a larger movie clip wrapped around it.

When the movie gets to frame 2, the MatchingGameObject7 movie clip springs into existence, runs the class constructor function in its MatchingGameObject7.as class, and the game plays inside this movie clip.

When the movie goes on to frame 3, the whole game will disappear because the movie clip only exists on frame 2.

This enables us to put frames before and after the game (and thus leave the game code alone to just worry about the game).

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