<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
private var point1:Point = new Point();
protected function button1_clickHandler():void
{
var mm :text2 = text2(PopUpManager.createPopUp(this , text2, true));
point1.x = btnShow.x;
point1.y = btnShow.y;
point1 = btnShow.localToGlobal(point1);//换算成相对于panel的位置
mm.x = point1.x+15;
mm.y = point1.y+15;
mm.lg = lc;
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<s:Panel x="439" y="234" width="250" height="200">
<s:Button x="21" y="55" id="btnShow" label="按钮" click="button1_clickHandler()"/>
<s:TextInput id="lc" x="21" y="10"/>
</s:Panel>
</s:Application>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" width="228" height="114" close="PopUpManager.removePopUp(this)">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.managers.PopUpManager;
public var lg:TextInput;
protected function getName():void
{
lg.text = lc.text;
}
protected function button1_clickHandler():void
{
// TODO Auto-generated method stub
getName();
PopUpManager.removePopUp(this);
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<s:Button x="10" y="42" label="确定" click="button1_clickHandler()"/>
<s:TextInput id="lc" x="62" y="5"/>
<s:Label x="10" y="10" text="用户名"/>
<s:Button x="125" y="42" label="取消" id="cencle" click="PopUpManager.removePopUp(this)" />
</s:TitleWindow>


