Looping over open documents in Flash using JSFL

by Peter deHaan on December 1, 2008

in JSFL

The following example shows how you can use JSFL to loop over each open document in the Flash Authoring IDE using the fl.documents array.

Full code after the jump.

// JSFL
fl.outputPanel.clear();
var docs = fl.documents;
if (docs.length > 0) {
    for (var i=0; i<docs.length; i++) {
        var doc = docs[i];
        fl.trace(doc.name + ": ActionScript " + doc.asVersion.toString());
    }
} else {
    fl.trace("No Flash documents currently open.");
}

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Previous post: Displaying a list of Video objects in your Flash document’s Library panel using JSFL

Next post: Dynamically creating an input text field in ActionScript 3.0