0 Replies Latest reply on Mar 15, 2009 10:42 PM by srirama.83

    Loading MXML Component Dynamically

    srirama.83 Level 1
      Hi all,
      I am new to Flex and was trying out small things . I created a MXML Application and also MXML components.
      I tried loading MXML component to application using xmlns and it worked fine.(
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#ffffff" xmlns:mi="com.*">
      <mi:base1 id="base1" />
      <mi:base2 id="base2" />
      )
      This method is ok if we are loading 3-4 components .
      but , if i have to load a mxml component dynamically how do I do it?
      for example ,if base1 and base2 are two components and i want to load them based on some event performed.

      I have tried the method which uses ViewStack and code myViewStack.selectedChild=Container(myViewStack.getChildByName(selectedNode)) ,where each child will have one component declared or initialized.

      Following this method is not a feasible when we have hundred of components to be loaded.
      Can anyone help me on this??