<p>Is there a way to call an external script or program from Flash CS3 every time it builds a SWF file?  I'd like to add subversion information using subwcrev - the SVN keywords don't work because they only update when the version class file is updated.</p>

[{'answer_id': 81275, 'author': 'Juan Delgado', 'author_id': 5908, 'author_profile': 'https://Stackoverflow.com/users/5908', 'pm_score': 3, 'selected': True, 'text': "<p>I'm not sure what are JSFL capabilities these days, but I'd say inside Flash IDE is your only bet. JSFL is a language to extend the Flash IDE, but I'm not sure you can do this.</p>\n\n<p>On a related note, adding SVN information to your SWFs is not trivial. You'd probably need SVN hooks to put the information <em>before</em> actually compiling the SWF itself. </p>\n\n<p>I doubt you can do this compiling with Flash IDE but I'd be more than happy to hear otherwise.</p>\n"}, {'answer_id': 81944, 'author': 'Simon', 'author_id': 15371, 'author_profile': 'https://Stackoverflow.com/users/15371', 'pm_score': 0, 'selected': False, 'text': '<p>With thanks to Zárate, it looks like JSFL is the answer, or at least part of it.  I can\'t get flash to run external scripts, but I <em>can</em> get external scripts to run flash; so I have two scripts now; build.bat and build.jsfl</p>\n\n<p>build.bat:</p>\n\n<pre><code>subwcrev . Version.svn.as Version.as\nIF ERRORLEVEL 1 EXIT /B $ErrLev\nflash.exe ./build.jsfl\nIF ERRORLEVEL 1 EXIT /B $ErrLev\n</code></pre>\n\n<p>build.jsfl:</p>\n\n<pre><code>fl.openDocument("file:///movie.fla");\nvar documentDom = fl.getDocumentDOM();\ndocumentDom.exportSWF("file:///movie.swf",true);\ndocumentDom.close(false);\nFLfile.remove("file:///Version.as");\n</code></pre>\n\n<p>I\'ve added build.bat to my project; if I double-click on build.bat, the project builds the SWF movie with the SVN version info.  That works from within the Flash IDE or from the file explorer.  If I forget, and click on \'test project\', then the build fails because it can\'t find Version.as.</p>\n\n<p>Thanks again, Zárate!</p>\n'}, {'answer_id': 265245, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>lessen i do this \nmay it\'s us full for you\'re too</p>\n\n<p>var fileURL = fl.browseForFileURL("open", "Select file");</p>\n\n<p>fl.openDocument(fileURL);</p>\n\n<p>var documentDom = fl.getDocumentDOM();</p>\n\n<p>documentDom.exportSWF("movie.swf",true);</p>\n\n<p>documentDom.close(false);</p>\n'}]
['https://Stackoverflow.com/questions/81209', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15371/']