get string representation of a variable name in as3

后端 未结 4 1580
日久生厌
日久生厌 2020-12-22 10:52

any way of doing this is as3?

for example, if I have a var dog:String, how can I get \"dog\" out of that variable?

Looking into reflection to d

4条回答
  •  一个人的身影
    2020-12-22 11:32

    • First of all if it's an instance of a custom class, you can override the toString() method.

    • If it's a property of the class, you can use this method — https://stackoverflow.com/posts/3781635/revisions

    • If it's a local variable, there is no way to get that name.

提交回复
热议问题