Light Yagmi
Light Yagmi

Reputation: 5235

get string of variable name in ActionScript?

Does anyone know some ActionScript api to get String of a variable name like following:

var foo:int;
var variableName:String = getName(foo);
trace(variableName);

The console need to show "foo" as the result of trace(variableName);

Upvotes: 1

Views: 3302

Answers (1)

Michael
Michael

Reputation: 3871

What are you trying to achieve with this?

flash.utils.describeType can help find the name/types of any variables of an object but I don't think it will give you the instance name. I believe most of that information is lost when you compile the code so getting it at runtime will be rather difficult.

Upvotes: 2

Related Questions