Texas outline

Getting Started With Flixel on OS X

18 September 2009

The other day I stumbled across Flixel, a brilliant collection of ActionScript3 classes for building Flash games. Flixel is a pure ActionScript library, meaning it’s intended for use without the Flash IDE. It’s mind-bogglingly new, but has a nascent community that’s growing larger by the day. Most tutorials and things I’ve found for Flixel tend to be focused on Windows development though, using either FlashDevelop or FlexBuilder. I couldn’t find a guide to getting started with Flixel development on OS X, so I thought I’d put on my tutoring hat and write one myself — this post (and posts to follow) should get you started developing Flixel-based games on OS X, using nothing but the free Flex SDK and a text editor.

Install Flex SDK:

  • Download the Flex SDK from http://www.adobe.com/cfusion/entitlement/index.cfm?e=flex3sdk
  • Unzip the file we just downloaded (flex_sdk_3.4.zip) and copy the resulting folder (flex_sdk_3.4) somewhere out of mind. I stuck mine in ~/Library (/Library).
  • Now we need to tell terminal where to find the Flex tools. Open up Terminal (Applications/Utilities/Terminal) and type open ~/.profile. This opens up your bash profile in TextEdit; add this line to the end of the file: export PATH=~/Library/flex_sdl_3.4/bin:PATH (if you put the flex_sdk_3.4 folder somewhere other than ~/Library, use that path here instead). Save the file and quit TextEdit
  • Close and re-open Terminal (or type source ~/.profile, either works), and make sure everything works by typing mxmlc -help. You should get a screenful of text, starting with the line “Adobe Flex Compiler (mxmlc).” Success!

Flixel

  • Download Flixel from http://flixel.org/flixel_v1.25.zip
  • Unzip flixel_v1.25.zip
  • In your Terminal window, change into the newly-created flixel folder. If you downloaded and unzipped Flixel to your Downloads folder, you can do this by typing cd ~/Downloads/flixel_v1.25/.
  • Compile the Mode example with the Flex compiler by typing mxmlc Mode.as. You should see something like:
    Loading configuration file /Users/doches/Library/flex_sdk_3.4/frameworks/flex-config.xml
    /Users//Downloads/flixel_v1.25/Mode.swf (380608 bytes)
  • Alright! If you look in the flixel_v1.25 folder you should now see Mode.swf — double click on this to open it up in the Flash Player (or type open Mode.swf in Terminal).

Ok — that’s everything we need to build Flash games using Flixel. I'd write a bit more about actually using the library, but that's definitely been taken care of by other, more talented, folks than I...

« Previous: Holy Crap! Wikirunner featured on IndieGames.com!