2012-02-12 55 views
1

我正在创建一个Flash游戏。不幸的是,当播放器按下“Enter”时,游戏会不断循环播放它的场景。我试着下面的(虽然我知道这是一个有点免费的):Flash Actionscript 3.0“Enter”Key导致场景改变

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

有没有一种方法,以防止“回车”从通过场景骑自行车吗?

感谢,

基督教

回答

3

虽然测试与测试影片 Flash Professional中的内部游戏,选择 “禁用快捷键” 从控制菜单,否则,你可以请参阅控制菜单,第一项是“播放”,其中有输入作为键盘快捷键。

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

enter image description here

+0

非常感谢您的帮助! – 2012-02-20 05:51:38