Haxe - An Interesting Path To Open Source Flash Programming

I have my reservations about learning flash. It is proprietary, bloated, and doesn’t work very well on linux 64bit. However, there are a lot of rich web applications that need to be flash based. Youtube anyone? I landed on haxe.

I was slightly turned off by the fact that haxe can compile to javascript, flash, or Neko (which I am not familiar with). However, what turned my on was that haxe compiled to swf is apparently faster than AS3 compiled swf’s. That argument is probably a good topic for another post, I will have to run some benchmarking.

The documentation on haxe.org is pretty good. Here is a good tutorial on getting started with flash and haxe.

Here is an example of drawing two circles in haxe:

class Test {
  static function main() {
    var mc:flash.display.MovieClip = flash.Lib.current;
    //set the fill color
    //draw a circle at x=50, y=50 with a radius of 25
    //complete the fill routine
    //set the fill color for the second circle
    //draw a circle at x=75,y=50 with a radius of 25
    //complete the fill

The result is what you see below.

You can see that it is pretty easy to read and understand. If you follow the tutorial at cactusflower.org you will create something a little more interactive.

My impression is that if you need to develop a flash app and would like to use Open Source tools, haxe is definitely an option.