Is there a way to make “getDefinitionByName()” work with any Object type, I have only gotten it to work with a Class:
var test:Class = getDefinitionByName("myClass") as Class;
I need something like:
var myNumber:Number = 10;
var test:Number = getDefinitionByName("myNumber") as Number;
trace(test); //10
Or is there another method to achieve this?
You should define your key codes as public static constants in your KeyCodes class:
You can then use them as arguments to your
useKeyCodesfunction:This way you get the benefit of not having to remember every key code.