0% found this document useful (0 votes)
45 views1 page

Key Event

This code sample listens for keyboard events on the stage and defines a function to handle key presses. The function checks if the spacebar key is pressed and if so, outputs "Success!" to the trace log.

Uploaded by

harishfriendz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views1 page

Key Event

This code sample listens for keyboard events on the stage and defines a function to handle key presses. The function checks if the spacebar key is pressed and if so, outputs "Success!" to the trace log.

Uploaded by

harishfriendz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

stage.addEventListener(KeyboardEvent.

KEY_DOWN, myKeyDown);
function myKeyDown(e:KeyboardEvent):void{
if (e.keyCode == Keyboard.SPACE){
trace("Success!");
}
}

You might also like