1 Reply Latest reply on Jun 17, 2009 9:33 AM by joan_lafferty

    Spark MenuBar roll over problem

    ogunduz

      After you click on a MenuBar element, its rollover event no longer works.

       

      Try this:

      <?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/halo"
          initialize="initCollections();"
          >
          <fx:Script>
              <![CDATA[
         
                  import mx.collections.*;
                  import mx.controls.Alert;
                  import mx.events.MenuEvent;

       

                  [Bindable]
                  public var menuBarCollection:XMLListCollection;
                 
                  private var menubarXML:XMLList =
                      <>
                          <menuitem label="File" data="top">
                              <menuitem label="Load.." data="load"/>

       

                          </menuitem>

       

                      </>;
                     
                  private function initCollections():void {
                      menuBarCollection = new XMLListCollection(menubarXML);
                  }

       

                 
                  private function menuHandler(evt:MenuEvent):void  {
                     
                      var s:String = evt.item.@data;
                      if (evt.item.@data != "top") {
                          Alert.show('ok');
                          }
                      }
                  }

       

              ]]>
          </fx:Script>

       

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

       

      </s:WindowedApplication>

       

      Click on File > Load, and an alert will show up. Close it and go back to File > Load. "Load" item's rollover is gone

        • 1. Re: Spark MenuBar roll over problem
          joan_lafferty Adobe Employee

          This is a bug that has been around in MenuBar for a while.Its not new to our Flex 4 beta. If you had multiple items in your submenu, the rollOver would return after you rolled over another item. Here is the bug that someone filed a while back. Someone also recommended a workaround:

           

          https://bugs.adobe.com/jira/browse/SDK-13016

           

          The bug is in deferred status because it didn't seem that terrible and we didn't have time to fix it. A contribution from the community to fix it would be great though! Feel free to vote on the bug or leave your comments as to why you'd like to see it fixed.

           

          Thanks,

          Joan Lafferty

          Flex SDK QA