JSFL: Batch Publish Flash Files

Categories Flash

This is a script I wrote to batch publish an entire folder of .fla files. The script we use is far longer, as our version is for our courseware folders. In ours, we parse the filename of each to a CSV file with the chapter, section, sub-section, and duration of each .swf.

JSFL rocks.

// pop up a dialog to get the folder, then fetch the files therein
var folder = fl.browseForFolderURL("Choose a folder to publish:");
var files = FLfile.listFolder(folder + "/*.fla", "files");

for (file in files) {
        var curFile = files[file];

        // open document, publish, and close
        fl.openDocument(folder + "/" + curFile);
        fl.getDocumentDOM().publish();
        fl.closeDocument(fl.getDocumentDOM());
}

Comments

Comments

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>