I would like to know if its possible, to use a string in order to create a UI element.
I think many people have this kind of problem, they want an easy setup in flash to generate a dynamic UI, through code.
It should look like this (pseudo code):
addToStage("Button","add");
addToStage("TextInput","name");
private function addToStage ( o : Object, str : String ) : void {
var myItem : o = new o();
addchild ( myItem );
}
Of course, the above sample does not work, but is there a possibility to implement that kind of behavior?
You could do that using the function
getDefinitionByName, something like: