Its been 2 months since acquiring my 17″ Macbook Pro and after 12 years of saying ‘I’m a PC’, I am now saying ‘I’m a MAC’. That said, being a ‘MAC’ is not the same as developing on a MAC. Things are slightly different in this world, especially in the open source tools area. Its simply a matter of scale – the community is smaller, therefore offering less support which ultimately results in finding’s oneself ‘alone in the wild’ more frequently.
That said, there is no way I’m going back to PC, so the only solution is to make one. In this article, our particular problem is developing Flash/Actionscript applications on the MAC using ASDT, MTASC and Eclipse.
Note – I recognize this approach may seem dated with the advent of Flex 2 and Flex 2 Builder but several things keep me from running towards that set of smoke signals just yet, including
- No Mac support for Flex Builder 2
- No need or desire to spend 2 months porting my Actionscript 2.0 projects to AS 3.0.
- I just got my tools working very well thank you and would like to reap the rewards for awhile
Cut to the Chase
Ok – this article assumes you know the drill, go get eclipse, asdt and mtasc going. If you need guidance, there are plenty of articles that tell you how to set this up, often referred to as ‘AME’ (Asdt Mtasc Eclipse). In fact, here’s the one I used
Getting Started with Eclipse – Part 3: ActionScript Development
Do not bother with Flashout!!! ASDT 0.8.5 comes with the ‘aslogger’ panel and a swf viewer so can do all of your flash testing/log viewing in eclipse. The other thing the article fails to mention is as2ant, which is part of the as2lib project, and provides your project several nice ant build tasks designed for mtasc and swfmill. If there is interest, I’ll post an article on how to get that running.
What to expect
As I mentioned before, things can get a little weird in the Mac world of open source tools. The reality is that things don’t work like they do in windows. Here’s a list of issues I’ve found along with possible workarounds.
“Asdt 0.8.5 Project Classpaths don’t work” – When you launch your Actionscript project properties, you’ll be tempted to enter all of your actionscript classpaths, thinking that this will get your actionscript editor to start reporting compile-time errors. Well it doesn’t work. Save yourself the hassle and do the following
- Open up ‘Window->Preferences->Actionscript->MTASC”
- Add ‘-cp classpath1 -cp classpath2 …’ in the ‘Additional Parameters’ field
I use full fiile paths for my classpath entries, i.e. ‘/Applications/eclipse/workspace/myproject/src’. I have not tested this with relative paths yet. The drawback to this workaround is that it is set across all of your actionscript projects. The benefit of compile-time errors as
“Asdt 0.8.5 Swf viewer doesn’t work” – Ok – I’m not 100% certain you’ll encounter this problem, but when I attempt to launch swfs using the eclipse swf viewer, nothing happens. Interestingly enough, if I attempt to drop the swf onto Safari, nothing happens either. Note that I am running Flash Player 9 beta plugin so it may be a player issue.
Regardless, it seems that the swfs drop and play great on Firefox. My workaround thus is to make swf’s launch with Firefox instead of the internal viewer. This is a (2) part work around.
Part 1 of 2 – Setup firefox to be launchable
Copy and paste the following script and save it as ‘Firefox.sh’ in ‘/Applications’
#!/bin/sh open -a /Applications/FireFox.app $1
After saving this file, make sure it is executable by opening up a terminal and typing
chmod a+x /Applications/Firefox.sh
Part 2 of 2 – Associate Firefox with SWF files
- Open up ‘Window->Preferences->General->Editors->File Associations’
- Select ’swf’ from the file extensions
- Click ‘Add’
- Select the ‘External Programs’ radio button
- Browse to /Applications
- Select ‘Firefox.sh’ (not Firefox.app!)
Once Firefox appears in your editors list, select it and click ‘default’. This will make eclipse use Firefox as the default program to launch when opening SWF files.
2006:08:22 at 10:08 |
190420 Blog Verification
190420
2006:08:25 at 20:34 |
I just switched from Windows to Mac and trying to get eclipse/mtasc/asdt going. It would be great if you could post a tutorial on how to get as2ant integrated. Thanks and keep up the good work.
2006:08:26 at 03:07 |
JY – Here you go!
http://straylink.wordpress.com/2006/08/26/you-asked-for-it-os-x-eclipse-as2ant-tutorial/
2007:11:16 at 12:22 |
[...] Flash/Actionscript + Eclipse on Mac OS-X « Stray Link (tags: flash actionscript eclipse mac asdt osx mtasc) [...]