Simple Command Line Compiler

There’s been a lot of posts about command line Flash compilers lately. Just wanted to share a quick and dirty solution I developed, using… DOS batch files!

Here is the batch file:

@echo off
echo // > tempPublish.jsfl
:start
echo %1
echo filename = "file:///%1"; >> tempPublish.jsfl
echo fl.openDocument(filename); >> tempPublish.jsfl
echo curr_doc = fl.getDocumentDOM(); >> tempPublish.jsfl
echo curr_doc.publish(); >> tempPublish.jsfl
echo curr_doc.close(false); >> tempPublish.jsfl
shift
if "%1" == "" goto end
goto start
:end
echo fl.quit(true); >> tempPublish.jsfl
start "C:/Program Files/Macromedia/Flash MX 2004/Flash.exe" tempPublish.jsfl

just save that in a text file as “flashpublish.bat” or whatever, and use like so:

flashpublish myfile1.fla myfile2.fla pathto/subdir/myfile3.fla
This entry was posted in Extensibility. Bookmark the permalink.

2 Responses to Simple Command Line Compiler

  1. I wonder how you do this with simple bat 🙂

    I used Scite|Flash with “C:\Program Files\SciTEFlash\testMovie.jsfl” (this file contains only one string “document.testMovie();”) and one parameter set in flash.properties such as:

    command.1.$(file.patterns.flash)=”C:\Program Files\Macromedia\Flash MX 2004\Flash.exe” “C:\Program Files\SciTEFlash\testMovie.jsfl”

    Then press Ctrl+1 and F04 will TestMovie 🙂

Comments are closed.