在创建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应用程序一个通知窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持蚂蚁编程!
2、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除下载链接并致以最深的歉意。
3、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责。
4、一经注册为本站会员,一律视为同意网站规定,本站管理员及版主有权禁止违规用户。
5、蚂蚁编程管理员有权不事先通知发贴者而删除本文。
蚂蚁编程学院 » 在创建Adobe AIR应用程序一个通知窗口