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.

(Technorati tags: | | )

13 Responses to “Working with Flex 2 on Mac OS X”

  1. Chris Davis Says:

    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

  2. Rob Bevan Says:

    Ooops! Link now fixed. Thanks for letting me know.

  3. enter the chapel » Blog Archive » flex 2: my new best friend I never knew Says:

    […] 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… […]

  4. Chris Davis Says:

    Any luck getting the Eclipse plugin for Flex2 to work on Mac OS X?

  5. Rob Bevan Says:

    No: Eclipse won’t let you install because the plugin needs it’s ‘architecural requirements’ to be met i.e. Windows.

  6. Chris Davis Says:

    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

  7. Rob Bevan Says:

    Yes, it’s possible. Will post some instructions soon.

  8. Mark Belanger Says:

    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.

  9. Sean Scott Says:

    Hey Rob, wondering if you have had a chance to play with Flex 2 Beta on the mac?

  10. Rob Bevan Says:

    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.

  11. ej Says:

    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.

  12. Duane Nickull Says:

    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

  13. Aaron Smith Says:

    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.

Leave a comment