Creating Classes from DataBase (xml)

Hi everyone

Short explanation:
->>>
So. I have an xml with this:

<apps>
   <app id="1" name="CustomClass01"/>
   <app id="..." name="..."/>
</apps>

These Classes are stored inside a package, lets say: “apps”.

Normally, I’d use:

import apps.*
var _app01:CustomClass01 = new CustomClass01

and there it goes.
But what to do when I don’t have control over the class name nor I can’t create dummys or instances before loading the xml?
If I have 1000 classes I can’t create cons with all those classes…

Long explanation:

I have spent all the afternoon trying to look for a solution and I’ve found very old foruns talking about the use of “getDefinitionByName”.

However it returns undefined, since the class has not instances.
There is a use including a “dummy” process, where you include the name of the Class before creating its instance.

But in my case I’m bring the Class name from an xml.
I have found also something similar at forums, but answers didn’t apply.

Can I use this structure? I’m not sure how to proceed here =/


import apps.*
var className:String = apps[id].cls; // outputs "CustomClass01". Also tried "apps.CustomClass01".
var appClass:Class = getDefinitionByName(className) as Class;
var app = new screenClass;

Thanks in advance