Linux+Eclipse+AXDT+Flixel

This past week, I came across the Flixel engine for Flash game development. I have been looking for something to kelp me speed up development on our game and this looked to be the most promising of the engines I had found.

However, according to the download page, they did not have a IDE based solution to getting Flixel to work in my set up of Ubuntu Linux, Eclipse Helios and AXDT. So I decided to take a stab at getting it up and running myself.

The solution turned out to be easier than I thought it would be, but I need to start from the beginning.

First I am running Ubuntu 11.04 64bit. This version of Linux only has Eclipse 3.5 Galileo in its repositories. So I had to download 3.6 myself. Now when you download Eclipse 3.6, (as of this article, Eclipse is on 3.7. I have not tested this with 3.7 so take caution if you go that route. 3.6 should still be available.) make sure you do not get the Classic version because it doesn’t have the Eclipse Marketplace. Without that, you can’t get AXDT.

You can actually start programming flash games now. However, we aren’t done yet.

Ubuntu 11.04 now has Firefox version 4 in its repositories and for some reason this conflicts with the built in browser in Eclipse. Because of this conflict, compiling a SWF with AXDT causes a file browser window to open in the hopes of loading the SWF in an external browser. To get the internal browser working, follow the steps on Harold Wellmann’s blog. That will get the internal Eclipse browser working.

Interestingly enough, we still aren’t done yet.

In order to get Flixel to properly work with AXDT, we need to manually update the flex-config.xml file in the AXDT plugin. There is a setting in that file called “static-link-runtime-shared-libraries” That is set to false by default. Wit hthe default setting you get the following error when trying to run a Flixel based SWF:

An ActionScript error has occurred:
VerifyError: Error #1014: Class mx.core::SpriteAsset could not be found.

at flash.display::MovieClip/nextFrame()
at org.flixel.system::FlxPreloader/onEnterFrame()

My flex-config.xml file was located in the following place. Yours should be in a similar place.

So set that to true. What this does is let AXDT properly Embed bitmap images. Why that is turned off by default, I don’t know.

Now we can start working. Go ahead and download the latest master version of Flixel. Once you have that, we can get started.

Open Eclipse. Select File->New->Project. Select AXDT Project from the prompt and click Next. Give your project a name and click Finish. You will now have a new project in your Explorer window. This project will have a “src” folder with an “Application.as” file. You can delete that as you don’t need it.

Now take the org folder from the downloaded Flixel folder and put it in the “src” folder. Follow the instructions for the Hello World! Example on the Flash Game Dojo site. Just ignore all the MXMLC stuff. You only need the source code.

Compile and run. Hopefully, it should work.

Now, I also went a step further and downloaded the Flash Projector Content Debugger. This will help you debug your games as AXDT debugging doesn’t work as well as I would like.

So there you have it. All the steps needed to get programming Flash games using Flixel, on Linux in an actual IDE.