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.
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()
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
Like it was already stated, it is possible to do with JSFL scripts, although you still need to have command line tool that communicates with Adobe Flash Professional to log the process into stdout and supply exit code based on compilation result.
I ended up writing this tool myself https://www.npmjs.com/package/flc. It is basically a command line interface that abstracts Adobe Flash Professional away. Tested against Flash Pro 2014 and 2015.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With