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.component.toString();
myComponent = new cType();
You can make things a bit easier. Use ApplicationDomain's
getDefinition() function. You can pass it the name of the class
(eg, "Label") and it will return the class definition, then you can
use the new operator to make an instance. You just need to link in
all of the classes you expect to use.