Title: Help to create an object instance dynamically

Hi Michel,

 

Are you referencing this class elsewhere? If not, you need to in order for flex to compile it.

 

A simple reference like:

 

com.datasul.framework.custom.view.LoanForm;

 

Might do the trick. Not sure about the rest of the code. You might want to try using eval() to get a reference to the class.

 

Jim

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Michel Bertrand
Sent: Thursday, September 15, 2005 4:26 PM
To: [email protected]
Subject: [flexcoders] Help to create an object instance dynamically

 

Hi all !

I'm trying to get a component instance using the following:

                var workspace:Workspace = Workspace.getInstance();

                var name:String = "com.datasul.framework.custom.view.LoanForm";
                var type:Function = ClassUtil.findClass(name);
               
                wkt = Workspace.getInstance();
                wkt.createChild(type,name);

Where:
- Workspace: is an object extending mx.containers.Canvas;

I suppose that retriving an Object using ClassUtil I would get an object instance. But it
doesn't work in this fashion. So, I still tried to use wkt.createChild(type.call(),name),
however no success.

Did anybody has an idea to create my object dynamically and add it to a container ?

Regards,
Michel.




--
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 Software design and development Macromedia flex
Software development best practice


YAHOO! GROUPS LINKS




Reply via email to