Lao Yang's Blogyzgname.blog.chinaunix.net
yzgname
全部博文(187)
2013年(1)
2012年(8)
2011年(28)
2010年(36)
2009年(47)
2008年(67)
vcdog
小雅贝贝
Bsolar
mcy_gzxx
m_rabbit
mark_hua
alangaoh
cnmrwu
进击的夏
hn16889
orastar
分类: 系统运维
2010-04-12 14:11:37
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="" layout="vertical" verticalAlign="top" backgroundColor="white"> <mx:Script> <![CDATA[ import mx.managers.PopUpManager; private function button_click(evt:MouseEvent):void { var popUpTitleWindow:PopUpTitleWindow = new PopUpTitleWindow(); PopUpManager.addPopUp(popUpTitleWindow, this, true); } ]]> </mx:Script> <mx:Button id="button" label="Launch Window" click="button_click(event);" /> </mx:Application>
PopUpTitleWindow.mxml
<?xml version="1.0" encoding="utf-8"?> <mx:TitleWindow xmlns:mx="" showCloseButton="true" styleName="noPadding" layout="absolute" width="300" height="200" creationComplete="init();" resize="init();" close="titleWindow_close(event);" keyDown="titleWindow_keyDown(event);"> <mx:Style> .noPadding { paddingBottom: 0; paddingTop: 0; paddingLeft: 0; paddingRight: 0; } </mx:Style> <mx:Script> <![CDATA[ import mx.core.IFlexDisplayObject; import mx.events.CloseEvent; import mx.managers.PopUpManager; [Bindable] public var source:String; private function init():void { PopUpManager.centerPopUp(this); this.setFocus(); } private function titleWindow_close(evt:CloseEvent):void { PopUpManager.removePopUp(evt.target as IFlexDisplayObject); } private function titleWindow_keyDown(evt:KeyboardEvent):void { if (evt.charCode == Keyboard.ESCAPE) { this.dispatchEvent(new CloseEvent(CloseEvent.CLOSE)); } } ]]> </mx:Script> <mx:Label id="lbl" text="Press ESC to close this window." fontWeight="bold" truncateToFit="true" horizontalCenter="0" verticalCenter="0" /> <mx:ControlBar horizontalAlign="right" width="100%"> </mx:ControlBar> </mx:TitleWindow>
上一篇:linux下登录oracle命令行时删除键好用的解决方法
下一篇:早起的虫子被鸟吃
登录 注册