需要我的Adobe Air桌面应用程序才能使系统托盘图标闪烁

时间:2013-01-14 22:52:42

标签: actionscript-3 air flash-cs5

我在Flash CS5中创建了一个非常简单的Adobe Air桌面应用程序。该应用程序只是一个400 x 200的小窗口,它有一个动态文本字段,可以使用URLRequest加载位于互联网上的“.txt”文件。应用程序每隔5分钟设定一次检查新文件。

我需要找到一种方法让应用程序在加载“NEW”文件时查看“.txt”文件的时间/日期标记时,使应用程序自动闪烁系统托盘图标或Flash按钮。不只是当它再次加载文件时。

我提前道歉我是Adobe Air和Flash Actionscript 3.0的新手

1 个答案:

答案 0 :(得分:0)

对于桌面(非移动)AIR应用程序,您可以使用NativeWindow类的nofityUser函数。

示例:

import flash.desktop.NotificationType;
import flash.events.MouseEvent;

function notifyMe(aNotificationType:String):void
{
    if(NativeWindow.supportsNotification)
    {
        stage.nativeWindow.notifyUser(aNotificationType);
    }
    else
    {
        trace("Notification not supported on this OS");
    }
}

function onStageClicked(e:MouseEvent):void
{
    // You could also pass NotificationType.CRITICAL here
    notifyMe(NotificationType.INFORMATIONAL);
}
stage.addEventListener(MouseEvent.CLICK, onStageClicked);