Return to Snippet

Revision: 52582
at October 27, 2011 01:19 by adrianparr


Initial Code
import flash.ui.Keyboard;
import flash.events.KeyboardEvent;

stage.addEventListener(KeyboardEvent.KEY_DOWN, onStage_KEY_DOWN);

private function onStage_KEY_DOWN(event:KeyboardEvent):void 
{
	switch (event.keyCode) 
	{
		case Keyboard.LEFT:
			trace("LEFT");
			break;
		case Keyboard.RIGHT:
			trace("RIGHT");
			break;
	}
}

Initial URL

                                

Initial Description

                                

Initial Title
AS3 Left and Right Cursor Key Presses

Initial Tags

                                

Initial Language
ActionScript 3