Sorry a bit too terse, maybe. Here is a little more detail. import myPackage.MyLayout001;
var layout: MyLayout001 = new MyLayout001() layout.myProperty = myValue; MyContainer.addChild(layout); Another approach would be to have a custom component that contains your layouts in a ViewStack, and then use mx:Repeater to instantiate the components, setting the ViewStack.selectedIndex to display the appropriate component. Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Monday, August 25, 2008 11:57 AM To: [email protected] Subject: RE: [flexcoders] How to Create an object of Custom component dynamically / at Runtime / on-fly Container.addChild() Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of morpankhy Sent: Monday, August 25, 2008 9:14 AM To: [email protected] Subject: [flexcoders] How to Create an object of Custom component dynamically / at Runtime / on-fly I have some custom components. I want to make their objects at runtime. How to do that in flex ? Exa. MyLayout001.mxml, MyLayout002.mxml, MyLayout003.mxml, MyLayout004.mxml and MyLayout005.mxml and so on. ( lots of custom classes I have ) Now on click of a button ( as per users' choice ) I want to create the corresponding object of above components How to do that >?

