My Script:
var stagex:Number = 550;
var stagey:Number = 400;
stage.focus = stage;
addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
//Listeners
var key:Number;
//variables
function onKeyDown(event:KeyboardEvent):void{
key = event.charCode;
ascii_box.text = "Key down:"+key;
if(key == 97){
this.player.x -=5;
}
if(key == 100){
this.player.x += 5;
}
if(key == 119){
this.player.y -= 5;
}
if(key == 115){
this.player.y += 5;
}
}
The swf with the text box.
The swf without the text box
Both codes are the same except for the one without the text box has
ascii_box.text = "Key down:"+key;remed out.
Halp Please