Flash Actionscript 3.0“输入”场景发生变化的关键原因

发布于 2025-01-04 08:31:34 字数 664 浏览 6 评论 0原文

我正在创建一个 Flash 游戏。不幸的是,当玩家按下“Enter”键时,游戏会不断循环其场景。我尝试了以下操作(尽管我知道这有点花哨):

            // 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”在场景中循环?

谢谢,

克里斯蒂安

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

硬不硬你别怂 2025-01-11 08:31:34

在 Flash Professional 中使用测试影片测试游戏时,从控制菜单中选择“禁用键盘快捷键”,否则,正如您在控制菜单中看到的,第一项是“播放”,它以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.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文