Example:
public var myVar:Object;
// now I want to get the myVar string
// myVar is not instanced*
public var whatINeedIsThisVar:String = 'myVar';
thanks
Example:
public var myVar:Object;
// now I want to get the myVar string
// myVar is not instanced*
public var whatINeedIsThisVar:String = 'myVar';
thanks
There is no way to do that, and when you are working in release mode (i.e. not debuuging a swf) local variable name didn't exist anymore.
But if it's a public field name of a class you can use describeType to found the name.
package {
import flash.utils.describeType;
class Foo extends Sprite {
public var bar:Object;
function Foo(){
super();
// trace all public field name in this class
for each (variable:XML in describeType(this).variable) {
trace("field name : ", variable.@name);
}
}
}
}