0 Replies Latest reply on Oct 31, 2011 5:52 PM by miquael

    how to instantiate an mxml file from another mxml file?

    miquael Level 1

      i'm well versed in ActionScript, tho not so familar with MXML.  I'm working with adapting some legacy code.  I have an MXML file with ActionScript that I have created, and need to "call" another MXML file from within it.  how?

       

      This is a snippet (header) from the MXML file I need to access:

      <?xml version="1.0" encoding="utf-8"?>

      <modules:RworldModule xmlns:modules="modules.*" xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" xmlns:components="components.*" xmlns:shop="modules.shop.*" notifyServer="shop" xmlns:base="com.rworld.base.*" xmlns:code="http://code.google.com/p/flexlib/">

        <!--modules:states>

                          <mx:State name="superBuilder">

                                    <mx:SetProperty target="{labelBecomeSuper}" name="text" value="BUY&#xa;SUPERSHILLS"/>

                          </mx:State>

                </modules:states-->

        <mx:Style source="css/shop.css" />

       

        <mx:Metadata>

        [ResourceBundle("shop")]

        [ResourceBundle("paths")]

        [ResourceBundle("economy")]

        </mx:Metadata>

       

        <components:RworldWindow id="wnd1" styleName="splitView" layout="absolute" width="630" height="540" title="Shop" close="dispatchEvent(new Event(Event.CLOSE))">

        <shop:PreviewBox id="thePreview" right="5" width="215" bottom="81" top="5">

       

        </shop:PreviewBox>

       

        <mx:VBox width="345" height="100%" left="8" horizontalAlign="center">

        <mx:Label text="{resourceManager.getString('shop', 'checkItem')}" width="100%" textAlign="center"/>

        <mx:TileList useRollOver="false" borderStyle="none" horizontalScrollPolicy="on"

                                               itemRenderer="modules.shop.ShopListItem" updateComplete="modifyScrollBar(tlist)" width="100%" height="380" itemClick="onItemClick(event)" itemDoubleClick="buySelected()" backgroundAlpha="0" direction="vertical" rowCount="2" columnCount="3" id="tlist">

        <mx:dataProvider>

        <mx:ArrayCollection source="{ShopModel.getInstance().selectedShop.itemsList}"/>

        </mx:dataProvider>

        </mx:TileList>

        </mx:VBox>

       

       

      Is this MXML a component that I can instantiate?