« How to bulk publish FLA’s ?»
- Published on › 11.04.07 | Filed under › Source
This is often a question when dealing with a large Flash project. You've changed some #include or a class and need to update a heap of FLA's which use this code. I have found 2 simple and free solutions built into Flash which allow you to do this. The options are :
Option 1 - The Flash Project File

If you don't know already about building Flash project files .flp, you probaly ought to. Built right into Flash project files is the ability to bulk publish the all the FLA's in your project. Simply right click on the project name in the 'Project' panel and there's an option called 'Publish My Project'. This is simply great but not without a few limitations. What if I only wanted to bulk publish a few of the files? Short of creating a new project just for this purpose there is not an easy way to do this. As well there is no way to change the publish options like 'omit trace actions' or the sound compression options without going into every single FLA and changing this. The destination directory for the swf is another final limitation I will mention by using this method.
Though beside mentioning these short comings this option is extremely easy to do and if controlling the publish options doesnt phase you, then go with this option. As option 2 is more hands.
Option 2 - JSFL Bulk Publish

This is the most flexible way to bulk publish FLA's. I was going to write my own JSFL code to do this but on a quick Google Grant Skinner has already done the leg work for this and it's good too. His self named 'JSFL FLA Bulk Compiler'. Follow this link to download the JSFL and example files, I will continue to describe how it basically works. Within the files is a text file called 'compile_schema.txt' within this file are the URI's to the FLA's you wish to publish. An example of the 'compile_schema.txt' is below :
-
home.fla deploy/home.swf Default
-
work1.fla deploy/work/work1.swf Default
-
work2.fla deploy/work/work2.swf Default
The parameters are tab deliminated and each line is for the FLA you wish to publish.
- The 1st parameter - the location of the FLA the location is relative to the JSFL file 'compileProject.jsfl'
- The 2nd parameter - the location you wish to publish the swf
- The 3rd - the publish setting name you wish to use
The source of the FLA i.e. the 1st parameter is the only one that is required, if you only use this parameter then the publish swf location will be the same as the FLA.
The best thing about this option for bulk publishing FLA's is that you have full control over where the swf's publish to, which FLA's you wish to publish and the way they publish. Yes this does take a little longer to setup and can have human error, that is if you hand type it.
So I always write typo's like us all and why not write a script to build a schema file for publishing with the Grant Skinner's JSFL from an existing Flash project file. I used my XmlRemoting classes to read the XML in the Flash Project File then output in Flash the schema text, which you can copy and paste and save to a file. So this way you can easily use the 'JSFL Bulk Publish' option without the tedious process of creating that schema text file :)
You can download all the example files here



No Comments