ActionScript 项目到 AIR 应用程序?
我没有使用 Flex 库或 Flash 中的任何内容。 我正在 Flexbuilder 中开发一个纯 AS3 项目,我想将其部署为 AIR 应用程序。
我有什么选择? 什么是最简单的? 我在这里很难找到直接的答案。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
无需创建不代表主应用程序的新窗口,只需在主应用程序类中调用 stage.nativeWindow.activate(); 即可。
rather than creating a new window that doesn't represent your main application, simply call
stage.nativeWindow.activate();
in your main application class.您可以使用 Flash 或 Flex 来创建 AIR 应用程序。 哪个更容易取决于您的应用程序的性质。 如果您的应用程序已经相当完整,并且今后不会发生太大变化,并且您只关心将其转换为 AIR 应用程序,那么您可以使用其中任何一个。
我确实喜欢命令行编译器(即来自 Flex 的 mxmlc)的可用性,因为我可以更轻松地自动化构建过程。 使用 Flash,您将需要 IDE 来编译应用程序。 此外,一旦您开始将其制作为 AIR 应用程序,由于您可以利用框架代码,您很可能会遇到在 Flex 中比在 Flash 中更快完成的事情。 因此,从总体上看,Flex 是一种更好的方法。
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.
这是一个更完整的答案...
如上所述未知:
运行,但没有显示任何内容...由于某种原因,这不会自动实例化本机窗口。来自 Laurentie Adobe Bug 系统:
尽管如此,这并不是一个真正理想的解决方案。但对于那些想要尝试的人来说,它是可行的。
Here is a more complete answer...
As unknown stated above:
That runs, but shows nothing... for some reason this doesn't automatically instantiate a native window. From Laurentie Adobe Bug Systems:
All of that being said this isn't really an ideal solution. But there it is for those of you who want to experiment.
要在 FlexBuilder 中执行此操作,您只需像平常一样在 Flexbuilder 中创建一个 Flex Project AIR 应用程序,然后在定义额外源和库路径的第三步中,将 .mxml 文件后缀更改为 .as,即 Main.mxml变为 Main.as。
Mac 开发的另一个明显问题是关闭 Air 应用程序时讨厌的 ADL 文件不会退出...我在关闭 Air 应用程序后使用 OSX 活动监视器手动强制退出 adl 文件。
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.