Skip to content

Automating Flash CS4 builds with JSFL

2010 September 7
by Tedb0t

I use and adore Flash Builder for programming Flash applications, but there are occasions where you have to compile from the Flash IDE.  On a current project I have multiple FLA files that have to be compiled and copied to a development server in order to test them, so I wrote a script (well, two scripts) that automates this completely using Flash’s Javascript API (JSFL).

The compile-all.jsfl script publishes each document open in the IDE and then writes a log file to signal that it’s done compiling (which is the only way I could find to tell bash it’s done).  The script removes the file first if it exists, starts the JSFL script, waits for the logfile to appear, then runs another script that copies the SWFs to the dev server.  Now to find out how to integrate this script into FB…


for (doc in fl.documents) {
FLfile.write("file:///Users/daleth/Projects/Oddcast/Avon/log.txt", "nothing");


if [ -f log.txt ]
	rm log.txt

open compile.jsfl

echo "Compiling..."

while [ ! -f log.txt ]
	sleep 1

echo "Finished compiling, copying"


Related Posts: