I don't know if you're using import statements, but those might help if
you're not:
 
 
import com.datasul.framework.custom.view.LoanForm;
import Workspace;
 

var workspace:Workspace = Workspace.getInstance(); //Do you mean 'new
Workspace ();' ?
workspace.createChild(LoanForm,"instanceName", {attr: value, attr2:
value2...);

Does this help?

Joey



________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Michel Bertrand
Sent: Thursday, September 15, 2005 4:26 PM
To: flexcoders@yahoogroups.com
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 



________________________________

YAHOO! GROUPS LINKS 


        *        Visit your group "flexcoders
<http://groups.yahoo.com/group/flexcoders> " on the web.
          
*        To unsubscribe from this group, send an email to:
         [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
          
*        Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> . 


________________________________




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to