SOLVED! We tried this before, but the application thrown an error like: Undefined class That occurred because the class, actually, was not compiled because the class was never referenced.
So, I registered an alias for the class(then, I got a reference to that class), for it to be compiled with the program. Then I was able to refer to that class with getClassByAlias() Thanks! On Fri, Oct 30, 2009 at 7:35 AM, FlexiSush <[email protected]> wrote: > > Hi, > try the below code to create object based on class name. > > public var cls:Class = getDefinitionByName("MyClass") as Class; > > In this example MyClas is the name of the class. Hope this helps u. > > On Oct 30, 12:35 am, "Brolesi, Fogliarini" <[email protected]> wrote: > > Hi people. > > I'm trying to create an object at runtime, just passing the classname > > as a parameter I already tried that with a standard Flex Component and > > it worked very well. BUT, when I try to do this with one of my > > components, an error occurs: ReferenceError: Error #1065: Variable > > [myComponentClassName] is not defined. Thanks. > > -- > > > > Fabio Fogliarini Brolesihttp://fabio.freesandbox.net/ > > > > "Se eu tenho uma maçã e você tem uma maçã, e nós as trocarmos, cada um > > continua com uma maçã. Se eu tenho uma idéia e você tem uma idéia, e > > nós as trocarmos, cada um fica com duas idéias." > > George Bernard Shaw - Dramatrugo Irlandês > > > > -- Endel Guimarães Silva Eccen - Excelência em Tecnologia Fone +55 19 3231-2988 - Fax + 55 19 3231-2914 [email protected] www.eccen.com.br --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

