CreateWindow.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="12" width="300" height="200">
<mx:Script>
<![CDATA[
private function create1():void
{
var opt:NativeWindowInitOptions = new NativeWindowInitOptions();
var window:NativeWindow = new NativeWindow(opt);
window.title = "代码创建空白子窗体"
window.width = 300;
window.height = 200;
window.activate();
}
private function create2():void
{
var window:SubWindow = new SubWindow();
window.open();
}
]]>
</mx:Script>
<mx:Button x="10" y="10" label="自定义Window组件创建子窗体" click="create2()"/>
<mx:Button x="10" y="42" label="代码创建空白子窗体" click="create1()"/>
</mx:WindowedApplication>
SubWindow.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Window xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="12"
title="自定义Window组件创建子窗体"
width="300" height="200">
<mx:TextArea text="一般先放内容的话用这种方法创建" left="10" right="10" top="10" bottom="10"/>
</mx:Window>
文章来自: 闪客居(www.flashas.net) 详文参考:http://www.flashas.net/html/air/20081008/3674.html