1 Reply Latest reply on Jul 30, 2007 10:18 AM by AndyWW

    analogy to java's Object.getClass()

      is there an analogy to java's Object.getClass() where i can determine the class of something which i only have a reference typed as an Object?
        • 1. Re: analogy to java's Object.getClass()
          Are you looking for something like the mx.utils.ObjectUtils.getClassInfo() function? It looks as though you could do something like:
          var o: Object = ObjectUtils.getClassInfo(myObject);
          You could then look at the class name using the "name" property. If you want the actual class of the object then I cannot help. I have tried to find this same information to no avail. There is, of course, a Class class, and it is possible to create instances of that class, and even to use instances of that class to instantiate instances of other classes. But I haven't figured out how to use the equivalent of Java's reflection capabilities in AS (if it is even possible).