More Xcode for Flash customizing
December 11th, 2004Currently the Xcode setup I have for working on my flash projects forces me to save all unsaved code files before Xcode tells flash to compile everything. I wanted to have the Xcode build functionality which can automatically save files before each build.
Xcode has a nifty build process that allows you to add custom shell scripts to it.
This is how I added the save functionality:
If you haven’t already set up Xcode for working with flash.
1. In an open project select Build -> New Target.
3. Under “Special Targets” select “Shell Script Target” and click next
4. Give the target a name and click finish.
5. In the “Groups & Files” menu of your project expand Targets and then expand the target you just created.
6. You should see something called “Shell Script Files”. Get info on that.
7. In the script text area paste this code
1 2 | open -a "/Applications/Macromedia Flash MX 2004/Flash MX 2004" "/Library/Application Support/Apple/Developer Tools/Test/testFlashMovie.jsfl" exit 0 |
8. Now open Xcode preferences. Xcode-> preferences
9. In the Building settings set “Unsaved Files” to “Always Save”
At this point you can build the project and it will compile it in flash: Build -> Build
Of corse it wouldn’t be the same without command-enter compiling.
10. Open the command-enter menu script. If you followed the above tutorial it is here:
/Library/Application Support/Apple/Developer Tools/Scripts/10-User Scripts/70-Flash/10-testFlashMovie.bash
11. Replace the contents with this code:
1 2 3 4 5 6 7 8 9 10 11 12 13 | #! /bin/bash
#
#
# -- PB User Script Info --
# %%%{PBXName=Test Flash Movie}%%%
# %%%{PBXInput=None}%%%
# %%%{PBXOutput=Discard}%%%
# %%%{PBXKeyEquivalent=@
}%%%
osascript -e 'tell application "Xcode"
build
end tell' |
Go back to your project hit command-enter and watch the magic.
Make these changes to the Flash project template and its done forevermore in all your new projects.
May 29th, 2005 at 2:21 pm
[...] project again and it will load up your newly complied swf in safari. You may want to add command-enter support to make it like Flash. It also makes a good template addition. [...]
March 11th, 2007 at 12:32 pm
The code doesn’t works (the script does not display in the Script/Flash menu…
nota : I’m using Xcode 2.4.1