PDA

View Full Version : Keyboard Listener won't listen?



relinquished
March 7th, 2009, 12:29 PM
Hello,

I'm having a bit of trouble with the keyboardEvent.KEY_DOWN event listener. I'm not getting any errors, flash seems to be just ignoring that listener altogether. I'll paste my code below, if anyone could help, that'd be great!



package
{
import flash.display.MovieClip
import flash.events.*
public class hotAirBalloon extends MovieClip
{
public function hotAirBalloon()
{
this.y = 300
this.x = 80
this.addEventListener(KeyboardEvent.KEY_DOWN,keybo ardListener)
}
private function keyboardListener(event:KeyboardEvent)
{
trace(event.keyCode)
}
}
}