HaXe & NME tutorial: Install and setup on Windows

If you have read my last post then you will know that I am endeavouring to increase my focus on mobile development. This lead to one reader mentioning an API called NME that allows code written in HaXe (very similar to AS3) to cross compile natively to Flash, Android, iOS, webOS, Windows, Mac, Linux, and HTML5 targets.

As the code is natively compiled (c++ for Android and iOS) the performance is perfectly acceptable for physics based games. This is in contrast to Adobe Air’s export to Android and iOS that has a Virtual Machine interpreting the code thereby causing poor performance.

So far I have ported a couple of earlier Box2D tutorials and successfully ran them on my Android phone at a smooth frame rate. I was also able to get it working well with the iOS simulator.

If you are interested in programming with NME then I thought I would post a screencast tutorial to demonstrate how to install and setup HaXe with NME and compile a simple HelloWorld application to Android and Flash.

  • http://twitter.com/jorgeenriquezm Jorge Enríquez

    Thanks Allan, I was looking for something like this :)

  • allanbishop

    Hope it proves useful :) Will be also creating another screencast for the Mac and publishing to the iOS simulator

  • http://www.joshuagranick.com Joshua Granick

    Don’t forget it also supports webOS, Windows, Mac and Linux :)

    Thanks for the video!

  • allanbishop

    Ah yes, so many platforms! I have edited the post to reflect this.

  • Rey

    Great set up tutorial. I currently work with Flash and I currently define all my objects in the FLA file.  I then set up my FlashDevelop project as a “Flash IDE Project.”  If I were to use HaXe/NME, would this change the way I do things or will I still be able to build to Android devices?

  • Rey

    Disregard my question.  It looks like we have the ability to embed a SWF.  Great stuff!

  • Nansorb Arev Ed

    have you tried NAPE for your physics engine? i heard its faster than box2d.

  • allanbishop

    Hi, yes I have heard that for Flash it is quite a bit faster. However, there are a couple of things holding me back from using it. First, is there is no CCD feature as of yet, and second, according to this 
    http://haxe.1354130.n2.nabble.com/Use-Nape-with-NME-on-cpp-Android-iOS-targets-td6853363.html 
    it seems that it is much slower when targeting C++ with NME.

    Still, might trial it out sometime myself :)