亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

flex TitleWindow之間數(shù)據(jù)傳輸?shù)氖纠?/h1>
系統(tǒng) 1812 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號聯(lián)系: 360901061

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

【本文對您有幫助就好】

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

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日本亚洲精品一区二区三区 | 日一级片| 99视频久久| 久久久久网站 | 亚洲产在线精品第一站不卡 | 久久人人精品 | 四虎成人免费影院网址 | 国产情精品嫩草影院88av | 久久这里只有 | 精品理论片一区二区三区 | 九九爱精品视频 | 人人爱天天做夜夜爽 | 欧美亚洲日本在线 | www国产精品 | 国产精品一区二区国产 | 韩国日本美国免费毛片 | 亚洲综合首页 | 真人女人一级毛片免费视频观看 | 久久青草免费91线频观看站街 | 九九精品免视频国产成人 | 中文字幕欧美日韩久久 | 天天干天天射天天操 | 久久精品国产精品亚洲综合 | 久久天天躁日日躁狠狠躁 | 天天插天天插天天插 | 99热国内精品 | 久久国产精品久久国产片 | 欧美日韩色视频 | 亚洲精品综合一区二区三区 | 欧美国一级毛片片aa | 久久国产小视频 | 老子影院午夜伦不卡不四虎卡 | 四虎影音在线观看 | 国产成人无精品久久久 | 91精品全国免费观看 | 91精品国产福利尤物免费 | 天堂va| 99热久久这里只有精品 | 亚洲欧美一区二区三区综合 | 欧美色图一区二区 | 天天靠天天擦天天摸 |