haXe (pronounced hex – yes I know it’s confusing) is a relatively new language. It is very similar to ActionScript3, so if you’re from an AS3 background, you won’t have to learn a lot of new things.
In this tutorial, we will be installing haXe and FlashDevelop, configuring FlashDevelop for haXe, and creating a simple “Hello World” program.
Difficulty: Beginner
Knowledge: Some ActionScript would help
haXe has several benefits over ActionScript. First off, the haXe compiler is smart. It compiles .swf files that are faster than files compiled from AS with Adobe’s compiler. Second, Adobe has created this thing for Flash called “Alchemy.” Alchemy is a really fast way to access memory. ActionScript3 currently cannot use Alchemy, but haXe can. Using this type of memory, accessing variables is magnitudes faster than an array. Also, haXe has language benefits over ActionScript, like strict typing, templates, and inlining. Lastly, haXe can compile to more than just Flash .swf. It can compile C++, PHP, JavaScript, and Neko. More info on haXe is on the website.
![]() |
So first off, you need to download haXe. You can get it from the website, the download page is here: Download haXe |
![]() |
If you are using Vista or higher, you will need to run the program as an administrator. Just double clicking on the installer won’t work. |
![]() |
Installing haXe may take some time. It downloads the files needed then unpacks them. You may be prompted to install Neko. If you want to compile your code to C++, you will need to install this. |
![]() |
Now that you have haXe installed, you probably need some sort of IDE to write your code in. I highly recommend FlashDevelop. The latest version (3) supports haXe natively, so there are no plugins to install. It sports code intelligence, auto-completion, syntax coloring, built-in debugger, and many other features. Plus, it’s completely free. We will be using it for this tutorial. It is available for download here.
Save the file, and click the blue play button near the top (or press Ctrl+Enter like in Flash). If all goes well, Flash Player should pop up, and there will be a single line of text that says “Hello World!”
Notice that haXe trace statements output on top of the .swf itself, not to a debug window like in Flash. If you want to hide trace statements, just change “Debug” to “Release” by the play button.



June 23rd, 2010
dotMaiku 













Posted in
Tags:
[...] Tutorial: Getting started with haXe – +1 Coins [...]
Exactly what I was looking for! Thanks!
not working install all haxe stuff with original haxe installer
got this error when compiling hello word example on flashdevelop
Running process: C:\Program Files\FlashDevelop\Tools\fdbuild\fdbuild.exe “F:\HAXE_all\examples_all\Start.hxproj” -ipc 79ad94f0-8d0d-4d34-93a4-758b29c294c2 -compiler “C:\Program Files\Motion-Twin\haxe” -notrace -library “C:\Program Files\FlashDevelop\Library” -cp “C:\Program Files\Motion-Twin\haxe\std”
Building Start
haxe -cp “C:/Program Files/Motion-Twin/haxe/std” -cp src -neko F:/HAXE_all/examples_all/bin/Start.n -main Main
‘nekoc’ is not recognized as an internal or external command,
operable program or batch file.
Error : Neko compilation failure
Build halted with errors (haxe.exe).
Done(1)
It looks like you’re trying to compile a neko project. If you don’t have neko installed (which it looks like you don’t) it won’t work =P
When you create a new project, make sure you select “ActionScript” as the type.
Thanks for putting this tut up – just what I needed. Now I have a problem which I have seen posted elsewhere but have not found a solution that works for me:
Using FD 4 RC2
Compile with Global classpath to std yields this error message: “Please don’t add haxe/std to your classpath, instead set HAXE_LIBRARY_PATH env var”
I set this env var.
I removed it from global classes and now get this error instead: “Standard library not found”
In no case is a swf generated.
Any suggestion how to fix this? like I said, I have tried many fixes posted around and even reinstalled everything once.
Thanks in advance,
Dave