Use the Class datatype, like this:
var myClass:Class = flash.util.getClassByName("mycomponents.myPanel");

Take a look at addChild() method definition, it should now accept a Class argument instead of a string.

Marcelo.




On 8/19/06, jgraham_us < [EMAIL PROTECTED]> wrote:








I have some calls in my code where I am creating some UI instances
dynamically based off a class name stored in a string. The class
names have to be strings because they are loaded from a Database.
The example below is for simplicity.
Example.

Flex 1.5 code :

var myClassString : String = "mycomponents.myPanel";
var x : Object = myContainer.createChild( myClassString,undefined );

How can I accomplish this in Flex 2.0?

I assume there is a way to do something like reflection in java, but I
haven't found it.

Thanks


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to