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

首頁 > 網站 > WEB開發 > 正文

3.12.創建TitleWindow

2024-04-27 13:51:49
字體:
來源:轉載
供稿:網友
3.12.1 問題
我們需要創建一個TitleWindow 組件來顯示對話框并在滿足一定標準的時候使用PopUpManager 移除該對話框。
3.12.2 解決辦法
TitleWindow 組件,繼承自Panel,添加了可以為窗口設置標題的功能,同時也為邊框提供樣式信息。
3.12.3 討論
PopUpManager.removePopUp(this);
此例中,使用TitleWindow 為應用程序創建一個登陸界面。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>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 绍兴县| 浦县| 德庆县| 文水县| 乌拉特后旗| 同江市| 德格县| 永安市| 正镶白旗| 渑池县| 庆云县| 怀集县| 筠连县| 临潭县| 延安市| 江门市| 车致| 林芝县| 留坝县| 红河县| 剑阁县| 武山县| 白山市| 农安县| 无锡市| 杭州市| 灵台县| 理塘县| 舟曲县| 富源县| 怀宁县| 乌兰县| 桐庐县| 肃宁县| 安徽省| 宁都县| 鹰潭市| 安康市| 泾阳县| 南靖县| 监利县|