简体   繁体   English

在Adobe AIR Application中创建通知窗口

[英]Create a Notification window in Adobe AIR Application

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. 我想创建一个AIR应用程序,在其中我需要显示AIR应用程序最小化时的通知,然后在某个时间间隔从系统托盘显示消息,类似于提供信息。

I have visited this LINK , its a nice component but tutorial is not that much good as component. 我已经访问过这个LINK ,它是一个很好的组件,但是教程并不像组件那么好。 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... EG:当您最小化Yahoo Messenger并且某些人签名或登录时,它会发出通知我希望组件类似于......

Thanks in Advance 提前致谢

First Step, We have created a Custom Popup control for Notifications display. 第一步,我们为Notifications显示创建了一个Custom Popup控件。

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. 它对我的应用来说很安静。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM