hi Dhileepen

i think this should satisfy ur needs. chk this code..

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

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

        private function clickedme(event:MenuEvent):void
        {
            Alert.show(event.label.toString());
        }
        private function clickme(event:MouseEvent):void
        {
            //Alert.show(event.toString());

            if(myMenuBar.selectedIndex == 0)
            {
                Alert.show("0");
            }
            else if(myMenuBar.selectedIndex == 1)
            {
                Alert.show("1");
            }
            else if(myMenuBar.selectedIndex == 2)
            {
                Alert.show("2");
            }
            else if(myMenuBar.selectedIndex == 3)
            {
                Alert.show("3");
            }
        }
    ]]>
</mx:Script>
    <!-- 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" click="clickme(event)"
itemClick="clickedme(event)">
        <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>

regards
girish

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to