国产探花免费观看_亚洲丰满少妇自慰呻吟_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,添加了可以為窗口設(shè)置標題的功能,同時也為邊框提供樣式信息。
3.12.3 討論
PopUpManager.removePopUp(this);
此例中,使用TitleWindow 為應(yīng)用程序創(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ā)表
主站蜘蛛池模板: 高邮市| 即墨市| 彭泽县| 健康| 伊川县| 外汇| 普安县| 浪卡子县| 翼城县| 天峻县| 社会| 布尔津县| 登封市| 古浪县| 宽甸| 甘孜县| 嵊泗县| 门源| 石家庄市| 巴里| 北宁市| 博爱县| 永川市| 台北市| 丰都县| 四会市| 广河县| 突泉县| 霍州市| 正定县| 仲巴县| 碌曲县| 洛川县| 远安县| 灌云县| 余庆县| 府谷县| 呼图壁县| 霍州市| 石楼县| 新干县|