AIR 應用程序的 ActionScript 項目? (ActionScript Project to AIR Application?)


問題描述

AIR 應用程序的 ActionScript 項目? (ActionScript Project to AIR Application?)

I'm not using the Flex libraries or anything from Flash. I'm developing a pure AS3 project in Flexbuilder which I would like to deploy as an AIR application.

What are my options? What's easiest? I'm having trouble finding a straight answer here.


參考解法

方法 1:

  

That runs, but shows nothing... for   some reason this doesn't automatically   instantiate a native window.

rather than creating a new window that doesn't represent your main application, simply call stage.nativeWindow.activate(); in your main application class.

方法 2:

You can use either Flash or Flex to create your AIR app.  Which is easier depends on the nature of your app.  If your app is fairly complete as it is and won't change much going forward and you are just concerned with turning it into an AIR app, you can use either.

I do like the availability of a command-line compiler (i.e. mxmlc from Flex) as I can use automate the build process more easily.  With Flash, you will need the IDE to compile the app.  Also, once you get into making it an AIR app, it's highly likely that you might run into things that can be done much faster in Flex than in Flash due to the framework code that you can leverage.  So Flex is a better way to go overall.

方法 3:

Here is a more complete answer...

As unknown stated above:

  

"To do this in FlexBuilder you simply   create a Flex Project AIR application   in Flexbuilder like you would   normally, then in the 3rd step where   you define extra source and library   paths, change the suffix your .mxml   file to .as, ie so Main.mxml becomes   Main.as."

That runs, but shows nothing... for some reason this doesn't automatically instantiate a native window. From Laurentie Adobe Bug Systems:

  

"Of course after the project is   created i add code to create the   windows and stuff, but that wasn't the   issue, so i involuntarily ommited   that. :)

     

try something like:

var options:NativeWindowInitOptions = new NativeWindowInitOptions();
//options.systemChrome = "none";
//options.transparent = true;
var mainWindow:NativeWindow = new NativeWindow(options);
mainWindow.activate();
     

and you add content to that window   throught mainWindow.stage. :) hope   that helps"

All of that being said this isn't really an ideal solution. But there it is for those of you who want to experiment.

方法 4:

To do this in FlexBuilder you simply create a Flex Project AIR application in Flexbuilder like you would normally, then in the 3rd step where you define extra source and library paths, change the suffix your .mxml file to .as, ie so Main.mxml becomes Main.as.

Another obvious gotcha for Mac development is the pesky ADL files not quitting when you close the air app...I use the OSX Activity Monitor to manual force quit the adl file after closing my air app.

(by greyAnonymous CoderBoongreyBachalo)

參考文件

  1. ActionScript Project to AIR Application? (CC BY-SA 3.0/4.0)

#air #flexbuilder #actionscript-3 #deployment






相關問題

如何在 Adobe Air 的 LIKE 運算符模式中使用命名參數 (How to use named parameters inside LIKE operator pattern in Adobe Air)

Android 和 Flash Professional CS 5 Adobe Air Audio:流錯誤 (Android & Flash Professional CS 5 Adobe Air Audio: Stream Error)

可以從 web 視圖中的鏈接觸發我的 Air 應用程序中的操作嗎? (It's possible to trigger an action in my Air app, from a link in a webview?)

動作腳本、NativeProcess、resolvePath 和 swf 不起作用 (Action script, NativeProcess , resolvePath and swf does not work)

如何在創建新線程的同時停止運行線程並恢復同一個線程? (how to stop running thread and resume the same thread beside create new thread?)

我怎樣才能很好地在視圖堆棧之間製作動畫 (How can I nicely animate between viewstacks)

Adobe AIR 從 Flash 是一場大災難? (Adobe AIR from Flash a big disaster?)

“Adobe Flex”和使用 fl.controls 和 fl.events 庫的 AS3 應用程序有什麼區別? (what is the difference between "Adobe Flex" and an AS3 app using fl.controls and fl.events libraries?)

表面上的 Playbook AIR SDK 圖像 (Playbook AIR SDK images on surface)

Adobe AIR 應用程序音頻 (Adobe AIR application audio)

需要在 AIR 上設置 cookie 標頭,使用 SWFLoader 檢索遠程 Flex .swf 文件 (Need to set cookie header on AIR use of SWFLoader to retrieve remote Flex .swf file)

AIR 應用程序的 ActionScript 項目? (ActionScript Project to AIR Application?)







留言討論