Making a Flixel game work cross-platform

It’s been a while. I swear that second design post will appear someday.

One of the many things I’ve been doing recently while working on Anodyne is to get it able to run on Mac, and Linux. Doing it for Windows and Mac is incredibly easy with Flashdevelop, as they set up all the scripts for you. Problem is that it works with AIR 3.1 by default, which is a no-no for Linux. So, adventure time.

I think it might be helpful for others who have to deal with this crap later, so here’s a quick guide on getting your flash game, or swf or whatever, packaged with Adobe AIR, IF YOU USE FLASHDEVELOP AS YOUR IDE.

“I want to make my game playable on EVERYTHING with an AIR Installer!”

Great. Just make a project template for “AIR AS3 Projector” project. Copy-pasta your source from the folder you usually build.

Now before you do anything else…

Guess what? AIR only works on versions 2.6 and earlier for Linux. This means you get to jump through some hoops. If you have a recent version of Flashdevelop, you probably have the Flex 4.6 SDK + AIR 3.1 SDK. This is no good.

Go download the Flex 4.5 (and only 4.5) SDK, and unzip that shit into flashdevelop’s Tools folder.

Project -> Properties  -> SDK -> Manage -> Click on Installed flex sdks -> click on the “…” -> add -> enter the path (should be “Tools\your-folder-here”).

If you did everything right, close and open that properties dialogue box, and you should be able to choose an SDK with Flex 4.5A and AIR 2.6.

Great! One more thing. Make sure you open “application.xml” and change the namespace to 2.6. There’s a thingy at the top of that file that probably says 3.1, change it to 2.6. Now everything will work.

Congrats, you are almost done. Build your project to test it with the Debug AIR thingy, if that works, you’re golden – just run the certificate-gen script, and then run the package script (the one in the same level as the application.xml).

And boom, you have a magic AIR installer you can send off anywhere. Magic cross-platform support, hooray.


5 Comments on “Making a Flixel game work cross-platform”

  1. seagaia says:

    Thanks for reblogging! May the world not feel the pain I did while figuring this out.

  2. […] and it works great on the desktop. Awesome! (If you don’t, stop reading here and go see the earlier tutorial on how to do […]

  3. Anonymous says:

    I’m impressed, I have to admit. Seldom do I encounter a blog that’s equally educative and amusing, and let me tell you, you have hit the nail on the head. The issue is an issue that too few folks are speaking intelligently about. I am very happy that I found this during my hunt for something regarding this.

  4. Colin says:

    Hey Sean,
    I have built a game in Flash using flashpunk (basically Flixel) and now want to add controller support, which I will need Adobe Air for. I only need it working on Windows and Mac for now. This tutorial suggests creating a FD AIR AS3 project and simply copying the source and running it, but that doesnt work?

    Any help would be awesome


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s