Components Flex



    
        
        import mx.controls.Alert;
        import mx.events.*;
        import mx.controls.Menu;
        
        public var menuItems:Object =   [{label:'One'},{label:'Two'},{label:'Three'}];
        
        public var thisMenu:Menu = Menu.createMenu(null,menuItems,false);
        
        public function handleItemClick(event:MenuEvent):void{
            menuBtn.label = event.label;
        }
      
    

            creationComplete="thisMenu.addEventListener('itemClick',handleItemClick);"
        popUp="{thisMenu}" />