Keyboard Events

Hi all, currently learning AS3 and having a bit of trouble with keyboard events. I feel like I understand how they work, but something about my implementation is faulty. This is basically the code I currently have, and I can’t find an error in it based on tutorials and such that I’ve looked up:


package  {
	import flash.events.KeyboardEvent
	import flash.display.MovieClip
	public class Main extends MovieClip {
		public function Main() {
			this.addEventListener(KeyboardEvent.KEY_DOWN,KP)
		}
		private function KP(e:KeyboardEvent):void{
			trace('you pressed a key')
		}
	}
	
}



When I run it and pound my keyboard repeatedly nothing happens though :frowning:

It’s probably just a simple error, but I’m completely at a loss, so help would be much appreciated.