我们可以在 Actionscript 中将编译后的 Haxe swf 的 SWC 用作普通库吗?

发布于 2024-08-24 07:06:40 字数 136 浏览 20 评论 0原文

我们可以在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

拒绝两难 2024-08-31 07:06:40

是的,可以,性能提升是值得的,而且非常简单!我在简单的素数和算法和复杂的 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.

知你几分 2024-08-31 07:06:40

是的,你可以。如果它是一个库,那么您需要将其导出为 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文