0 Replies Latest reply on Oct 17, 2008 12:53 PM by tphilp74

    Menu nav between DataGrids

    tphilp74
      Does anyone know how to go about setting up a Menu button to navigate between a series of TabNavigators, without putting them into a ViewStack? I have a series of Custom Components I want to navigate between on a Main Application. The problem is, I'll end up having well over 200 Custom Components to navigate between.

      I'm developing an App that requires a user to select from a Menu button, then from there the user will select which TabNavigator to go to.

      Thanks in Advance

      <?xml version="1.0"?>
      <!-- Simple example to demonstrate the MenuBar control. -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" historyManagementEnabled="false" creationComplete="initCollections();" themeColor="#99BCCF" borderColor="#99BCCF" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #99BCCF]" xmlns:ns1="AssetManagement.Forms.*">

      <mx:Script>
      <![CDATA[

      import mx.events.MenuEvent;
      import mx.controls.Alert;
      import mx.collections.*;

      [Bindable]
      public var menuBarCollection:XMLListCollection;

      private var menubarXML:XMLList =
      <>
      <menuitem label="Menu" data="center">
      <menuitem label="Asset Management System" data="center">
      <menuitem label="Add Assets" type="radio" groupName="one" data="AM"/>
      <menuitem label="Mass Update Assets" type="radio" groupName="one" data="AM"/>
      <menuitem label="Modify Asset Codes" type="radio" groupName="one" data="AM"/>
      <menuitem label="Modify Asset Codes (County Only)" type="radio" groupName="one" data={"AM_frm_ModifyAssetCodesCounty.mxml"}/>
      <menuitem label="Modify Assets" type="radio" groupName="one" data={"AM_frm_ModifyAssets.mxml"}/>
      <menuitem label="View Asset Codes" type="radio" groupName="one" data="AM"/>
      <menuitem label="View Asset Codes (County Only)" type="radio" groupName="one" data="AM"/>
      <menuitem label="View Assets" type="radio" groupName="one" data="AM"/>
      </menuitem>
      </menuitem>
      </>;

      // Event handler to initialize the MenuBar control.
      private function initCollections():void
      {
      menuBarCollection = new XMLListCollection(menubarXML);
      }

      // Event handler for the MenuBar control's itemClick event.
      private function menuHandler(event:MenuEvent):void
      {
      // Don't open the Alert for a menu bar item that
      // opens a popup submenu.
      if (event.item.@data != "top") {
      Alert.show("Label: " + event.item.@label + "\n" +
      "Data: " + event.item.@data, "Clicked menu item");
      }
      }
      ]]>
      </mx:Script>

      <mx:XML id="myMenuData">
      </mx:XML>
      <mx:Canvas width="804" height="551" borderColor="#c0c0c0" cornerRadius="0" borderStyle="outset" id="cvMain" alpha="1" backgroundAlpha="0" backgroundColor="#99BCCF">
      <mx:MenuBar labelField="@label" itemClick="menuHandler(event);"
      dataProvider="{menuBarCollection}" x="10" y="10" cornerRadius="5" width="73" textAlign="left" fontWeight="bold" fontFamily="Arial" color="#000000" fontSize="10" alpha="1.0" height="22"/>

      <!--<mx:Fade id="myFade" duration="5000"/> -->

      <!--<mx:Image creationCompleteEffect="" -->

      <mx:Image creationCompleteEffect="{myFade}" source="GalaxyII.jpg" x="730" y="10"/>

      <mx:Label x="91" y="10" width="618" height="32" fontWeight="bold" fontFamily="Arial" fontSize="22" alpha="0.0" textDecoration="none" textAlign="left" fontStyle="italic" color="#000000"/>
      <ns1:AM_frm_ModifyAssets x="5" y="32">
      </ns1:AM_frm_ModifyAssets>

      </mx:Canvas>
      <mx:Fade id="myFade" duration="5000"/>
      </mx:Application>