Flash Actionscript 3.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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 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.