1

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);

3

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, mixFM. I totally agree with your answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.