Get The Class Of An Object In AS3

      No Comments on Get The Class Of An Object In AS3

If you used to work with reflection in other languages like c# or java, you know that getting the object type might be useful. In addition with the operators “is” and “as” that are used to check if an object is a of a specific class or to cast it to a specific class there are 2 useful functions that will give us the class of a specific object. The first function getQualifiedClassName located in flash.utils. will return the class name as a string. The second function located in the same package, getDefinitionByName will return the Class object based on the string returned by the first function:

Then if you want to see if 2 objects are of the same class:

Leave a Reply

Your email address will not be published. Required fields are marked *