怎么能把flex4中的TitleWindow控件做成弹出式的
1个回答
2016-09-06
展开全部
Alert弹出框就是用PopUpManager实现的
不想用,那就自己写一个PopUpManager~~~
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.events.CloseEvent;
import mx.containers.TitleWindow;
private var titleWindow:TitleWindow;
private function clickHandler():void{
titleWindow = creatTitleWindow();
systemManager.addChild(titleWindow);
titleWindow.x = 200;
titleWindow.y = 200;
this.enabled = false;
}
private function creatTitleWindow():TitleWindow{
var window:TitleWindow = new TitleWindow();
window.width = 200;
window.height = 200;
window.showCloseButton = true;
window.addEventListener(CloseEvent.CLOSE,closeHandler);
return window;
}
private function closeHandler(event:CloseEvent):void{
systemManager.removeChild(titleWindow);
this.enabled = true;
}
]]>
</mx:Script>
<mx:VBox>
<mx:TextInput/>
<mx:Button label="弹出框" click="clickHandler()"/>
</mx:VBox>
</mx:Application>
不想用,那就自己写一个PopUpManager~~~
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.events.CloseEvent;
import mx.containers.TitleWindow;
private var titleWindow:TitleWindow;
private function clickHandler():void{
titleWindow = creatTitleWindow();
systemManager.addChild(titleWindow);
titleWindow.x = 200;
titleWindow.y = 200;
this.enabled = false;
}
private function creatTitleWindow():TitleWindow{
var window:TitleWindow = new TitleWindow();
window.width = 200;
window.height = 200;
window.showCloseButton = true;
window.addEventListener(CloseEvent.CLOSE,closeHandler);
return window;
}
private function closeHandler(event:CloseEvent):void{
systemManager.removeChild(titleWindow);
this.enabled = true;
}
]]>
</mx:Script>
<mx:VBox>
<mx:TextInput/>
<mx:Button label="弹出框" click="clickHandler()"/>
</mx:VBox>
</mx:Application>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询