1 Reply Latest reply on Apr 20, 2006 1:58 AM by log2e

    dynamic creation of classes

    bhu vidya Level 1
      hi there

      i was wondering if it was possible to create an instance of a class (AS 2.0) at runtime, given just a string value for the class name

      eg, my first attempt was something like

      var class_str:String = "MyClass1";
      var inst bject = new eval(class_str)();

      now, "eval(class_str)" returns an object of type "function", ie the function reference to the class constructor, and so all i get is a new "function object"

      any clues, or am i p***ing in the wind?

      tia
      bhu