0 Replies Latest reply on Jul 13, 2008 1:51 PM by bagofbeans04

    Dynamic Cast

      I am tring to find out if there is a way to cast an instance to its' original class without knowing its' original class until runtime


      var person:Object = new Person() as Object;

      var classInfo:Object = describeType(person);
      var classReference:Class = Class(getDefinitionByName(classInfo.@name));

      var company:Company = new Company();
      company.addPerson(person as classReference);