Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to publish a FLA from the command line?

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.

like image 337
MidnightGun Avatar asked Nov 04 '08 15:11

MidnightGun


3 Answers

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()

like image 93
D. Starr Avatar answered Nov 11 '22 20:11

D. Starr


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 image 39
AlexGvozden Avatar answered Nov 11 '22 21:11

AlexGvozden


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.

like image 45
Alexei Skachykhin Avatar answered Nov 11 '22 21:11

Alexei Skachykhin