日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

flex TitleWindow之間數(shù)據(jù)傳輸?shù)氖纠?/h1>
系統(tǒng) 2133 0

在Flex里,一般的彈出窗口(除了Alert以外)都可以用TitleWindow組件完成,主窗口和TitleWindow的數(shù)據(jù)傳輸可以用以下方法:
假設(shè)TitleWindow的實(shí)例文件為titleWin.mxml,則要在Application中用PopUpManager創(chuàng)建一個(gè)titleWin的引用
private var popWin:titleWin = titleWin(PopUpManager.createPopUp(this,titleWin,true));
如果要將Application的一個(gè)組件的值傳給titleWin,如Application的id="userName"的TextInput的值傳給titleWin,必須先在titleWin.mxml里聲明一個(gè)TextInput的組件:
public var userNameInPop:TextInput;
然后在Application里:
popWin.userNameInPop=userName;
這樣就相當(dāng)于把Application的userName的TextInput組件傳給了titleWin,可以在titleWin.mxml里綁定這個(gè)值然后在文本框里顯示出來:
[Bindable]
public var userNameInPop:TextInput;

<mx:TextInput x="110" y="39" id="popUserName" text="{userNameInPop.text}"/>



而要把titleWin的值傳給Application則只需在titleWin.mxml里把TextInput的值賦給userNameInPop的text即可:
userNameInPop.text=popUserName.text;
flex TitleWindow之間數(shù)據(jù)傳輸?shù)氖纠? src=
全部代碼如下:
titleWin.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300" showCloseButton="true" close="PopUpManager.removePopUp(this)">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
//[Bindable]
//public var userName:TextInput;
[Bindable]
public var userNameInPop:TextInput;
[Bindable]
public var userEmailInPop:TextInput;
private function showText():void
{
userNameInPop.text=popUserName.text;
userEmailInPop.text=popEmail.text;
PopUpManager.removePopUp(this);
}
]]>
</mx:Script>
<mx:Label text="用戶名:" x="57" y="41"/><mx:TextInput x="110" y="39" id="popUserName" text="{userNameInPop.text}"/>
<mx:Label text="郵箱:" x="57" y="71"/><mx:TextInput x="110" y="69" id="popEmail" text="{userEmailInPop.text}"/>
<mx:Button x="157" y="99" label="Button" click="showText()"/>

</mx:TitleWindow>

mainWindow.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
private function pop():void
{
var popWin:titleWin = titleWin(PopUpManager.createPopUp(this,titleWin,true));
popWin.title="彈出窗口";
popWin.userNameInPop=userName;
popWin.userEmailInPop=email;
}
]]>
</mx:Script>
<mx:Label text="用戶名:" x="106" y="95"/><mx:TextInput x="159" y="91" id="userName" text="ssz413"/>
<mx:Label text="郵箱:" x="106" y="144"/><mx:TextInput x="159" y="142" id="email" text="ssz425"/>
<mx:Button x="207" y="189" label="Button" click="pop()"/>

</mx:Application>

-->

更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 龙陵县| 共和县| 光山县| 宜阳县| 荃湾区| 涿州市| 正定县| 雅江县| 将乐县| 英吉沙县| 乐亭县| 晴隆县| 鄂尔多斯市| 湾仔区| 东阿县| 鲜城| 高安市| 盐源县| 乌鲁木齐市| 吉林省| 乐至县| 泰安市| 廉江市| 广汉市| 若尔盖县| 凤凰县| 玉林市| 福鼎市| 大悟县| 云梦县| 乌拉特前旗| 高州市| 赤峰市| 石景山区| 镇宁| 延川县| 夏邑县| 景东| 蓬溪县| 循化| 壤塘县|