I really like Flash Player 10 :D
Setting up a development environment with Flash Player 10 and Flex 3 wasn’t too hard, and all the tools are free! Here’s how I set things up (on two OS X machines, 10.4 and 10.5):
- Get the Flex 3 compiler, and tweak the flex-config.xml file according to the “Command-line Compiler” section on that page.
- Move the flex-sdk-3 folder to /Developer/SDKs. Add the flex-sdk-3/bin directory to your $PATH. Now you should be able to use mxmlc (compiler) and fcsh (incremental compiler!) from the Terminal.
- Download the Debug Flash Player from Adobe’s repository.
Now you can create a Flex project (I created a skeletal .mxml file that wraps a pure Actionscript 3 application), and compile it using either mxmlc (for a one-off) or leave fcsh running in Terminal, for very rapid compile times.
But wouldn’t it be nice to set up a TextMate macro to compile your project in fcsh with a single keystroke? Of course it would.
- Install the Actionscript 3 and Flex bundles for TextMate.
- The “Compile using fcsh” script requires the iTerm application.
- iTerm uses the bash shell, it doesn’t know where mxmlc and fcsh are. Add aliases to your ~/.profile script (or ~/.bash_profile in 10.4), like: alias mxmlc=”/Developer/SDKs/flex_sdk_3/bin/mxmlc”
- In TextMate, set your shell variables. Noah Little has an article that will help. I had to set TextMate’s TM_FLEX_PATH (points to my flex-sdk-3 directory), and my project’s TM_FLEX_OUTPUT, TM_FLEX_FILE_SPECS, and TM_PROJECT_DIR.
- In the bundle editor, the keystroke for Actionscript 3’s “Build using fcsh” is command-B. Change this if desired.
- I modified the bundle script’s compile directives, due to Security Sandbox violations — I’m building an app which runs outside the browser, and loads resources from the file system, so I dug into this file:
~/Library/Application Support/TextMate/Bundles/ActionScript 3.tmbundle/Support/bin/build_with_fcsh.sh
And added this mxmlc directive to the osascript line near the end: “-use-network=false”
Resources and stuff:
The 3D rendering has an apparent clipping bug, hopefully that will get ironed out soon. I get unpredictable results when I change the rotationX and rotationY of a Sprite that contains other Sprites with their own 3D space.