KeyBoard Events, getting to the stage

I’m definitely suffering with the lack of Keyis.Down! Anywhoo here is my code…

public function Crung() {
    this.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPressed);
}
    
public function onKeyPressed(evt:KeyboardEvent):void {
    switch (evt.keyCode) {
        case Keyboard.RIGHT:
            this.x += 1;
            break;
        }
    }
}

This does nothing, and I’m thinking its because this isn’t the document class and the event listener needs to be on the stage. ‘public function Crung() {’ is the constructor for the class Crung. An instance of Crung is created in Level1.as. And an instance of Level1 is created in Main.as which is the document class. So…

Main.as
…Level1.as
…Crung.as

Crung is basically a MovieClip which the user moves around the stage using the keyboard keys.

Any help in going about this? Not necessarily moving him around, just getting the listener to do anything in Crung.as :slight_smile: