Nie wiem czemu to nie działa, pisze:
Scene 1, Layer 'menu script', Frame 1, Line 1562, Column 16 1119: Access of possibly undefined property keyCode through a reference with static type Function.
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyEvent);
function keyEvent(e:KeyboardEvent):void{
if (keyEvent.keyCode == 81) {
if (health > maxhealth) {
health = health;
}
if (health < maxhealth && mana > 19) {
health += 20;
mana -= 20;
}
}
}