function keyDownHandler71(event:KeyboardEvent):void {
gotoAndPlay("edgeofdarkness");
}
function keyUpHandler71(event:KeyboardEvent):void {
gotoAndPlay("home1");
}
function keyRightHandler71(event:KeyboardEvent):void {
gotoAndPlay("avatar");
}
function keyEscapeHandler71(event:KeyboardEvent):void {
gotoAndPlay("end");
}
function keyEnterHandler71(event:KeyboardEvent):void {
gotoAndPlay("loadingitscomplicated");
}
The code for KEY_UP and KEY_DOWN seems to work fine. But, the rest of it returns the error "1119: Access of possibly undefined property Key through a reference with static type Class." What the hell?
How do you call a function for Right, Left, Enter, and Escape Keys?
Notice that KeyboardEvent.KEY_DOWN and KeyboardEvent.KEY_UP are two events. One for when you press a key and another one for when you release it.
It has nothing to do with the up and down arrow.
Wherever it says trace("XXX"); you replace with the code you want to be ran every time the key is pressed.
Also, note that the event listener is called repetitively when the key is held down.
I am so stupid. Thank you again. But, I am close to giving up. Even after I corrected all of this, it still won't function properly.
Just to make sure I have understood keyboard events, I created a very small flash file with 4 colored boxes. The arrow keys on the keyboard should move the red box around the screen.