Hi,

If your component class extends from mx.core.View or any of its
subclasses (container class) like Box, HBox, VBox etc, your component
would have this method automatically.



Following is custom mxml component, which extends form Hbox and you can
call createChild(..) on its intstances. For example, see the code below.

1) ##HBoxEx.mxml##

<mx:Hbox xmlns:mx="http://www.macromedia.com/2003/mxml";>

        //your code

</mx:HBox>


2) ##testHBoxEx.mxml##

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
xmlns="*">
        <mx:Script>
                function onHBoxInit()
                {
                        _hb.createChild(mx.controls.Label, "",
{text:"Hello World!"});
                }
        </mx:Script>
        <local:HBoxEx id="_hb" />
</mx:Application>


Hope that helps..

-abdul


-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of m00n_de
Sent: Friday, June 17, 2005 5:14 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] createChild with custom components

hi there, a rookie needs some help ;)

My Goal is to create custom Components dynamicly. Its no problem to
generate components with createChild(), but i dont know how to adress
custom components and what has to be imported in actionscript first.

tnx for your help..





 
Yahoo! Groups Links



 




 
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