Use Your ActionScript Experience to create Native Apps

If you are looking for way to create content for many relevant platforms from a single codebase on a Windows PC, I recommend HaXeNME and FlashDevelop plus the Actuate tween/animation library.

I have yet to find a tutorial that covers the complete process of installing everything you will need to deploy to all the supported platforms using FlashDevelop, but that is the preferred -but not required- method. I don’t have a Mac on which to follow the XCode build path to iOS, so you won’t find that here either, at least not right away.

If you are interested in following along, or just want to try out HaXeNME, here is a fairly comprehensive walkthrough to get started:

Install FlashDevelop

Install FlashDevelop and dependencies, such as .net and Java. The version I installed provided options to automatically include Flex libraries and Flash Player Debugger and prompted me to install any dependencies it did not include itself or find on the system already, such as Java.

Version

Download

Options

Progress

Even though FlashDevelop comes with HaXe pre-installed, I recommend installing HaXe separately. If you decide otherwise be advised that the rest of the what is outlined will probably require path changes and may not work at all.

First Run

Second

Projects

HaXe

NME

Installing NME will also install Motion-Twin HaXe and NEKO to the default location for your version of Windows as a convenience. This will vary from Windows XP and Vista/7, but neither is where FlashDevelop put it.

Be advised that the HaXe site indicated their installer may trigger a virus alert. I saw one for the NME install on Vista, but not from the HaXe on Vista or NME on XP, using the same virus program on each. In spite of declining to take action, Windows Defender reported that it had “cleaned” my infected file. This notification appeared a few minutes after I had completed the NME installation.

Before Installation

After

Targets

Refer to the site instructions for how to install the target operating systems currently supported by HaXe NME.
NME has install scripts for each target, similar to how Linux installs packages. Some of the installers will prompt for paths and options.

When prompted for installation directory

C:\Development|Android SDK

enter

C:\Development\Android_SDK.

Make sure you select Android 2.1 (APK 7) as instructed by the instructions that appear in the terminal. Then install NDK to

C:\Development\Android_NDK

What packages you should install for Android is up to you and outside the scope of this post. If the SDK manager indicates it is done loading packages and you close the window it is possible that the NME process will not detect this. If this happens simply close the terminal window and restart in another one. It will skip through progress already made on the install as long as you enter the correct responses and enter the underscored path names. Do the same process for Apache Ant.

When prompted to install Java JDK, I recommend installing the developer JDK. Install to an existing Java directory if you have one – probably

C:\Program files\Java

You must manually install Java from Oracle’s web page. I recommend installing Jave EE 6 SDK. The ME version did not compile correctly because the compiler is no longer included in that package. It took a bit of research to figure this out, but as of this writing NME still presents you with the ORacle page for the ME version.

Update Environmental Variables

Content

Install libraries to use with HaXe/NME

Libraries are one area where the underlying complexity of HaXe is exposed. While there are some libraries that have been specifically created for use with Haxe to compile to all targets, there are more that are partial ports from a single platform that use HaXe as a bridge to support a subset of other targets and only features the developer needed, or that the targets could support.
Use HaxeLib to determine what is available. Check you project use-case and do some research before committing to a specific library. I have a strong bias toward using only libraries that support all targets and are actively used and developed in case new targets are introduced that become strategic.
One such library that will be necessary to use in the next step is Actuate. Open a command line and enter

I absolutely love your blog and find almost all of your post’s to be precisely what I’m looking for.
Do you offer guest writers to write content to suit your needs?
I wouldn’t mind composing a post or elaborating on a few of the subjects you write regarding here. Again, awesome blog!