Skip to main content
Participant
November 2, 2021
Question

Animate ActionScript 3.0 does not recognize key presses when testing, or published. Game.

  • November 2, 2021
  • 1 reply
  • 377 views

I am going through a book tutorial on creating games in Flash/Animate, and the game is using keyboard key presses (arrow keys, spacebar) to control game elements. When I test the game, and also when I publish the game in .swf and windows exe format. The keys do nothing. This used to work years ago when I went through these examples previously, but now they aren't. I've looked through some troubleshooting sources, and I see a lot of references to something like "when testing the game, go to "Control/Disable Keyboard Shortcuts" because apparently, the testing environment is using keyboard shortcuts and has priority. However, in the current versions (2021, 2022) of Animate, I don't see anywhere where I can tell it to disable keyboard shortcuts for the test environment. Is there anyone that knows what to do about this now in the current software?

P.S., I'm not using Flash Builder, or any other ActionScript coding apps. It's all done in Animate.

Thanks.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
November 3, 2021

are you assigning the listeners to "stage"?

Participant
November 4, 2021

Yes, I am.

kglad
Community Expert
Community Expert
November 4, 2021

it works for me.

 

 create a new fla 

add something to the stage. 

add your keyboard listeners

test by clicking whatever is on stage and then press your keys

 

if that fails, show your code