Export multiple .fla files using .jsfl

Another very basic information. I had to export multiple .fla files so I wrote my first .jsfl file:

// Binary Directory path (file:// syntax)
var binDir = "file:///Users/.../swf/";
// Source Directory path (file:// syntax)
var srcDir = "file:///Users/.../fla/";
// .fla file names
var fileNames = new Array( "file1", "file2", "file3" );
 
var fileName;
var fileSrc;
var fileBin;
var fla;
 
for ( var i = 0; i < fileNames.length; i++ )
{
	fileName = fileNames[ i ];
	fileSrc = srcDir + fileName + ".fla";
	fileBin = binDir + fileName + ".swf";
 
	fla = fl.openDocument( fileSrc );
	fla.exportSWF( fileBin, true ); 
 
	fl.closeDocument( fla, false );
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.