Skip to content

Archive for February, 2012

10
Feb

Setting up haXe on Windows 7 (FDT and FlashDevelop)

At time of writing I couldn’t find a definitive workflow for getting beyond ‘Hello World’ with FDT 5, haXe and Windows 7 Enterprise. Here’s mine:

  • Download and run the Windows installer for haXe and Neko found here
  • Install the FDT5 Eclipse plugin using the instructions here
  • Set the haXe SDK location in Eclipse (navigate to Windows/Preferences/haXe SDK and click the ‘Browse’ button, select the ‘c:\Motion-Twin\haxe‘ directory
  • Create your first haXe project using the instructions here
  • Check out the ‘Getting Started’ tips here

I’d seen a lot of talk about HaXe, joined a mailing list to monitor the conversations, but I didn’t really ‘get’ the point of using HaXe over the technologies it targets until I checked out this video by Eddie Sullivan. Using the same language for each tier of your web application reduces the double-handling of data structures, bug-chasing and communication between front/back end.

Next I bought a ‘haXe 2 Beginner’s Guide‘, downloaded a couple of additional templates for FDT (NME and Neko) and made a start on the tutorials in the book. At this point I also noticed that the FDT method for executing compiled Neko code doesn’t seem to do anything… I’ve correctly set my Eclipse Preferences but nothing happens. The workaround is running Neko from the Windows command line, that seems to work just fine.

FDT code completion for haXe is a nice convenience, but there’s no way that I can see to utilise the ‘code templates’ that make AS3 coding such a breeze. I can create a new ‘template’ (or snippet) but the only available contexts are ‘AS3′ or ‘MXML’, no haXe context. I’ve submitted a bug report to the FDT JIRA Issue Tracker, please upvote it if you’re interested.

At this point I’ve discovered that FDT haXe support is actually pretty bare-bones. They’ve automated the process of creating projects, but the combined immaturity of the FDT haXe plugin, and the complete lack of snippets means that the act of writing haXe code in FDT is severely crippled. Cue FlashDevelop…

  • Download and install FlashDevelop from here
  • Watch the John Lindquist ‘haXe Tutorial video’ here

I was compiling a ‘Hello World’ in minutes, and duplicating my AS3 FDT snippets for haXe in less than 10 minutes. FlashDevelop also created a sweet little .bat file that’s linked to the ‘CTRL-Enter’ keyboard shortcut (Test Movie in the Flash IDE). OK, after that little hiccup it’s back to the ‘haXe 2 Beginner’s Guide‘.