我可以将 AS3 代码或 Flex 项目交叉编译为本机 C++ 吗?
我想采用现有的 AS3 或 Flex 项目并将其编译为在本机 C++ 代码上运行。有办法做到这一点吗?存在哪些类型的解决方案?我不想更改我的 AS3 代码。
I would like to tak emy existing AS3 or Flex project and compile it to run on native C++ code. Is there a way to do this? What sort of solutions exist? I do not want to change my AS3 code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
AS3 是一个在预构建库上运行的框架,您必须在“翻译”代码中以某种方式进行替换。例如,当您执行
new Sprite()
时,您会想象本机代码会做什么?Haxe 并没有试图寻找替代者。它采用不同的方法,因为它允许您重用可以轻松翻译的代码位,但那些不能翻译的代码被标记为特定于特定环境。然而,Haxe 正在努力通过使用 NME 图形引擎来提供类似于 Flash 显示列表的 API。
给出您使用 iOS 编译器的示例 - 它再次针对现有的本机代码库进行编译,该库提供显示列表、视频和音频播放器等功能。
AS3 is a framework operating on prebuilt libraries you would have to replace somehow in your "translated" code. For example, what would you imagine the native code to do, when you do
new Sprite()
?Haxe doesn't try to find a replacement. It takes different approach in that it lets you reuse bits of the code that would translate easily, but those that don't translate are marked as specific to certain environment. There is, however, an effort in Haxe to come up with API similar to those of Flash display list by using NME graphic engine.
Given your example with the iOS compiler - it, again, compiles against the existing library of native code that provides the functionality of display list, video and audio players and so on.
如果您可以将其转换为 Haxe(Haxe 的语法与 AS3 极其相似,只有库和某些语言结构不同),它应该为您提供“本机”编译的选项。我听说它甚至提供了 C++ 源代码,或者是 IRC Haxe 房间的人告诉我的。我可能会因为代码部分而被恶搞,尽管他看起来并不像是在恶搞……
我并不完美,而且肯定缺乏一些更高级的功能,但它可能值得一看。
If you can convert it to Haxe (Haxe has extremely AS3 like syntax, only libraries and some language constructs differ) it should provide you with an option of compiling for "native". I've heard it even provides a C++ sourcecode or so I've been told by folks at IRC Haxe room. I could have been trolled for the code part, though he didn't seem like he was trolling...
I'ts not perfect and definitely lacks some more advanced capabilities but it's worth looking at probably.
不,因为
Object
和describeType
),简而言之,在 C++ 中(使用 Qt 或任何具有相当强度的框架)编写类似的程序比编写转换器要容易得多。
No, because of
Object
anddescribeType
equivalent there)In short, it's much easier to write similar program in C++ (using Qt or whatever framework of comparable strength) than write convertor for that.