Menu labelField : Menu Event « Components « Flex






Menu labelField

Menu labelField
      
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:s="library://ns.adobe.com/flex/spark">
        <mx:XMLList id="dataProvider" xmlns="">
            <menuitem label="File">
                <menuitem label="New"/>
                <menuitem label="Open"/>
                <menuitem label="Open As"/>
                <menuitem label="Save"/>
                <menuitem label="Save As"/>
                <menuitem label="Close" enabled="false"/>
            </menuitem>
            <menuitem label="Edit"/>
            <menuitem label="Source"/>
            <menuitem label="View">
                <menuitem label="50%" type="radio" groupName="one"/>
                <menuitem label="100%" type="radio" groupName="one" selected="true"/>
                <menuitem label="150%" type="radio" groupName="one"/>
            </menuitem>
        </mx:XMLList>
    <s:VGroup>
        <mx:MenuBar labelField="@label"
                    itemClick="handleMenuClick(event)"
                    dataProvider="{dataProvider}"/>
        <mx:Label id="subItemDisplayLabel"/>
    </s:VGroup>
    <mx:Script>
        
            import mx.events.MenuEvent;

            private function handleMenuClick(evt:MenuEvent):void {
                subItemDisplayLabel.text = evt.item.@label + " was selected";
            }
      
    </mx:Script>
</mx:Application>

   
    
    
    
    
    
  








Related examples in the same category

1.Get menu label from click eventGet menu label from click event
2.Menu event indexMenu event index
3.Menu with event listenerMenu with event listener
4.change event for MenuBarchange event for MenuBar
5.itemRollOver event for MenuBaritemRollOver event for MenuBar
6.Menu item click eventMenu item click event
7.Menu show eventMenu show event
8.Menu hide eventMenu hide event
9.Menu roll out eventMenu roll out event
10.Menu Item Roll Over eventMenu Item Roll Over event
11.Show the detailed information for MenuEvent
12.Create EventHandlers for Menu-Based ControlsCreate EventHandlers for Menu-Based Controls
13.A menu with a simple event listener.A menu with a simple event listener.
14.Handle events for the menu bar and for the pop-up submenus.Handle events for the menu bar and for the pop-up submenus.
15.Using Menu control eventsUsing Menu control events