Adobe Air App留言板,与Linux机器有关

时间:2013-01-28 20:47:11

标签: actionscript-3 air flash-cs5

我有一个使用Flash cs5构建的Adobe Air桌面应用程序,它是一个将简单文本文件加载到动态文本字段的留言板。如果文件是新的,它会闪烁任务栏程序图标,简单的东西。在Windows上闪烁任务栏的完美工作不会在Linux上闪烁任务栏,是否可以调整下面的代码使其在两者上运行?

NativeApplication.nativeApplication.startAtLogin=true

stage.nativeWindow.alwaysInFront=true;

import flash.net.URLRequest;

function completeHandler(event:Event):void
{
var newText:String = loader.data;
if(newText != oldText)
{
        myText_txt.htmlText = newText;
        stage.nativeWindow.notifyUser(NotificationType.CRITICAL);
        oldText = newText;
}
}

function loadUrl():void
{
loader.load(req);
}

// Initialize your variables and event handlers only one time
var req:URLRequest = new URLRequest("https://my_text_file.txt");

// Set cacheResponse to false to prevent a successful response
// from being cached.
req.cacheResponse = false;

// And don't bother checking the cache, either. 
// Not necessary, but the request will execute a little faster.
req.useCache = false;

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, completeHandler);

// Use oldText inside completeHandler() to determine 
// whether the file's text has changed
var oldText:String = "";

var myInterval:uint = setInterval(loadUrl, 120000);

// Start loading the text right away
loadUrl();
 // button control


Minimize_BTN.addEventListener(MouseEvent.CLICK, minimize);
function minimize(e:MouseEvent){
stage.nativeWindow.minimize();

}

drag_BTN.addEventListener(MouseEvent.MOUSE_DOWN, drag);
function drag(e:MouseEvent){
stage.nativeWindow.startMove();

}

stop(); //Stop on the frame you want

0 个答案:

没有答案