9 Replies Latest reply on Mar 10, 2008 2:06 PM by ntsiii

    Menubar and Viewstack control

    rubeel
      I am trying to control a viewstack with Menubar but seem to get 1034 errors. Any guidance at this point will be great :).

      either i am gone blind or the Attach Code button is missing, attaching the code below.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute"
      xmlns:v="views.*" creationComplete="initCollections();">

      <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="Home" eventName="Home"/>
      <menuitem label="View">
      <menuitem label="Servers" eventName="ViewServerInfo" />
      <menuitem label="Customer Info" eventName="viewCustomersInfo" />
      <menuitem label="System Administrator" eventName="viewSystemAdmins" />
      <menuitem label="Server Attributes" eventName="viewServerAttributes" />
      <menuitem label="Services" eventName="viewServices" />
      <menuitem label="Application Admins" eventName="viewAppAdmins" />
      </menuitem>
      <menuitem label="Edit">
      <menuitem label="Servers" eventName="editServers" />
      <menuitem label="Customer Info" eventName="editCustomersInfo" />
      <menuitem label="System Administrator" eventName="editSystemAdmins" />
      <menuitem label="Server Attributes" eventName="editServerAttributes" />
      <menuitem label="Services" eventName="editServices" />
      <menuitem label="Application Admins" eventName="editAppAdmins" />
      </menuitem>
      <menuitem label="Add New">
      <menuitem label="Servers" eventName="AddNewServers" />
      <menuitem label="Customer Info" eventName="AddNew" />
      <menuitem label="System Administrator" eventName="AddNew" />
      <menuitem label="Server Attributes" eventName="AddNew" />
      <menuitem label="Services" eventName="AddNew" />
      <menuitem label="Application Admins" eventName="AddNew" />
      </menuitem>
      <menuitem label="Charts and Graphs">
      <menuitem label="Servers" eventName="ServerCharts" />
      </menuitem>
      <menuitem label="About" data="about"/>
      </>

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

      // Event handler for the MenuBar control's change event.
      private function clickHandler(event:MenuEvent):void {
      ServerAppContent.selectedChild=(event.item.@eventName);

      }


      ]]>
      </mx:Script>


      <mx:MenuBar labelField="@label" x="50" y="10"
      dataProvider="{menuBarCollection}"
      itemClick="clickHandler(event);"/>


      <mx:ViewStack id="ServerAppContent"
      x="101" y="190"
      paddingBottom="0"
      paddingLeft="0"
      paddingRight="0"
      paddingTop="0"
      resizeToContent="true">
      <v:Home id="Home" label="Home"/>
      <v:ViewServerInfo id="ViewServerInfo" label="View Server Info"/>
      <v:AddNewForm id="AddNewServers" label="Add New Server" />
      <v:Charts id="ServerCharts" label="Graphs and Charts"/>
      <v:viewAdmins id="viewAppAdmins" label="View Application Admins"/>
      <v:CustomerInfo id="viewCustomersInfo" label="View Customer Info"/>
      <v:viewTechs id="viewSystemAdmins" label="View Techs"/>
      <v:viewServices id="viewServices" label="View Services"/>
      <v:viewServerAtt id="viewServerAttributes" label="View Server Atributes"/>
      </mx:ViewStack>


      </mx:Application>
        • 1. Re: Menubar and Viewstack control
          jooeee
          Hi

          I don't profess to be an expert as I just started learning Flex. Regarding your immediate problem, I don't have a specific answer to it. When I was having problems, some folks on this forum, suggesed that I use the Flex "Help"
          assist to find my answers. I was a little miffed at first and thought they were being dismissive. After using it for a while I find that the "Help" assist guides me to the right solutions although I admit I hsve to struggle for a while. It has helped me learn more in two weeks than I did in the first four.

          The "Help" assist as well as the Adobe Component Explorer at URL http://examples.adobe.com/flex3/componentexplorer/explorer.html both have been helpful to me.

          I have just finished building a menu bar control. I started with the following code below from both sources mentioned and then converted it to my own application.

          Joe Kerenick

          EXAMPLES

          From Adobe Component Explorer Example

          <?xml version="1.0"?>
          <!-- Simple example to demonstrate the MenuBar control. -->
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="initCollections();" >

          <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="Menu1" data="top">
          <menuitem label="MenuItem 1-A" data="1A"/>
          <menuitem label="MenuItem 1-B" data="1B"/>
          </menuitem>
          <menuitem label="Menu2" data="top">
          <menuitem label="MenuItem 2-A" type="check" data="2A"/>
          <menuitem type="separator"/>
          <menuitem label="MenuItem 2-B" >
          <menuitem label="SubMenuItem 3-A" type="radio"
          groupName="one" data="3A"/>
          <menuitem label="SubMenuItem 3-B" type="radio"
          groupName="one" data="3B"/>
          </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:Panel title="MenuBar Control Example" height="75%" width="75%"
          paddingTop="10" paddingLeft="10">

          <mx:Label width="100%" color="blue"
          text="Select a menu item."/>

          <mx:MenuBar labelField="@label" itemClick="menuHandler(event);"
          dataProvider="{menuBarCollection}" />

          </mx:Panel>
          </mx:Application>


          From Flex Help
          <?xml version="1.0"?>
          <!-- menus/MenuBarControl.mxml -->
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" >

          <!-- Define the menu; dataProvider is the default MenuBar property.
          Because this uses an XML data provider, specify the labelField and
          showRoot properties. -->
          <mx:MenuBar id="myMenuBar" labelField="@label">
          <mx:XMLList>
          <menuitem label="MenuItem A">
          <menuitem label="SubMenuItem A-1" enabled="false"/>
          <menuitem label="SubMenuItem A-2"/>
          </menuitem>
          <menuitem label="MenuItem B"/>
          <menuitem label="MenuItem C"/>
          <menuitem label="MenuItem D">
          <menuitem label="SubMenuItem D-1"
          type="radio" groupName="one"/>
          <menuitem label="SubMenuItem D-2"
          type="radio" groupName="one"
          selected="true"/>
          <menuitem label="SubMenuItem D-3"
          type="radio" groupName="one"/>
          </menuitem>
          </mx:XMLList>
          </mx:MenuBar>
          </mx:Application
          • 2. Re: Menubar and Viewstack control
            rubeel Level 1
            I did use the examples but the examples dont talk about the controlling. i would have not posted here if i was not stuck badly, i would really like any help as i have been sitting on this problem for a week and am brain dead now :(
            • 3. Re: Menubar and Viewstack control
              jooeee Level 1
              Hi again

              I have copied your code into Flex 3 tonight. I will look over the code tomorrow sometime and see if I can determine anything that needs fixing. Can't promise anything but it will help me learn something.

              Joe
              • 4. Re: Menubar and Viewstack control
                jooeee Level 1
                HI again,

                I am going to look at your application this afternoon. In the meantime, I am going to copy the code of an application in which I used a ViewStack with Menu Bar Control. It works well for me. While you are waiting, you may want to look it over to see how it compares to what you want to do and your own application.mxml by the way, you aren't going crazy regarding the "Attach Code" Button. It is not here. Somehow Adobe removed it or revised the forum and didn't include it in the revision. I think they plan to put it in the future sometime.

                This system limits the amount of text I can "reply" with so I will break up the application code and send it in subsequent reply messages. Or you can email me direct so I can have your email address and I can send you the file that way.

                Application I willsopied below is developed in Flex 3.

                Back to you later.

                Joe


                • 5. Re: Menubar and Viewstack control
                  jooeee Level 1
                  <?xml version="1.0" encoding="utf-8"?>
                  <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute"
                  backgroundColor="#eeeeee" horizontalAlign="center" width="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">

                  <mx:Style>
                  Label {
                  fontSize:18;
                  color:#c30c30;

                  }
                  </mx:Style>

                  <mx:Style>

                  Menu {
                  color:#000000;

                  }

                  </mx:Style>




                  <mx:Script>
                  <![CDATA[
                  import mx.events.MenuEvent;
                  import mx.core.Container;

                  private function menuClickHandler(event:MenuEvent):void
                  {
                  var viewString:String = event.item.@view;
                  vStack.selectedChild=this[viewString];
                  }
                  ]]>
                  </mx:Script>
                  <!-- This is the start of the XML List for the Menu Bar -->

                  <mx:XMLList id="menuData" >

                  <menu label="Home">
                  <menu label="Home" view="viewHomeAboutUs" />
                  </menu>




                  <menu label="Theatre">
                  <menu label="About Us" view="viewTheatreAboutUs"/>
                  <menu label="Awards" view="viewTheatreAwards"/>
                  <menu label="Photos" view="viewTheatrePhotos"/>
                  <menu label="Video" view="viewTheatreVideo"/>
                  </menu>

                  <menu label="Visual Arts">
                  <menu label="About Us" view="viewVAAboutUs"/>
                  <menu label="Awards" view="viewVAAwards"/>
                  <menu label="Photos" view="viewVAPhotos"/>
                  <menu label="Video" view="viewVAVideo"/>
                  </menu>

                  <menu label="Literary Arts">
                  <menu label="About Us" view="viewLAAboutUs"/>
                  <menu label="Awards" view="viewLAAwards"/>
                  <menu label="Photos" view="viewLAPhotos"/>
                  <menu label="Video" view="viewLAVideo"/>
                  </menu>

                  <menu label="Dance">
                  <menu label="About Us" view="viewDanceAboutUs"/>
                  <menu label="Awards" view="viewDanceAwards"/>
                  <menu label="Photos" view="viewDancePhotos"/>
                  <menu label="Video" view="viewDanceVideo"/>
                  </menu>

                  <menu label="Strings">
                  <menu label="About Us" view="viewStringsAboutUs"/>
                  <menu label="Awards" view="viewStringsAwards"/>
                  <menu label="Photos" view="viewStringsPhotos"/>
                  <menu label="Video" view="viewStringsVideo"/>
                  </menu>

                  <menu label="Wind-Percussion">
                  <menu label="About Us" view="viewWindPercussionAboutUs"/>
                  <menu label="Awards" view="viewWindPercussionAwards"/>
                  <menu label="Photos" view="viewWindPercussionPhotos"/>
                  <menu label="Video" view="viewWindPercussionVideo"/>
                  </menu>

                  • 6. Re: Menubar and Viewstack control
                    jooeee Level 1

                    <menu label="Admission">
                    <menu label="Admission" view="viewAdmissionAboutUs"/>
                    </menu>







                    <menu label="Learn More">
                    <menu label="About Us" view="viewPCAAboutUs" fontSize="12" color="red"/>
                    <menu label="Awards" view="viewPCAAwards"/>
                    <menu label="Calendar" view="viewPCACalendar"/>
                    <menu label="Orientation Video" view="viewPCAVideo"/>
                    </menu>

                    <menu label="Faculty">
                    <menu label="Faculty" view="viewFacultyMain"/>
                    <menu label="Bios" view="viewFacultyBios"/>
                    </menu>

                    </mx:XMLList>

                    <!-- This is the start of the ViewStack for the Menu Bar -->

                    <!-- This is the start of the Theatre SubMenus for the Menu Bar -->


                    <mx:Canvas height="500" width="950" y="82" borderColor="#DBD9D9" horizontalCenter="0" horizontalScrollPolicy="off" verticalScrollPolicy="off" borderStyle="solid" borderThickness="1">


                    <mx:ViewStack id="vStack"
                    height="500" width="950" y="-2" >

                    <!-- This is the start of the Home SubMenus for the Menu Bar -->

                    <mx:VBox id="viewHomeAboutUs"
                    height="550" width="100%"
                    backgroundColor="#dddddd" horizontalAlign="center">
                    <mx:Label text="This is the PCA Home Page view" />
                    </mx:VBox>

                    <mx:VBox id="viewTheatreAboutUs"
                    height="550" width="100%" y="82" horizontalAlign="center" backgroundColor="#dddddd" >
                    <mx:Label text="This is the Theatre About Us view"/>
                    </mx:VBox>

                    <mx:VBox id="viewTheatreAwards"
                    height="550" width="100%" horizontalAlign="center" backgroundColor="#dddddd" >
                    <mx:Label text="This is the Theatre Awards View"/>
                    </mx:VBox>
                    <mx:VBox id="viewTheatrePhotos"
                    height="500" width="100%" y="82" backgroundColor="#dddddd" horizontalAlign="center">

                    <mx:Label text="This is the Theatre Photo Gallery View"/>
                    </mx:VBox>

                    <mx:VBox id="viewTheatreVideo"
                    height="500" width="100%" y="82" backgroundColor="#dddddd" horizontalAlign="center">
                    <mx:Label text="This is the Theatre Video Gallery View"/>
                    <mx:Canvas height="3%" width="100%" backgroundColor="#000000" backgroundAlpha="1.0">

                    <!-- This is the Menu Bar -->

                    </mx:Canvas>
                    </mx:VBox>

                    <!-- This is the start of the Visual Arts SubMenus for the Menu Bar -->

                    <mx:VBox id="viewVAAboutUs"
                    height="550" width="100%"
                    backgroundColor="#dddddd" horizontalAlign="center">
                    <mx:Label text="This is the Visual Arts About Us view"/>
                    </mx:VBox>

                    <mx:VBox id="viewVAAwards"
                    height="550" width="100%"
                    backgroundColor="#dddddd" horizontalAlign="center">
                    <mx:Label text="This is the Visual Arts Awards View"/>
                    </mx:VBox>

                    <mx:VBox id="viewVAPhotos"
                    height="550" width="100%"
                    backgroundColor="#cccccc" horizontalAlign="center">
                    <mx:Label text="This is the Visual Arts Photo Gallery View"/>
                    </mx:VBox>

                    <mx:VBox id="viewVAVideo"
                    height="550" width="100%"
                    backgroundColor="#dddddd" horizontalAlign="center">
                    <mx:Label text="This is the Visual Arts Video Gallery View"/>
                    </mx:VBox>
                    • 7. Re: Menubar and Viewstack control
                      jooeee Level 1
                      <!-- This is the start of the Literary Arts SubMenus for the Menu Bar -->

                      <mx:VBox id="viewLAAboutUs"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Literary Arts About Us view"/>
                      </mx:VBox>
                      <mx:VBox id="viewLAAwards"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Literary Arts Awards View"/>
                      </mx:VBox>
                      <mx:VBox id="viewLAPhotos"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Literary Arts Photo Gallery View"/>
                      </mx:VBox>

                      <!-- This is the start of the Dance SubMenus for the Menu Bar -->

                      <mx:VBox id="viewDanceAboutUs"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Dance About Us view"/>
                      </mx:VBox>
                      <mx:VBox id="viewDanceAwards"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Dance Awards View"/>
                      </mx:VBox>
                      <mx:VBox id="viewDancePhotos"
                      height="550" width="100%"
                      backgroundColor="#dddddd">
                      <mx:Label text="This is the Dance Arts Photo Gallery View"/>
                      </mx:VBox>

                      <mx:VBox id="viewDanceVideo"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Dance Video Gallery View"/>
                      </mx:VBox>

                      <!-- This is the start of the Strings SubMenus for the Menu Bar -->

                      <mx:VBox id="viewStringsAboutUs"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Strings About Us view"/>
                      </mx:VBox>
                      <mx:VBox id="viewStringsAwards"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Strings Awards View"/>
                      </mx:VBox>
                      <mx:VBox id="viewStringsPhotos"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Strings Photo Gallery View"/>
                      </mx:VBox>

                      <mx:VBox id="viewStringsVideo"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Strings Video Gallery View"/>
                      </mx:VBox>

                      <!-- This is the start of the Vocal SubMenus for the Menu Bar -->

                      <mx:VBox id="viewVocalAboutUs"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Vocal About Us view"/>
                      </mx:VBox>
                      <mx:VBox id="viewVocalAwards"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Vocal Awards View"/>
                      </mx:VBox>
                      <mx:VBox id="viewVocalPhotos"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Vocal Photo Gallery View"/>
                      </mx:VBox>

                      <mx:VBox id="viewVocalVideo"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Vocal Video Gallery View"/>
                      </mx:VBox>

                      <!-- This is the start of the Wind-Percussion SubMenus for the Menu Bar -->

                      <mx:VBox id="viewWindPercussionAboutUs"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Wind-Percussion About Us view"/>
                      </mx:VBox>
                      <mx:VBox id="viewWindPercussionAwards"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Wind-Percussion Awards View"/>
                      </mx:VBox>
                      <mx:VBox id="viewWindPercussionPhotos"
                      height="475" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Wind-Percussion Photo Gallery View"/>
                      </mx:VBox>

                      <mx:VBox id="viewWindPercussionVideo"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Wind-Percussion Video Gallery View"/>
                      </mx:VBox>

                      <!-- This is the start of the Admission SubMenus for the Menu Bar -->

                      <mx:VBox id="viewAdmissionAboutUs"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the Admissions Page view"/>
                      </mx:VBox>

                      <!-- This is the start of the Learn More SubMenus for the Menu Bar -->

                      <mx:VBox id="viewPCAAboutUs"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the PCA About Us view"/>
                      </mx:VBox>
                      <mx:VBox id="viewPCAAwards"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the PCA Awards View"/>
                      </mx:VBox>
                      <mx:VBox id="viewPCACalendar"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the PCA Calendar View"/>
                      </mx:VBox>

                      <mx:VBox id="viewPCAVideo"
                      height="550" width="100%"
                      backgroundColor="#dddddd" horizontalAlign="center">
                      <mx:Label text="This is the PCA Orientation Video View"/>
                      </mx:VBox>




                      <!-- This is the start of the Faculty SubMenus for the Menu Bar -->

                      <mx:VBox id="viewFacultyMain"
                      height="550" width="100%"
                      backgroundColor="#dddddd">
                      <mx:Label text="This is the Faculty Main view"/>
                      </mx:VBox>

                      <mx:VBox id="viewFacultyBios"
                      height="550" width="100%"
                      backgroundColor="#dddddd">
                      <mx:Label text="This is the Bios view"/>
                      </mx:VBox>

                      </mx:ViewStack>

                      </mx:Canvas>
                      <mx:Canvas y="0" width="100%" height="77" horizontalCenter="0" backgroundColor="#000000" verticalScrollPolicy="off" horizontalScrollPolicy="off">
                      <mx:HBox x="339.5" y="0" width="40%" horizontalAlign="center">
                      <mx:Image source="assets/pca-banner-2006-07.jpg" includeInLayout="true" horizontalAlign="center"/>
                      </mx:HBox>
                      <mx:MenuBar dataProvider="{menuData}"
                      labelField="@label"
                      itemClick="menuClickHandler(event)"
                      textAlign="center" borderColor="#000000" color="#FFFFFF" fillAlphas="[1.0, 1.0, 1.0, 1.0]" fillColors="[#020202, #020202]" height="5%" themeColor="#B8B5B5" alpha="0.74" y="45" horizontalCenter="0" fontWeight="bold"/>
                      </mx:Canvas>
                      <mx:Canvas y="592" width="100%" height="1%" backgroundColor="#C30C30" id="redLineBottom" horizontalCenter="0">
                      </mx:Canvas>
                      <mx:Canvas y="597" width="100%" height="69" backgroundColor="#000000" horizontalCenter="0">

                      <mx:Label text="web design/development by joekerenick" fontSize="10" color="#939191" fontWeight="normal" horizontalCenter="0" paddingTop="10
                      " y="10"/>
                      </mx:Canvas>
                      <mx:HBox x="0" y="663" width="100%" height="127" backgroundColor="#776C6C" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                      </mx:HBox>
                      <mx:HBox width="100%" horizontalAlign="center" height="1%" backgroundColor="#C30C30" id="redLineTop0" x="1" y="71">
                      </mx:HBox>




                      </mx:Application>
                      • 8. Re: Menubar and Viewstack control
                        jooeee Level 1
                        I am getting a 1046 error in the elements below. I looked up the 1046 error and said as follows.

                        1046 Type was not found or was not a compile-time constant: _. The class used as a type declaration is either unknown or is an expression that could have different values at run time. Check that you are importing the correct class and that its package location has not changed. Also, check that the package that contains the code (not the imported class) is defined correctly (for example, make sure to use proper ActionScript 3.0 package syntax, and not ActionScript 2.0 syntax). More later.

                        The error can also occur if the class being referenced is not defined in a namespace that is in use or is not defined as public:

                        public class Foo{}If you are using Flex™ Builder™ 2 and the class is in a library, make sure to set the class path for the project.

                        <v:Home id="Home" label="Home"/>

                        <v:ViewServerInfo id="ViewServerInfo" label="View Server Info"/>

                        <v:AddNewForm id="AddNewServers" label="Add New Server" />

                        <v:Charts id="ServerCharts" label="Graphs and Charts"/>

                        <v:viewAdmins id="viewAppAdmins" label="View Application Admins"/>

                        <v:CustomerInfo id="viewCustomersInfo" label="View Customer Info"/>

                        <v:viewTechs id="viewSystemAdmins" label="View Techs"/>

                        <v:viewServices id="viewServices" label="View Services"/>

                        <v:viewServerAtt id="viewServerAttributes" label="View Server Atributes"/>
                        • 9. Re: Menubar and Viewstack control
                          ntsiii Level 3
                          I believe the problem is here:
                          ServerAppContent.selectedChild=(event.item.@eventName);

                          "event.item.@eventName" returns a string, but selectedChild requires a reference to the actual ViewStackChild. Use selectedIndex instead.

                          I advise you include each fo the ViewStack's view's index in the xml data, and then do:
                          ServerAppContent.selectedIndex=(event.item.@eventIndex);

                          An alternative would be to use a switch() statement that returns the index based on lookup of the name.

                          Tracy