Flash9 SWC Support

Starting from haXe 2.03, you can create Flash9+ SWC files using the haXe compiler.

In order to do that, simply name your output with .swc extension :

haxe -swf9 lib.swc MyLibrary

Some important details :

  • you need to call new flash.Boot(mc) in your application which initialize the SWC. This will initialize some haXe-specific things. The mc parameter needs to be a MovieClip, and will be the one used to setup flash.Lib.current
  • unlike a normal haXe compilation static variables in a SWC are initialized before the Boot class is initialized. It means that if they use some haXe-specific things, initialization of these statics might fail.
  • there seems to be some issues left when using multiple haXe produced SWC in the same application. Please report your findings on the haXe mailing list so we can pinpoint and fix the problem.

This feature is still new, please report any bug on the haXe mailing list.

version #5631, modified 2009-03-22 12:24:02 by ncannasse