Skip to content
Nov 29 / Peter deHaan

Saving and compacting all open documents in Flash using JSFL

The following example shows how you can use JSFL to save and compact each of the currently open documents in the Flash Authoring IDE by looping over the fl.documents array and calling the saveAndCompact() method.

Full code after the jump.

// JSFL
for each (var doc in fl.documents) {
    fl.trace("Saving and compacting \"" + doc.name + "\"...");
    var success = doc.saveAndCompact();
}
Leave a Comment