国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > WEB開發(fā) > 正文

3.12.創(chuàng)建TitleWindow

2024-04-27 13:51:49
字體:
來源:轉載
供稿:網(wǎng)友
3.12.1 問題
我們需要創(chuàng)建一個TitleWindow 組件來顯示對話框并在滿足一定標準的時候使用PopUpManager 移除該對話框。
3.12.2 解決辦法
TitleWindow 組件,繼承自Panel,添加了可以為窗口設置標題的功能,同時也為邊框提供樣式信息。
3.12.3 討論
PopUpManager.removePopUp(this);
此例中,使用TitleWindow 為應用程序創(chuàng)建一個登陸界面。PopUpManager 類提供PopUpManager.removePopUp 方法使組件可以在屏幕上移除其本身。

這說明TitleWindow 組件是由PopUpManager 添加的。
+展開
-XML
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
borderColor="#0000ffbackgroundAlpha="0.6"
title="Title Windowx="168y="86">

<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.controls.Text;
// A reference to the TextInput control in which to putthe result.
public var loginName:Text;
public var loggedIn:Boolean;
// Event handler for the OK button.
private function returnName():void {
loginName.text="Name entered: " + userName.text;
PopUpManager.removePopUp(this);
}
private function checkUserNameAndPass():void
{
/* Do some processing */
}
/* have this handle the event when the server has logged in */
private function returnValueFromLogin(event:Event):void
{
if(loggedIn)
{
PopUpManager.removePopUp(this);
}e
else
{
successText.text = "User/Pass not recognized";
}
}

]]>
</mx:Script>
<mx:HBox>
<mx:Label text="Username "/>
<mx:TextInput id="userNamewidth="100%"/>
</mx:HBox>
<mx:HBox>
<mx:Label text="Password"/>
<mx:TextInput id="passwordwidth="100%"/>
</mx:HBox>
<mx:HBox>
<mx:Button label="Enterclick="checkUserNameAndPass();"/>
<mx:Button label="Cancel"
click="PopUpManager.removePopUp(this);"/>

</mx:HBox>
<mx:Text id="successTextcolor="#ff0000"/>
</mx:TitleWindow>
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 探索| 通州区| 奉贤区| 石家庄市| 乐平市| 孟津县| 秦安县| 拉孜县| 武川县| 余姚市| 元江| 宝鸡市| 汉源县| 田林县| 黑水县| 娄烦县| 库伦旗| 白朗县| 永泰县| 内乡县| 砚山县| 湘潭市| 自治县| 丰顺县| 定日县| 苗栗市| 济宁市| 都昌县| 新郑市| 杭州市| 邻水| 澎湖县| 满洲里市| 青铜峡市| 新乐市| 新绛县| 抚远县| 威宁| 广河县| 重庆市| 图木舒克市|