2 Replies Latest reply on May 25, 2007 4:03 PM by peterent

    Dynamically creating a component

    jlingwai Level 1
      Hey,

      Does anybody know how to accomplish the following task:
      I'm getting a name of a component as a string from and XML. for example 'Label' or 'Textbox'. I then want to create an instance of that component. as the following shows
      var cType:String = data[0].component.toString();
      var myComponent:*;
      myComponent = new cType();

      Any ideas?

      Thanks
      Josh