文章分类 Classification
Flex3.0入门课程:创建不可拖动的TitleWindow容器
稿件来源: 阳光企业网站管理系统 撰稿作者: 太阳光 发表日期: 2013-09-18 阅读次数: 231 查看权限: 游客查看
Flex3.0入门课程:创建不可拖动的TitleWindow容器
title_window.mxml
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" fontSize="12"> <mx:Script> <![CDATA[ import mx.containers.TitleWindow; import mx.managers.PopUpManager; private var titleWin:MyTitleWindow; private function draggableTitleWin(e:Event):void { titleWin = PopUpManager.createPopUp(this,MyTitleWindow,true) as MyTitleWindow; if(e.target.id == "titleWin2") { titleWin.isPopUp = false; } PopUpManager.centerPopUp(titleWin); } ]]> </mx:Script> <mx:Panel width="300" height="200" layout="vertical" title="实现不可拖动的TitleWindow" verticalAlign="middle" horizontalAlign="center"> <mx:Button id="titleWin1" label="可拖动的TitleWinow" width="160" height="35" click="draggableTitleWin(event);"/> <mx:Button id="titleWin2" label="不可拖动的TitleWinow" width="160" height="35" click="draggableTitleWin(event);"/> </mx:Panel> </mx:Application>
MyTitleWindow.mxml
<?xml version="1.0" encoding="utf-8"?> <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" showCloseButton="true" title="TitleWindow" width="200" height="140" close="titleWin_close(event);"> <mx:Script> <![CDATA[ import mx.core.IFlexDisplayObject; import mx.events.CloseEvent; import mx.managers.PopUpManager; private function titleWin_close(evt:CloseEvent):void{ PopUpManager.removePopUp(evt.target as IFlexDisplayObject); } ]]> </mx:Script> <mx:Label text="试试拖动窗口" horizontalCenter="0" verticalCenter="0" /> </mx:TitleWindow>
关键词: Flex3.0,入门课程,titlewindow 编辑时间: 2013-09-18 12:05:20
0
高兴0
支持0
搞笑0
不解0
谎言0
枪稿0
震惊0
无奈0
无聊0
反对0
愤怒
0%(0)
0%(0)
- 暂无评论
文章图片 article Pictrue
网友评论