我们可以在 Actionscript 中将编译后的 Haxe swf 的 SWC 用作普通库吗?
我们可以在 Actionscript 中将编译后的 Haxe swf 的 SWC 用作普通库吗?我有一个从haxe代码编译的swf(我可以尝试将它编译成其他SWC)我想将它用作AS3中的lib。
是否可以?
如果是的话怎么办?
Can we use compiled Haxe swf's swc's in Actionscript as normal libs? I have a swf compiled from haxe code (I can try to compile it into something else SWC for ex) I want to use it as lib in AS3.
Is it possible?
If yes how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,可以,性能提升是值得的,而且非常简单!我在简单的素数和算法和复杂的 2D 装箱算法上都获得了 3-4 倍的加速。
我已经在 github 上发布了一个完整的示例项目——从 Haxe 源代码和编译脚本到在 AS3 项目中的使用。看看:https://github.com/jcward/HaxeSWCExample
更新: 请注意,桌面平台上的收益增加了 3-4 倍。遗憾的是,在移动平台上,收益要小得多。
Yes, you can, the performance increase is worth it, and it's surprisingly easy! I got 3-4X speed-up on both a simple sum-of-primes algorithm and a complex 2D bin packing algorithm.
I've posted an entire example project on github -- from Haxe source and compile scripts to usage in an AS3 project. Check it out: https://github.com/jcward/HaxeSWCExample
Update: Note that the 3-4X gains were on the desktop platform. Sadly on mobile platforms, the gains were much more modest.
是的,你可以。如果它是一个库,那么您需要将其导出为 SWC,然后只需确保您从何处进行编译就知道 SWC 的路径。
Yes you can. If it is a library then you would want to export it as a SWC and then just make sure that where ever you are compiling from knows the path to the SWC.