1 Reply Latest reply on Mar 16, 2011 11:14 AM by paulhart83

    Adding MXML instance as child of element using actionscript

    paulhart83

      Hello:

       

      I have been searching around and it's hard to find details on how to add an instance of an MXML file as a child of a element such as a VGroup or even a ViewStack?

       

      So lets assume I have a file called row.mxml and I am working in a file called table.mxml and it has a VGroup tag with id "table".

       

      With embeded actionscript I would like to add instances of row.mxml to the VGroup "table"

       

      @START CODE

       

      <fx:Script>
              <![CDATA[

       

                     import views.*;

       

       

                     private function addRow():void {

       

                          var row:row = new row();

                          table.addChild(row);

       

                     }

       

           ]]>
      </fx:Script>

       

      <s:VGroup width="100%" height="100%" id="table" />

       

      @END CODE

       

      I've done this sort of thing using inflate in the Android Java SDK. Is this possible in flash?

       

      I'd prefer to have action script drive my app rather than the views, is essentally what I am going for. I dont like embeding action script into views, I'd rather just load / populate the display with AS.