2012-06-05 71 views

回答

2

是的。

你可以做的是-captive運行時-target束編譯AIR項目(使其成爲一個獨立的.exe文件,而不是.air文件)。

對於Windows,只需重命名您的.exe至而是.scr,右擊並選擇安裝或測試。

如果你想將其設置爲配置和預覽模式,您可以監聽應用調用事件:

//put this in your app main constructor 
    NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, invokEventHandler, false, 0, true); 

    protected function invokEventHandler(e:InvokeEvent):void { 
      //you don't actually have to loop as it will always be the first argument 
      for each(var a:String in e.arguments) { 
       //p - Show the screensaver in the screensaver selection dialog box 
       if (a.indexOf("/p")) { 
        //do something different for preview mode 
        break; 
       } 
       //s - Show the screensaver full-screen 
       if (a.indexOf("/s")) { 
        //the main full screen mode 
        break; 
       } 
       //c - Show the screensaver configuration dialog box 
       if (a.indexOf("/c")) { 
        //show a configuration window 
        break; 
       } 
      } 
    } 
3

一個解決辦法是到Windows窗體的exe內舉辦瑞士法郎。我目前使用C#/。Net 4.0來做到這一點。首先,您需要將.exe配置爲屏幕保護程序。完成後,您需要將.exe重命名爲.scr。在Windows窗體中,需要嵌入Flash Active X對象,然後將窗體設置爲無邊框等。

如果需要,.swf可以通過fscommand調用與.scr通信。例如,我在.swf中監聽mouseMove事件,然後通過fscommand告訴.scr關閉。

有一個免費的工具,可以轉換SWF文件屏保叫InstantStorm,但我個人更喜歡Windows窗體的方法,因爲它允許更多的控制。

Embedding the flash object

Windows form to screensaver

相關問題