Creating a Flash Lite Game - Page 2

Pages 1, 2, 3, 4, 5

We will create in this section the Game Start Frame. This frame will stop the game from playing instantly and will contain the title text and the button to make the game start when the player presses the 'Enter' button.

In order to follow this tutorial, you will have to download this file that contains the graphics for our game.

'Game Start' Frame

We will start working from the bottom layer going up. Starting with the background, select the Background layer, then import (File>Import>Import To Stage) the background.gif image to it. If the image is not automatically aligned at the right place, you have to make sure it does by doing that manually. Once you do that, lock this layer. The same background will be displayed throughout the game so we don't have to make any changes to it.

Flash Lite Game - Background Inserted

For the main content in this frame we are going to have text that says Start Game. Select the Main Content layer and then use the Text Tool to create such text, you can use any font, colour, and font size you wish for this. You can also add any graphics for a logo or anything of that sort in this frame.

Make sure that you have your text type set to Static (Check the Properties Inspector), if you use any other text type you will have to embed the characters before hand to make the text visible at run-time.

Flash Lite Game - Start Game Graphics

Even though no physical button will be required as the navigation is going to be through the phone keypad, Flash Lite 1 can only register key presses through a button symbol, so we will have to create one. Select the Buttons layer and use the Oval Tool to draw a little circle above the stage - our button should not be seen. Now use the Selection Tool to select this circle and then press F8 to convert it to a Button Symbol. Name it MyButton.

We will keep using an instance of this object each time we want to register keypad presses.

Flash Lite Game - Convert the circle to a Button Symbol

We will start putting some Actions now. Right-click our button, select Actions, and then paste the following code in the Actions Panel. This code will be assigned directly onto the button.

on (keyPress "<Enter>"){
play();
}

The code is self-explanatory, if the button "Enter" is pressed, the movie will be played. Of course, the movie by default should be playing, but we do not want to it to do that, so we will make it stop. To do this, first close the Actions panel, select the Actions layer, then right-click the first frame and select Actions. Paste the following code:

stop();
Just noticed something annoying about Flash CS3, if you want to assign a script to a certain frame, you will have to do the following: (1) select the layer of that contains the frame, (2) click on a faraway empty frame in the same layer - for example, frame 10 in our case, (3) now right-click the frame that you want to assign (frame 1 in our case) and select Actions. It doesn't make sense, but that's how it works.

An essential command to set at the first frame along with the stop() method is one that switches the player to fullscreen mode. Add the following code below the stop() command to do that:

fscommand2("fullscreen", true);

We are done with our Game Start Frame, here is a summary of what we did:

  1. Added the background to the Background layer.
  2. Added the title text to the Main Content layer.
  3. Added the button to the Buttons layer and assigned the play() method to the button.
  4. Assigned to the Actions layer the code to stop() the movie and started the fullscreen mode.

I hope that you found this section easy. We will now move to the Initialization Frame next.

- Next Page