PopUpButton and Menu : PopUpButton « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » PopUpButtonScreenshots 
PopUpButton and Menu
PopUpButton and Menu
     

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" height="600" width="600">
    <mx:Script>
    
    import mx.controls.*;
    import mx.events.*;

    private var myMenu:Menu;
    private function initMenu():void 
        myMenu = new Menu();
        var dp:Object = [{label: "A"},
                         {label: "B"},
                         {label: "C"}
                        ];
        myMenu.dataProvider = dp;
        myMenu.addEventListener("itemClick", changeHandler);
        popB.popUp = myMenu;
    }
    private function changeHandler(event:MenuEvent):void {
        var label:String = event.label;
        popTypeB.text=String("Moved to " + label);
        popB.label = "Put in: " + label;
        popB.close();
    }
  
    </mx:Script>
    <mx:VBox>
        <mx:PopUpButton id="popB" label="Edit" width="135" creationComplete="initMenu();"/>
        <mx:Spacer height="50"/>
        <mx:TextInput id="popTypeB"/>
    </mx:VBox>
</mx:Application>

   
    
    
    
    
  
Related examples in the same category
1.Using PopUpButton to display an optional menuUsing PopUpButton to display an optional menu
2.Creation Complete event for PopupButtonCreation Complete event for PopupButton
3.PopUpButton with MenuPopUpButton with Menu
w_w__w___._j___av__a2__s.c___o_m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.