FLEX实践:PopUpManager使用

本例将实现弹出窗口的两种方式

1、PopUpManager.createPopUp

2、PopUpManager.addPopUp

1)创建FunctionSearchComponent.mxml




import mx.controls.Alert;
import mx.managers.*;
private function query():void{
Alert.show("Search Functino!");
}
private function newSearch():void{
functionCode.text="";
moduleId.text="";
}
private function cancel():void{
PopUpManager.removePopUp(this);
}
]]>









2)创建应用程序 FunctionForm.mxml




private function search():void{
var functionSearchWin:FunctionSearchComponent=

FunctionSearchComponent(PopUpManager.createPopUp(this,FunctionSearchComponent,false));

functionSearchWin.x=150;
functionSearchWin.y=150;
}

private function search1():void{
var functionSearchWin:FunctionSearchComponent=new FunctionSearchComponent()


functionSearchWin.width=400;
functionSearchWin.height=400;
functionSearchWin.x=150;
functionSearchWin.y=150;
PopUpManager.addPopUp(functionSearchWin,this,true);
}

]]>

你可能感兴趣的:(FLEX实践:PopUpManager使用)