Flash ActionScript 3.0中的"Enter"导致场景改变的关键 [英] Flash Actionscript 3.0 "Enter" Key Causes scene to change

查看:119
本文介绍了Flash ActionScript 3.0中的"Enter"导致场景改变的关键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建Flash游戏.不幸的是,当玩家按下"Enter"键时,游戏会不断在场景中循环.我尝试了以下方法(尽管我知道这有点怪):

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;
        }           

有没有办法防止"Enter"在场景中循环显示?

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

谢谢

基督徒

推荐答案

在Flash Professional中使用测试电影测试游戏时,选择" 禁用键盘快捷键" ",否则,如您在 Control 菜单中看到的那样,第一项是"播放"具有 Enter 键作为键盘快捷键.

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.

请注意, Control 菜单中的项目会根据您当前是否正在测试电影而变化.在测试游戏时,您只会在下面的屏幕截图中看到菜单.

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.

这篇关于Flash ActionScript 3.0中的"Enter"导致场景改变的关键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆