Christian Basar
Christian Basar

Reputation: 59

Flash Actionscript 3.0 "Enter" Key Causes scene to change

I am creating a Flash game. Unfortunately, when the Player presses "Enter," the game continuously cycles through its scenes. I tried the following (although I know it's a bit buckshee):

            // The Enter Key was pressed
            // If the Enter key is pressed, the keyboard input is "changed" to
                // be '.'.  This prevents a problem in which the Player would
                // press 'Enter' and the game screen would continuously cycle
                // through scenes
        if (event.keyCode == Keyboard.ENTER) {
            // The 'PERIOD' key does nothing
            event.keyCode = Keyboard.PERIOD;
            //spaceKeyPressed = true;
        }           

Is there a way to prevent 'Enter' from cycling through the scenes?

Thanks,

Christian

Upvotes: 1

Views: 2111

Answers (1)

Chunky Chunk
Chunky Chunk

Reputation: 17217

While testing your game with Test Movie inside Flash Professional, select "Disable Keyboard Shortcuts" from the Control menu, Otherwise, as you can see in the Control menu, the first item is "Play" which has the Enter key as the keyboard shortcut.

Note that the items in the Control menu change depending on if you are currently testing a movie or not. You will only see the menu from the screenshot below while you are testing your game.

enter image description here

Upvotes: 3

Related Questions