Batch fla export script

We recently finished a pretty untypical project. The client wanted to have a portfolio site, where the “cases”-pages were so different, that they did not fit in any cms or xml structure. And since the client has their own flash developer (well, more of a designer type…) they wanted to be able to maintain the FLA files themselves.

So we built the basic structure in an index.swf. The “cases” FLAs had a document class which inherited from a super class. So what if something in the superclass changes? Yes, you have to open every FLA and export it all over again.

For this case we wrote a little JSFL script with a XUL user interface. Interestingly this feature exists since Flash MX 2004 without much notice.

Screenshots:




How to:

  • Select if you want to include subdirectories
  • Select the directory
  • Select a string
  • Hit Ok. The script will take care of the rest

Features:

  • Compatible with Flash MX 2004, Flash 8, Flash CS3 and Flash CS4 on OSX and Windows
    (Flash MX 2004 and Flash 8 does not report compiler errors)
  • Saves settings for next use
  • Reports if there was compiler errors
  • Includes subdirectories

Download (Make sure, you have the Adobe Extension Manager installed)

For developers:

You can have a look at the jsfl file here.

The GUI is build in XML2UI (which is a subcategory of xul). Its available since Flash MX 2004 and so it is documented. Although google finds something, you’ll ofter get a 404 when clicking some interesting sounding links. It took me ages to find out that there are livedocs about that in the Flash 8 livedocs, not inside “Extending Flash” but inside “Using Flash” –> “XML to UI”. Well, right.

You can not pass parameters to the xul xml (which you would need to implement the prefilling). That why you first need to write an XML file with the xml parameters and then pass this xml file to the xmlPanel() method (remember to delete this file after usage).

The same for the fl.compilerErrors object. This object does not have a value or text parameter but it can be saved to the file system. So you need to save that to a file, read this file and check if there is content in this file. If no, there were no compiler errors.

Feel free to write a comment if you have any questions.

Comments