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

2006-04-25 Thread sinacapho



Dear all,

 that mean can i do at this way?

var component_name = My_Component;

My_VBox.createChild(mx.utils.ClassUtil.findClass(component_name),undefined);


But i fail in using this method_ . can someone help me?

thx
capho

--- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote:

 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.



  











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

2006-04-25 Thread bhaq1972



dont forget your component_name has to be the full name, including 
the folder structure. eg if My_Components sits in a folder called 
MyComponents then your full name is MyComponents.My_Component

--- In flexcoders@yahoogroups.com, sinacapho [EMAIL PROTECTED] wrote:

 Dear all,
 
 that mean can i do at this way?
 
 var component_name = My_Component;
 
 My_VBox.createChild(mx.utils.ClassUtil.findClass
(component_name),undefined);
 
 
 But i fail in using this method_ . can someone help me?
 
 thx
 capho
 
 --- In flexcoders@yahoogroups.com, Matt Chotin mchotin@ wrote:
 
  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.