views:

2010

answers:

2

In our project we have a large number (hundreds) of FLA files created by the artists in CS3, from which we compile SWFs to use in our Flex/AS3 application.

As part of a streamlined build/deploy system, it would be really handy to be able to automate publishing all these FLAs, and ideally deploying the SWFs too. I found some ways to do the batch publishing from CS3 using JSFL, but was surprised to discover CS3 doesn't apparently have any command-line functionality for this?

This is on a Linux system for what it's worth, I don't have experience with JSFL to know if you can run scripts from the command line somehow?

note: I should have said "Linux is preferred"... I don't use Linux but our server/build PC is Linux... I didn't realise CS3 was not compatible so I guess we can do this part on Windows.

+1  A: 

How you are running Flash CS3 on Linux ? you cannot run JSFL from command line but compiling a FLA file should be possible

some old example http://www.mikechambers.com/blog/2003/11/01/flashcommand-flash-2004-command-line-compiler/

newer stuff from Mike Chambers http://code.google.com/p/flashcommand/ for OSX

so it's definitely possible seems only through semi automated IDE publishing,

too bad Flex compiler is not capable of such a thing, together with ANT tasks it's a killer... with FDT editor things are pretty cool and automated

MrSteel
+4  A: 

Execute your JSFL scripts from the command line just like this:

on Windows: "c:\program files\macromedia\flash 8\flash.exe" myscript.jsfl

on Mac: open myscript.jsfl

I believe older versions of Flash ran on Wine no problem but not as sure about CS3.

To iterate over a batch of local files, try something like this (in JSFL):

var importFolder = fl.browseForFolderURL('Select a folder with existing FLA files');
var importFolderContents = FLfile.listFolder(importFolder);
for (i = 0; i <importFolderContents.length; i++) {
    file = importFolderContents[i];
    fl.openDocument(file); // and so on
}

And some other methods you'll probably want to investigate are..

fl.getDocumentDOM() document.exportSWF() document.publish() fl.closeDocument()

D. Starr