Copy link to clipboard
Copied
So I'm having a weird issue with a game I'm putting together with actionscript 3.
The game is nothing complicated. I found a tutorial online to get some simple navigation with the keyboard arrow keys. I have a menu screen at the start of the game and I made a start button that takes you to another frame on the timeline where the game play is coded. If I click that start button it navigates to the play section of the timeline but the keyboard controls don't work at all. If instead of pressing the start button I just hit enter on the keyboard the swf plays forward until it hits the game section and the stop command and then the keyboard controls work fine.
Obviously my keyboard navigation controls are correct or it wouldn't be working at all but why does clicking the start button I created somehow stop it from working properly?
Any suggestions or thoughts anyone?
See if the following discussion helps solve the issue:
http://stackoverflow.com/questions/12469276/action-script-3-keyboard-event-set-focus
Copy link to clipboard
Copied
UPDATE!!
I've since discovered that if I click my start button the keyboard navigation will work as long as I click on the view screen once first. This almost raises more questions though? I tried it on another computer too and it's the same issue. Also tried embedding it in an html in case it was just a flash specific glitch. This makes no sense as far as I can tell.
I'm using Animate CC 2015 btw.
Copy link to clipboard
Copied
See if the following discussion helps solve the issue:
http://stackoverflow.com/questions/12469276/action-script-3-keyboard-event-set-focus
Copy link to clipboard
Copied
It did! Thanks.
Follow up question though. Is it possible to make it so the enter key won't advance forward on the timeline? Like I want the arrow keys to work for my navigation in the game but I don't want to be able to leave the main menu screen unless I click a button with mouse. I never actually realized this was an option with an exported swf until stumbling on it with this project.
Copy link to clipboard
Copied
Show the code you have for the Enter key.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now