Skip to main content
contwur
Participant
June 4, 2019
Answered

Navigate buttons using left/right keyboard arrows and enter

  • June 4, 2019
  • 1 reply
  • 388 views

I have 4 buttons over a fullscreen video and want to show when the buttons are being selected(button grows 20% it's size) using left/ right arrows and when pressing Enter on any button they will take you to Scene 2.

So far I can only do this with mouse and clicking, I would like to use only the keyboard. How can I do this? Also... when I create a Scene 2 the video in Scene 1 looks white

https://ibb.co/C0TY2V0

Thank you for reading!! I really appreciate your help

This topic has been closed for replies.
Correct answer kglad

use a keyboard event listener:

this.addEventListener(KeyboardEvent.KEY_DOWN, downF);

function downF(e:KeyboardEvent):void{

trace(e.keyCode);

}

1 reply

kglad
Community Expert
Community Expert
June 4, 2019

js or as3?

contwur
contwurAuthor
Participant
June 4, 2019

Sorry, as3

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 4, 2019

use a keyboard event listener:

this.addEventListener(KeyboardEvent.KEY_DOWN, downF);

function downF(e:KeyboardEvent):void{

trace(e.keyCode);

}