問題描述
Adobe AIR 從 Flash 是一場大災難? (Adobe AIR from Flash a big disaster?)
Does anyone have any experience with building AIR apps from within Flash CS3? I inherited an AIR app that is being build from within Flash and is doing my head in to get build.
First of all, the AIR app doesn't run from with the Flash IDE. There is no document class and when I place a trace statement on the first frame it never actually traces (yes, Omit trace actions in the publish settings is un‑ticked). I see an application window (with an AIR icon) but it's not actually doing anything. It is as if the code is never executed.
Second, I'm not sure what should be included in the AIR package. It currently tries to package up all my source code when I create an AIR file, including my .svn folders.
It seems to be impossible to use relative paths in either the dialog that Flash presents (under the Controls menu) or a separate descriptor file. From Flash's point of view, what is the relative path anyway, where the Fla is placed or where the swf is placed? (currently different folders in my project).
Lastly, does anyone know of any good tutorials that talk more about the inner workings of AIR? Not that marketing or "hello, world" mambo jumbo that Google constantly seems to come up with...
Thanks, Luke
‑‑‑‑‑
參考解法
方法 1:
While it is possible to compile projects created in Flash Professional using Flash Builder, and vice versa, if the project has any significant complexity, doing so becomes non‑trivial.
If the person who created the project was using Flash Builder, I would expect that opening the project in (even a trial version of) Flash Builder will allow you to get the project up and running and compiling in order to test.
If it was created in Flash Builder, and you are attempting to open it in Flash Professional, there are many caveats involved. You may have to set the Document Class, and ensure that various packages/frameworks are included in your build settings. Also, there are some instances in which the Flash Professional compiler may operate differently than the Flash Builder compiler (they are not the same), resulting in odd behavior in your app, assuming it compiles.
It's not your fault — Adobe has conflated the term "Flash" between several of their products, so it is not clear at all what is what, and while compatibility may be indicated by the names of things (hey, AIR is AIR, right?), wrong.
Your best bet is to open the original project in Flash Builder and take it from there. Good luck!
方法 2:
Any particular reason you are using the Flash IDE ? I would suggest using the Flex Builder IDE (trial for 30 days) or Flex plugin for Eclipse for developing AIR applications.
http://www.adobe.com/support/documentation/en/air/
is the best free resource I have come across for learning AIR. Good luck!
方法 3:
There is a lot of scaffolding that you need to get AIR apps working properly ‑‑ things like application descriptors, certificates, application signing, etc.. Flex builder has built‑in tools that can handle this. You could probably do the same with CS3 with a lot of extra hacking, but why bother?
Get a trial version of Flex builder here ( I would recommend getting the eclipse plugin and installing eclipse first). After 60 days, when the trial expires, you should have a pretty good idea about what tools are right for you.
方法 4:
I also wanted to get a leg‑up when it came to learning AIR / FLEX since we are considering developing a client for out application using these technologies.
I found the following video tutorials from Adobe to be exteremely useful. They are easy to follow and will probably be very familiar in places if you've worked in any other modern frameworks (Apple's Cocoa springs to mind especially...).
Hope you find them as helpful as I did.
(by Luke、cleverbit、Rick J、marketer、jkp)