Working with Flex 2 on Mac OS X
October 23rd, 2005(Note: this post was originally written on release of the Flex 2 alpha. I’ve since updated it for the Flex 2 beta.)
Macromedia recently announced Macromedia Labs and the availability of the Flex 2 product line alpha, which includes a new Eclipse-based IDE and a new high performance client runtime (Flash Player 8.5) alongside the development framework. Unfortunately, for now, development on the Mac is not supported and Macromedia only provide an installer for Flex Builder 2, the Flex Framework 2, Flex samples and command line tools for Windows.
So I set about trying to discover, if as with the 1.0 release, I could get the framework at least to run on OS X: and the short answer is yes, it’s relatively simple.
First of all you need to extract both the framework and the player from the Download for Windows. To do this, just unzip the relevant components from the .exe file. Assuming you’ve already downloaded FlexBuilder2_Beta1_Install.exe to your desktop, this script does exactly this and then copies the ‘frameworks’ and ‘lib’ directories to a flex2 directory in /Library and the Install Flash Player 8.5 OSX.dmg to your desktop. (Or you can obviously just run the installer on Windows and copy across the relevant files.)
Once you’ve got the framework installed, you can use mxmlc - the (Java) Macromedia Flex Compiler - from the command line or better still with Ant. Here’s a version of the ‘Hello World’ example Flex project from Macromedia’s Quick-start tutorials book with the simplest possible Ant build file: just download and run ‘ant’ (defaults to the ‘build’ task) in the Quickstart directory, and - assuming you’ve already installed the player - then open QuickStart.html. You should see the movie initialise and the words “Welcome to Flex” appear.
(I had no luck at all getting the IDE work, I did try extracting Flex Builder 2’s ‘features’ and ‘plugins’ directories and copying the contents of these to my Eclipse installation. Although I was then able to create a new Flex project, I wasn’t able to start the MXML editor which failed with a NullPointerException.)
Update: in case you missed the original Flex 2 announcement and were wondering why you’d bother investing any time in an expensive enterprise-only technology, Macromedia also announced a new (very welcome) licensing model for Flex:
“Macromedia is also introducing a new tiered licensing model to bring the power of Flex development within reach of every professional application developer, while also offering value-added capabilities that scale to meet the needs of the most sophisticated enterprise projects. Flex Builder 2 will be sold for less than $1000 per developer and will include the ability to develop, compile, and deploy Flex applications that connect to XML and SOAP web services with no additional charges or server licensing required. Flex Enterprise Services 2 will be licensed on a per CPU, per project, and enterprise license basis to offer the development efficiency, performance, advanced integration capabilities, and testing support that advanced applications will require.”
Update: Mike Chambers has a round up of resources for Compiling ActionScript 3 and MXML from the command line.


October 29th, 2005 at 4:47 am
hey, thanks for the info! But the download link for the Ant build file is broken, could you post the link or email me the zip?
much love
October 29th, 2005 at 7:49 am
Ooops! Link now fixed. Thanks for letting me know.
November 3rd, 2005 at 11:32 pm
[…] Today, I have seen and understood the awesomeness of FLEX 2, how it easilly ties web services into flash, how real flash applications should be developed and how its going to rule my life. To me, the major player behind FLEX 2 is it’s IDE, FLEX Builder 2, the most revolutionary development I have seen to date in the flash world since actionscript. The IDE is based on the eclipse framework and allows developers to build flash applications in code view or in UI view a lot like Dreamweaver. In UI view you drag, drop and align a lot like other IDE’s allow (I suppose) but the magic is the code view. Essentially, developers code an XML document using specific calls to trigger the IDE when compiling to build the output swf’s INTERFACE, INTERACTIVITY and DATA BINDING/HANDLING. Tout la thang. If this sounds COMPLETELY backwards to you, that’s because it is. If youre a doubter, you need to watch the first tutorial here. Get instruction to install the framework and IDE on os X from robbevan.com. Jeremy mentioned to me today that Yahoo has come out with thier new maps web service built totally in flash… undoubtedly built with my new friend… […]
November 4th, 2005 at 7:18 pm
Any luck getting the Eclipse plugin for Flex2 to work on Mac OS X?
November 4th, 2005 at 8:42 pm
No: Eclipse won’t let you install because the plugin needs it’s ‘architecural requirements’ to be met i.e. Windows.
February 7th, 2006 at 6:22 pm
Hey, new the Flex2 beta framework download is a bit different from the alpha release - any luck extracting the framework files of this beta?
thanks
February 13th, 2006 at 7:40 am
Yes, it’s possible. Will post some instructions soon.
February 17th, 2006 at 2:34 am
Hi Rob,
I’m looking forward to it. I work on a Mac at home and would to be able to develop using the Builder IDE.
March 2nd, 2006 at 5:49 am
Hey Rob, wondering if you have had a chance to play with Flex 2 Beta on the mac?
March 2nd, 2006 at 11:00 pm
Yes, just updated this post for the Flex 2 beta, including instructions how to extract the framework from the Windows installer and how to compile a simple mxml file using Ant.
March 11th, 2006 at 1:26 am
hey i have things compiling with the command line. where are the as3 core classes though. where do i point my IDE so the autocompletion works.
September 12th, 2006 at 12:13 am
Great site. Here are some just released screenshots for Flex Builder 2.0 on Mac OSX. It runs awesome!! Note this is pre-release:
http://technoracle.blogspot.com/2006/09/flex-builder-20-on-mac-osx-first-looks.html
September 24th, 2006 at 6:10 am
hey man, can you post something about how to use just the compiler, i’ve tried running: ‘java mxmlc’, in the directory that the mxmlc compiler is in, and it doesn’t work. I downloaded your example but it is specific for eclipse. You should write a quick step by step on how to just use the compilers provided in the SDK on mac. A quick step by step with where to put files and whatnot and compiling example would be nice. something that isn’t dependant on ant or eclipse.
I would really appreciate it.