Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Design > Adobe Creative Suite

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Creating the Game Intro

Games, like life, are all about interaction. Unlike life, however, most games come with a set of instructions. This Pac-Man–style game has an introduction that serves both to introduce the character Puffin to the user and to offer a brief set of instructions for the game. Here, you will attach a script to the Enter button that will allow the user to enter the maze and begin the game.

  1. Open the maze_start.fla file from the Projects/05 folder you copied to your hard drive during "Preparing to Work."

    The game intro is in the first scene, Game intro.

Figure 5.4Figure 5.4

The Scene panel (Windows > Design panels > Scene or Shift+F2) lists the two scenes of the maze game.

Figure 5.5Figure 5.5

  1. Click on the Enter button on the Stage and, using the Properties panel, give it the instance name intro _btn.

  2. Open the Actions panel, go to the actions layer in Frame 1 of this layer, and add this script:

    Listing 5.1

    //Button code - jumps to scene 2
    intro_btn.onRelease = function() {

    This script executes when the user releases the Enter button. You target the button instance intro_btn with a script on the main Timeline that instructs the player to jump to the next scene. The next scene (Tree Maze) is where the user can play the game.


You added the _btn suffix to the Enter button instance name, instead of just naming it intro, to call up the useful Code Hint tool, as shown in the following figure. Using the Macromedia preferred suffix _btn will bring up the button properties in the ActionScript panel Code Hint window.

Figure 5.6Figure 5.6

  1. Save your work.

  • + Share This
  • 🔖 Save To Your Account