How do I get from an instance of a class to a Class object in ActionScript 3?

后端 未结 3 1767
感情败类
感情败类 2021-01-30 08:39

How do you get an instance of the actionscript class Class from an instance of that class?

In Python, this would be x.__class__; in Java,

3条回答
  •  轮回少年
    2021-01-30 09:13

    You can get it through the 'constructor' property of the base Object class. i.e.:

    var myClass:Class = Object(myObj).constructor;
    

提交回复
热议问题