Flex4学习笔记(四)--较复杂例子
1.使用PopUpManager和TitleWindow创建弹出窗口
<fx:Script>
<![CDATA[
import mx.events.CloseEvent;
import mx.managers.PopUpManager;
import spark.components.TextInput;
import spark.components.TitleWindow;
private var win:TitleWindow;
protected function button1_clickHandler(event:MouseEvent):void
{
win= new TitleWindow();
win.title = "对话框";
win.width = 400;
win.height = 300;
win.addEventListener(CloseEvent.CLOSE,win_close);
var text1:TextInput = new TextInput();
text1.x = 100;
text1.y = 100;
text1.text = "abc";
win.addElement(text1);
PopUpManager.addPopUp(win, this, true);
}
protected function win_close(event:CloseEvent):void
{
PopUpManager.removePopUp(win);
}
]]>
</fx:Script>
<s:Button x="176" y="194" label="打开窗口" click="button1_clickHandler(event)"/>

浙公网安备 33010602011771号