Is that a MenuBar with each of those being its own menu or is it one menu with 6 subitems?  I believe the “change” event only fires for the subitems, not if you simply click on the top-level menu entry.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of ykt_zju
Sent: Tuesday, November 15, 2005 2:39 AM
To: [email protected]
Subject: [flexcoders] why "change" event of the MenuBar is not trigger?

 

I write a MenuBar component, but the change event of the MenuBar is
not working while other event (like createComplete and rollOver) works!

I don't know what's the problem , will any one tell me why?

Thanks!

Following are pieces of related code:

code creating the menuBar
columnMenuBar=PopUpManager.createPopUp(this, ColumnMenuBar, false,
undefined, true);           
columnMenuBar.addEventListener("mouseDownOutside",mx.utils.Delegate.create(this,mouseOutsideMenuBar));

ColumnMenuBar.mxml
<mx:MenuBar xmlns:mx="http://www.macromedia.com/2003/mxml"
creationComplete="createBar()"  rollOver="rollOverMenu()"
change="columnMenuBarHandler(event)" width="100" marginLeft="0">
      <mx:Script>
            <![CDATA[

            function rollOverMenu(){
                  trace("roling over the menu");
            }
           
            function createBar(){
                  trace("!!!menubar created!");
            }
    function columnMenuBarHandler(event) {          
                  trace("change event in menubar");
    }
]]>
      </mx:Script>
      <mx:dataProvider>
      <mx:XML>
            <menuitem label="COLUMN UTILITIES">
                  <menuitem label="Insert Column" data="" />
                  <menuitem label="Expand Extract Column" data="" />           
                  <menuitem label="Remove Column" data="" />
                  <menuitem type="separator" />
                  <menuitem label="Sort by Ascending" data="" />
                  <menuitem label="Sort by Descending" data="" />           
            </menuitem>
      </mx:XML>
      </mx:dataProvider>
</mx:MenuBar>









--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to