For some reason, you can't use keyListener.onKeyDown = function()
in a class description (says cannot use). Why?
Also, how do i "convert" this into Class.as file usable stuff? *(for example if my class file is called 'Player.as', and it extends MovieClip. And does the extend movieclip make a difference in this problem?)
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.getCode() == 111) { // a is 65
//do something
}
};
Key.addListener(keyListener);