How do I use an unevaluated (and/or possibly undefined) variable as a parameter for a function? For example:
function myFun(a:int):void {
a = 5;
}
If you are familiar with Mathematica it would be equivalent to:
f[a_Integer]:=a=5
Attributes[f]={HoldAll};
The core idea being that it is the variable’s name itself which I want to pass to the function, not the value which is current associated with the variable’s name.
You can pass a string.
Example of use:
According to these guys: get string representation of a variable name in as3 if it’s a classe you can get it’s name. If it’s a local variable you cannot, the reason is probably related with efficience (the name gets lost on compiling phase)