If you are working with AS3, add an EventListener to the stage to listen for KeyboardEvents:
// This means, every time a key is held down, the ‘keyDownHandler’ function will be called, which I will write now:
private function keyDownHandler(e:KeyboardEvent):void
// The variable ‘e’ now holds information about the event. e.keyCode will hold the code of the key that was pressed.
if(e.keyCode == 38)
// Put code here to be executed when the UP arrow is pressed.