Add Spacer to PopupButton and TextInput
<?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