Automated publishing of FLA files has been possible in Flash since at least Flash 8 using JSFL so why use a tool FLA2SWF? Flash doesn't provide this functionality out-of-the-box, so you'll have to find and install an extension that works with the version of Flash you're using. FLA2SWF works with Flash 8, Flash CS3, Flash CS4 as well as older versions of Flash that don't have JSFL support. Adding FLA2SWF to your existing build process is quick and easy.

Before you start drooling and dreaming about recovering the FLA source from SWF files, we didn't reverse engineer the FLA format and we don't know of any undocumented APIs in Flash. We did this the hard way. FLA2SWF uses Flash to open the FLA file and publish the SWF, it just automates the process so you don't have to do it yourself.

We all have better things to do than watch a directory full of FLA files publish themselves, but you don't want to let a publish error slip by while you're not looking. FLA2SWF records any errors that are generated during the publish process and generates a report for you that looks something like this:

--------------------------------------------------------------------------------
C:\Documents and Settings\User\Desktop\test1.fla
--------------------------------------------------------------------------------

OK: C:\Documents and Settings\User\Desktop\test1.fla

--------------------------------------------------------------------------------
C:\Documents and Settings\User\Desktop\test2.fla
--------------------------------------------------------------------------------

FAILED: C:\Documents and Settings\User\Desktop\test2.fla

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 2: Statement block must be terminated by '}'
{

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 19: Syntax error.
x.othermethod("otherargument");


The output is formatted so you can easily search for OK: or FAILED: to find out which FLA files worked and which ones had errors. The error text is taken directly from the Flash output window so you can tell exactly what went wrong in each case.

That all looks good on paper, but can FLA2SWF really deliver? The only way to find out is to try it. There is only one argument required called filespec and it must be a fully qualified path to the FLA file. You can't just pass the name of the FLA file, even if it is in the current directory.

usage: fla2swf.exe filespec

example: fla2swf.exe c:\project1\flas\first.fla

FLA2SWF uses Flash to open the specified FLA file, tells Flash to publish the FLA file and then waits for the publish operation to finish. If there are errors in the output window, these are extracted and written to the report file.

Tip: If you want to make sure that your FLA files are always opened in the correct version of Flash instead of the version happens to be associted with the FLA extension then check out FLAver, another very useful FREE tool by Northcode.

The report file will always be called fla2swf.txt and it will be created in the same directory where fla2swf.exe is located. The contents of the report file will never be overwritten. Each time FLA2SWF is called it will append the results of the publish operation to the end of the file. You may want to delete this file before you start to process each batch of FLA files.

FLA2SWF only works with one FLA file at a time. To process multiple FLA files you will have to create a batch file that calls FLA2SWF once for each file you want to publish. For example:

fla2swf.exe C:\Documents and Settings\User\Desktop\test1.fla
fla2swf.exe C:\Documents and Settings\User\Desktop\test1.fla


FLA2SWF is able to detect when a publish operation has failed when it see that the output window is open and there are errors in it. This state is easy to recognize and Flash can be closed quickly. In the case of a successful publish, the output window won't be opened so FLA2SWF waits a few seconds to make sure it's not just a slow machine. So, ironically, a publish operation that fails will complete faster than one that succeeds, unless the output window is open by default. This depends on whether the output window was open when you closed the last FLA you were working on. It's not really THAT important, but it explains why FLA2SWF works slower when the publish succeeds.

Important There's one thing that can trip up the automated process and that's the Missing Font Warning dialog (see below) that appears when you open an FLA that uses a font you don't have on your system. If you're watching a batch process you can dismiss this dialog, but if you don't, it will stop the publish process in its tracks. FLA2SWF expects that you'll have all the necessary fonts. If you don't, then you'd better check the Don't warn me again checkbox or your automated process will continue to fail.



No installer is required, FLA2SWF is completely standalone and was designed to run on all current versions of the Windows desktop operating systems and works with all versions of Flash from Flash MX (6) to Flash CS4 (10).

Version: 3.0
Released: November 27, 2008
Download: fla2swf.exe (64KB)