HAXE Flash9 Assembler Library and Compiling SWF


Haxe
is a very interesting project that is a scripting language that can create SWF for Flash.

Haxe has now added Flash9 Assembler library called hxASM and released version 1.1.4 that includes performance updates for Flash9 SWFs compiled using Haxe scripting.

I have to compile SWFs dynamically right now in a service and this is a very attractive solution with the new version and the performance improvements. Previously there was some slow down and only static content really worked well but if this is equal or a 30% improvement that is excellent.

Flex 2 can also compile at the command line you can compile flash9 swf with or without the flex2 libraries, when using mxml the flex libraries are included which add 100k or so minimum. It is not required to compile with flex 2 libraries though.

Flex 2 command compiler options

Haxe command compiler tutorial

Using Haxe with Flex 2

Using Haxe hxASM

Full Haxe API (includes all flash libraries)

  • http://blog.iconara.net Theo

    The Flex compiler (mxmlc) doesn’t add anything from the Flex libraries unless you compile a .mxml (which is always a Flex subclass). Compile a .as with a subclass of Sprite instead and you don’t get anything besides what you reference (the flash packages are not included in the .swf).

  • http://drawk.wordpress.com/ drawk

    Thanks Theo, yeh I didn’t make that clear I corrected the post.

  • http://www.hiddenresource.net/ sascha/hdrs

    Was excited to try this out but seems nothing works. After compiled the example on the hxasm page I get a strange exception …

    VerifyError: Error #1107: The ABC data is corrupt, attempt to read out of bounds.
    at
    at [abc-decode]

  • http://haxe.org Nicolas

    Hi sascha, that’s because you’re using Flash Player Beta 9r60, try to use latest non-beta player. 9r60 will be supported in next haXe release.

  • http://drawk.wordpress.com/ drawk

    Here is a flash version switcher:

    http://www.sephiroth.it/weblog/archives/2006/10/flash_switcher_for_firefox.php

    Many times if I have issues with something in one version of the flash player I check the last version or the new beta to see if it is broken or fixed.

  • http://www.hiddenresource.net/ sascha/hdrs

    Ah thanks for the hint! would have never thought about that!