After reading Mike Chambers' post on executing JSFL files from the command line I decided to do some experiments.

Building on that concept I came up with a little script that opens up an FLA, adds some ActionScript and exports it. You can download the files here (be sure to change the path in the JSFL file to point to the correct locations of your FLA and SWF).

publishFLA.jsfl

fl.openDocument("file:///C:/publishFLA.fla");
var myDoc_doc = fl.getDocumentDOM();
var myTimeline_tl = myDoc_doc.getTimeline();
var myFrame_frame = myTimeline_tl.layers[0].frames[myTimeline_tl.currentFrame];
myFrame_frame.actionScript = "jsfl_txt.text ="This text was added through JSFL!";";
myDoc_doc.exportSWF("file:///C:/publishFLA.swf",true);
myDoc_doc.close(false);

Nothing very fancy in itself, but ofcourse the potential is practically limitless. Imagine creating new SWF files on the fly through a dynamically generated JSFL script. I'm very excited about those developments which may - who knows - even pave the way for a form of Flash Markup Language.

Hope to have more examples up in a little while!

Posted
AuthorPeter
CategoriesFlash