Wrapup of my Flex 2 Ant Adventure
Previously I had several posts about getting Flex 2 to compile on my mac. The information was spread over several posts, so I wanted to summarize that info here.
The first step is to get a copy of the Framework files. For mac users this requires access to a linux or Windows box. I used the Flex Enterprise Services install and chose the compile to war option. In the location you choose to install there will be a tools folder. Those are the files you need. I also found on a pc that after installing the Flex Builder 2 app, I have a framework folder which appears to have the same files.
In my regular eclipse I create a new project, and select a location for it on my filesystem. In that project I created a flex folder. Then I just needed to copy the lib and frameworks folders from the install location mentioned above.
Now back in eclipse, at the root of our project, I create my hello.mxml. Just a simple Flex 2 file outputing some text in a label. And then the last peice is my build file. Save the script below as build.xml in the root of your project.
Now if you run the default task in that file you will be provided with a hello.swf file that you can run and distribute as you like.
Feel free to let me know if you run into any problems with this, as i have only tested it for my own local development.

Hmm…this doesn’t quite work for me (though I’m somewhat of a novice when it comes to Eclipse).
Following your instructions I did the following:
- Installed Flex Enterprise Services on a Windows box.
- Copied the frameworks and lib directories into a directory on my Mac.
- Created a new Java project in Eclipse from that directory.
- Added an MXML file and the build.xml file from your site.
- Tried to compile by right-clicking on the build.xml file and choosing Run As > Ant Build.
- Got some a compile error, looking for some of the flex files inside a flex subdirectory (which makes sense based on what’s in the build.xml).
- Moved libs and frameworks into a flex subdirectory and compiled again.
- Got the following: /Users/daf/Documents/Dev/Flex/Eclipse/flex/frameworks/flex-config.xml:23: Unable to find ./frameworks/libs/en_EN/framework_rb.swc
From there I’m not sure where to go.
Hi Dave,
It would appear that I left out one important step :)
The location of the local folder changed from alpha to beta. So on line 23 of your /flex/frameworks/flex-config.xml file change the line to
<library>./locale/en_EN/framework_rb.swc</library>
This will allow the compiler access to the correct files. Let me know if you have any other problems.
Hi Simeon,
Can I ask your help please.
I downloaded the final release of flex 2, but I can’t get it to work with this set up. I did keep the flex-enterprise.xml in the flex/frameworks;however, now there is a macFont.ser file that eclipse is looking for, but can’t find,and this is causing a huge problem and I can’t compile the flex apps:(
Hopefully, you can help, adn thanks again for all your help in the past!
John
You can also try this http://www.flex2ant.org