Can we use compiled Haxe swf's swc's in Actionscript as normal libs?

青春壹個敷衍的年華 提交于 2019-12-06 07:40:44

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2383788/can-we-use-compiled-haxe-swfs-swcs-in-actionscript-as-normal-libs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!