How to Code an Online Flash Game

Creating online games with Flash requires you know how to code. Two commonly used programming commands used with Flash are the addChild and removeChild commands. With these simple to use commands you can build a graphic library of icons for your online Flash game. Using the addChild and removeChild commands requires that you have a graphic image to place or remove. Once you create or import a graphic into Flash, you can then use the addChild and removeChild commands to let the player place or remove graphic icons on and off the game board.

Things You'll Need

  • Adobe Flash Professional Software
Show More

Instructions

    • 1

      Obtain a piece of paper and label it "Graphic Library Components." Draw some sketches of graphic components for the game on the paper. Give each graphic a name and write it down next to the sketch. Draw a rectangle and name it "rectangleOne" for this example.

    • 2

      Write the addChild command to place rectangleOne on the game board. Write the command such that it follows the syntax "addChild(name)," or for this example "addChild(rectangleOne)." Now, write the removeChild command to remove rectangleOne from the game board such that it follows the syntax "removeChild(name)," or this example "removeChild(rectangleOne)." Repeat these two procedures for all of the graphic images listed on your paper.

    • 3

      Use the code to automatically add a graphic from the library to the game board when the player selects an icon in the library.

Learnify Hub © www.0685.com All Rights Reserved