XCode Flex Application Template

19 04 2007

Following up on my previous post, I’ve been really getting into developing Flex applications lately and thought I’d share my basic Flex Application template I’ve created for Apple’s XCode. The template is based on Josh Buhler’s template but adds a few features that I find pretty handy. Those features include:

  • Controller.as
    Bare-bones AS3 class to act as the main application’s controller.
  • AS3 Class file template
    Simple file template to create AS3 classes
  • Build-and-Run in Safari
    Compiles the flex app and opens it in Safari
  • HTML template
    Simple html template to display swf, includes SWFObject javascript
  • flex_skins.css
    Default css file

Installation is pretty simple. For the Flex Application project, Just copy the “Flash” folder into /Library/Application Support/Apple/Developer Tools/Project Templates/

For the AS3 class file template, copy the “Flash” folder in the “file template” folder into the following location:
/Library/Application Support/Apple/Developer Tools/File Templates/

For code-hinting and auto-complete, download and install these language configurations.

The template assumes you’ve installed the Flex 2 SDK into /Developer/SDKs/Flex/. Follow the directions on Josh Buhler’s page for more details.
Below is a screen-shot of an example application based on the template in XCode.

Flex XCode Template

You can download the template from this location. If you run into troubles don’t be afraid to ask questions using the comments for this post. Cheers, and happy FleXCoding!