在创建Adobe AIR应用程序一个通知窗口 [英] Create a Notification window in Adobe AIR Application

查看:441
本文介绍了在创建Adobe AIR应用程序一个通知窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个AIR应用程序中,我需要显示通知,当AIR应用程序在某个间隔时间相似就像给信息系统托盘消息显示,然后最小化。

I want to create an AIR application in which i need to show the notification that when AIR application is minimize then at some interval of time message shows from the system tray similar like giving information.

我曾访问过 LINK ,它的一个不错的成分,但教程不算多好,因为组件。我需要创建一个组件一样,或者源代码可以从这个网站,所以在修改该组件还可以接受。所以请帮助我。

I have visited this LINK, its a nice component but tutorial is not that much good as component. I need to create a component like that or source is available from this site so modification in this component will also be acceptable. so please help me.

例如:当最小的雅虎通,有一种人是注销或登录然后发出通知,通知我要成分类似这样的...

EG: When you minimize the Yahoo Messenger and some one is sign-out or sign-in then it gives notification i want component similar like that...

在此先感谢

推荐答案

第一步,我们已经创建了一个自定义弹出控制通知显示。

First Step, We have created a Custom Popup control for Notifications display.

在第二步骤中,我们使用下列code已经控制该弹出的显示

In the second step, we have controlled the display of that popup using the following code

if(!this.stage.nativeWindow.visible || this.stage.nativeWindow.displayState == NativeWindowDisplayState.MINIMIZED)
{
    stage.nativeWindow.alwaysInFront = true;
    fadeTimer = new Timer(5000,1);
    fadeTimer.start();
    fadeTimer.addEventListener(TimerEvent.TIMER_COMPLETE, fadePopUp);

    popUpWindow = new PopUpWindow();
    popUpWindow.isAlerts = true;
    popUpWindow.Message = "<b>You have "+event.numNewMessages+" new notification messages<b>";

    popUpWindow.type = NativeWindowType.LIGHTWEIGHT;
    popUpWindow.open(true);
    popUpWindow.fadeInEffect.play();            
    popUpWindow.nativeWindow.x = Capabilities.screenResolutionX - popUpWindow.width - 10;
    popUpWindow.nativeWindow.y = Capabilities.screenResolutionY - popUpWindow.height - 35;
}

上面使用的条件是什么,我们已经习惯了找出来,我们的应用程序窗口是否最小化到系统托盘或没有。即使它不是一个完美的修复,这并没有让我失望呢。它是安静的稳定我的应用程序。

The condition used above is what we have used to find out, whether our application window is minimized to System Tray or not. Even though it is not a perfect fix, It didn't fail me yet. It's quiet stable for my app.

这篇关于在创建Adobe AIR应用程序一个通知窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆