2 Replies Latest reply on Mar 3, 2010 10:30 AM by akash87

    MENUBAR!! Simple Problem, but a huge pain, HELP!

    akash87

      I need major help! im not able to get a simple menu bar into my application.

       

       

      <mx:MenuBar id="mainMenu" x="0" y="0" width="100%" top="0" height="27" labelField="@label" itemClick="mainMenuItemClick(event);">

           <fx:XMLList>

                <MenuItem label="mainM">

                     <SubMenuItem label="A" data="robin" enabled="true"/>

                     <SubMenuItem label="B" data="batman" enabled="true"/>

                </MenuItem>

           </fx:XMLList>

      </mx:MenuBar>

       

       

       

      protected function mainMenuItemClick(event:MenuEvent):void

      {

           trace(event.label);

      }

       

       

      ----------Reading the code, we see that it is real simple code!

      But i dont understand why im not able to see the text of the label in the app...

      heres a pic of how it looks....<i've blurred out the text of the header>

      pic.jpg

      Plz help me out with this, it is killing me...

        • 1. Re: MENUBAR!! Simple Problem, but a huge pain, HELP!
          John Hall Level 4

          Works fine for me. Now I'm using a nightly build so my mx namespace is mx instead of halo (in case you're using halo) but this runs

          for me:

           

          <?xml version="1.0" encoding="utf-8"?>
          <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                 xmlns:s="library://ns.adobe.com/flex/spark"
                                 xmlns:mx="library://ns.adobe.com/flex/mx">
              <fx:Declarations>
                  <!-- Place non-visual elements (e.g., services, value objects) here -->
              </fx:Declarations>

           

              <mx:MenuBar id="mainMenu"
                          x="0"
                          y="0"
                          width="100%"
                          top="0"
                          height="27"
                          labelField="@label"
                          itemClick="mainMenuItemClick(event);">
                  <fx:XMLList>
                      <MenuItem label="mainM">
                          <SubMenuItem label="A"
                                       data="robin"
                                       enabled="true"/>
                          <SubMenuItem label="B"
                                       data="batman"
                                       enabled="true"/>
                      </MenuItem>
                  </fx:XMLList>
              </mx:MenuBar>

           

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

           

                      protected function mainMenuItemClick(event:MenuEvent):void {
                          trace(event.label);
                      }
                  ]]>
              </fx:Script>

           


          </s:WindowedApplication>

          1 person found this helpful
          • 2. Re: MENUBAR!! Simple Problem, but a huge pain, HELP!
            akash87 Level 1

            Thanks for the answer, but it did not solve my problem...it just did not work.... :S

            and no im not using any nightly build, and yea i was using halo ns, but when i tried urs, it dint work too...im using flash player version 10.1.5, and AIR 1.5....well i tried it with 10.0.45.2 and it still dint work...