Create an external .AS file which you #include. If the .AS file is generated then you can easily recompile the FLA using JSFL or my FLA2SWF tool (it's free).
The BAT file for construct will do what you need. I think. What you want to do is set up a list of values that you want to put in the AS file and call another BAT file repeatedly (once for each item in the list).
This mainloop.bat file calls a secondary BAT file (process.bat) once for every item in the argument list. The BAT file doesn't care what you put in there, it will just call process.bat and pass each one.
Code:
@echo off
for %%i in (1 2 3 "dog" "cat" "pigeon" 4 5 6) do call process.bat %%i
All we're doing here in process.bat is creating a file called test.as that creates a var called foo that gets set to the value passed to it. Just replace the REMs with code to compile your FLA to an SWF and you're done.
Code:
@echo off
echo var foo = %1; > test.as
REM
REM do something with test.as here (compile)
REM
using your examples, i can get it to publish the file, but only on the first iteration. as it continues through the loop, subsequent attempts to publish the file throws a 'FLA not found' error.
eg. I get:
Code:
--------------------------------
<filepath>
--------------------------------
OK: <filepath>
--------------------------------
<filepath>
--------------------------------
ERROR FLA not found
OK: <filepath>
--------------------------------
<filepath>
--------------------------------
ERROR FLA not found
OK: <filepath>
The "not found" error is a bit misleading, it's actually complaining because it can't open the FLA because it's still in use by Flash. So I made a few little modifications.
The first change was to make a copy of test.fla using the value passed to process.bat to give the FLA a unique name each time through the loop and we compile that copy of test.fla instead of test.fla itself.
We're now using "call" to start fla2swf instead of just launching it. This ensures that the BAT file doesn't continue until fla2swf returns.
I'm assuming that the BAT files, FLA files and fla2swf.exe are all in the same folder so we can use .\test.fla instead of an absolute path like d:\test.fla, it just makes it easier to move this around.
Finally, I've included a new copy of fla2swf.exe in the attached ZIP file. This one adds a one second delay before doing anything, which gives the last running copy of Flash time to quit and release the FLA it was working with before we try and start another copy. This works on my system but we might have to play with the delay to get it to work for you, I can make that a parameter to fla2swf if we need to play with it.