Skip to main content
XenoHarry
Participant
January 5, 2015
Question

Action Script 3, how to create a start screen for a game

  • January 5, 2015
  • 1 reply
  • 2057 views

What code do I write to create a starting screen for a game? I want to create a screen were if play is clicked it moves on to the game

This topic has been closed for replies.

1 reply

Known Participant
January 5, 2015

One way of doing it:

Make a MovieClip which contains everything you want to see on the start screen, including the play button.

Add code for the button:

When the button is clicked, then the MovieClip is removed or made unvisible and another MovieClip, containing the game, is added or made visible.

Hope it helps a bit.

Known Participant
January 5, 2015

And the code for the button would be:

EnterScreen.EnterBtn.addEventListener(MouseEvent.CLICK, enterGame);

function enterGame(event: MouseEvent): void

        {

            EnterScreen.PlayBtn.removeEventListener(MouseEvent.CLICK, enterGame);

             removeChild(EnterScreen); //(or EnterScreen.visible = false)

            GameScreen.visible = true;

        }

where the "EnterScreen" is the name of the startup MoveiClip and the "GameScreen" is the name of the MovieClip which contains the game.