I have a menu with XML dataprovider in which each node contains value panelClass

<node label="MyPanel" panelClass="com.test.panelTest"/>

panelClass contains a full class name of my panel components which I want to 
display on node double click event.

The problem is how to create class instance from string definition name.

I used something like this:

registerClassAlias( e.panelClassName, Class);
var ClassReference:Class = getQualifiedClassName(e.panelClassName) as Class;
var instance:Panel = new ClassReference();
....

e is event dispatched from MenuPanel component and it contains member value 
panelClassName with component class name.

By using this code I need to have already created object with panelClassName 
name. That doesn't help me because I have around 40 panel components and it 
would be very annoying to have 40 object just waiting to be initialized.

Anyone has some suggestions?

Cheers,
Ivan

P.S. Pardon me, this is my first post on the group and I would like to say - Hi 
everyone :)

Reply via email to