RE: [flexcoders] Dynamic create child in Flex1.5

2006-04-22 Thread Matt Chotin



We have mx.utils.ClassUtil.findClass which takes a string and will
return the class instance.  You still need to make sure that your custom
class gets linked into the SWF though by making sure there's a typed
reference to it somewhere.

Matt

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sinacapho
Sent: Thursday, April 20, 2006 11:25 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Dynamic create child in Flex1.5

Dear all,
 
i have a container that i need to create different custom component on
it. I find that the function createChild() only accept hard code
component. For example createChild(Button,undefined);

Does it have some method that can run like this?

var c_component = "Button";  // Actually it may be my custom component.

XX.createChild(c_component,undefined);

thx
capho






--
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



 








--
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" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  












RE: [flexcoders] Dynamic create child in Flex1.5

2006-04-21 Thread Karl Johnson



The createChild method is able to create any type of component. I use it
to create custom components and controls and runtime all the time.

What is the error you are seeing? If you have your component in a
package (like net.xyz.me.componentClass) make sure to specify the full
class path (unless you have imported it).

Container.createChild(net.myCompany.myButtonComponent, undefined);

|<

Karl Johnson
Cynergy Systems, Inc.
http://www.cynergysystems.com 

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sinacapho
Sent: Friday, April 21, 2006 2:25 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Dynamic create child in Flex1.5

Dear all,
 
i have a container that i need to create different custom component on
it. I find that the function createChild() only accept hard code
component. For example createChild(Button,undefined);

Does it have some method that can run like this?

var c_component = "Button";  // Actually it may be my custom component.

XX.createChild(c_component,undefined);

thx
capho






--
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



 








--
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" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  











[flexcoders] Dynamic create child in Flex1.5

2006-04-21 Thread sinacapho



Dear all,
 
i have a container that i need to create different custom component on
it. I find that the function createChild() only accept hard code
component. For example createChild(Button,undefined);

Does it have some method that can run like this?

var c_component = "Button";  // Actually it may be my custom component.

XX.createChild(c_component,undefined);

thx
capho










--
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" on the web. 
   To unsubscribe from this group, send an email to: [EMAIL PROTECTED] 
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.