FLEX QQ 弹出窗口(消息框)
2011-04-29 16:41
337 查看
今天突然想做这个 仿QQ 消息弹出窗口 网上搜了下 太麻烦 自己写了个 希望可以帮到人亦或做抛砖引玉之用 共同提高...
<?xml version="1.0" encoding="utf-8"?> <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" showCloseButton="true" close="closeHandler(event)" borderColor="0x00bbcc" titleBackgroundSkin="{bg}" creationComplete="init()" rollOut="rollOutHandler(event)" rollOver="rollOverHandler(event)" layout="absolute"> <mx:Script> <!--[CDATA[ import flash.utils.setTimeout; import mx.binding.utils.BindingUtils; import mx.controls.Alert; import mx.events.CloseEvent; private var hideTimer:Timer = new Timer(1); private var showTimer:Timer = new Timer(1); [Bindable] [Embed("images/bannar_bg.png")] public var bg:Class; [Bindable] [Embed("images/bannar_right.png")] private var bannar_bg:Class; [Bindable] [Embed("images/question.gif")] private var question:Class; [Bindable] public var text:String="Open ur eyes :"+"/n"+" Open ur eyes so the sun can rise, flowers can blossom, birds can sing. Because all r waiting to see ur beautiful smile. Good Morning! "; [Bindable] private var mouseEvent:MouseEvent=null; private function init():void{ this.y=this.parentApplication.height; this.x=(this.parentApplication.width-this.width)-3; this.title = "Message"; this.titleIcon=question; this.setStyle("fontSize",13); showTimer.addEventListener(TimerEvent.TIMER,doShowWindow); showTimer.start(); hideTimer.addEventListener(TimerEvent.TIMER,doHideWindow); } private function doShowWindow(event:Event):void{ if(this.y+5>(this.screen.height-this.height)){ this.y -= 2; } else{ if(!mouseEvent){ showTimer.stop(); setTimeout(function ():void{hideTimer.start();},6500); } } } private function doHideWindow(result:Object):void{ if(this.y<(this.screen.height)){ this.y += 2; }else{ hideTimer.stop(); } } protected function rollOverHandler(event:MouseEvent):void { mouseEvent=event; if(!showTimer.running){ hideTimer.stop(); showTimer.start(); } } protected function rollOutHandler(event:MouseEvent):void { mouseEvent=null; } protected function closeHandler(event:CloseEvent):void { this.parentApplication.removeChild(this); } ]]--> </mx:Script> <mx:HBox borderSkin="{bannar_bg}" filters="{[new DropShadowFilter(8,45,0x777777)]}"> <mx:Text fontSize="13" fontWeight="bold" height="150" width="280" x="49" y="73" text="{text}" /> </mx:HBox> </mx:TitleWindow>
相关文章推荐
- C#代码像QQ的右下角消息框一样,无论现在用户的焦点在哪个窗口,消息框弹出后都不影响焦点的变化,那么有两种方法
- Flex的两种弹出窗口
- 仿QQ弹出窗口
- Flex4弹出子窗口
- Flex弹出窗口
- 让Flex控件 Canvas实现弹出窗口并拖动
- Flex 专栏 -- Flex 中有两种弹出窗口
- 小米XiaoMi MIUI 7/8/9开发版怎么设置锁屏QQ来消息时弹出消息框?
- 仿QQ或msn在右下角逐渐弹出的消息框
- 屏蔽TM和QQ的迷你新闻弹出窗口
- flex界面弹出jsp模态窗口,并向js传值
- winforms实现类似QQ消息框一样的右下角消息提示窗口
- Flex中如何利用PopUpManager类在TitleWindow的弹出窗口中播放一段影像(VideoDisplay)的例子
- C#仿制QQ弹出消息框
- Flex中的弹出窗口(mx.managers.PopUpManager)
- 打开网页一段时间如何自动弹出QQ对话邀请窗口?
- flex 弹出模式窗口 模式蒙板透明度设置
- Flex 弹出窗口的例子
- Flex使用弹出窗口为DataGrid添加新数据
- 全面认识Flex弹出窗口的方法