In ActionScript3, how do you get a reference to an object’s class?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
constructorproperty if your object has been created from a class (from the docs: ‘If an object is an instance of a class, the constructor property holds a reference to the class object. If an object is created with a constructor function, the constructor property holds a reference to the constructor function.’):Or you can use
flash.utils.getQualifiedClassName()andflash.utils.getDefinitionByName()(not a very nice way since this entails unnecessary string manipulation in the implementations of these library functions):