flashcommand Flash command line compiler for OS X

I have built an OS X version of my FlashCommand command line compiler for Flash MX 2004. This uses the Flash MX 2004 extensibility layer to allow you to compile Flash files (FLA) from the command line.

It has a ton of options, and will also catch and redirect any ActionScript compile errors to stdout.

Download FlashCommand

Here is the usage info:

usage: flashcommand -e | -c | -p [-v] [-x] (-s <sourcefile>) ([-o] <exportpath>) ([-t] <timeout>)([-d] <tempdir>) [-j]

Options and arguments:

-a : Prints version and about information.
-c : Specifies save and compact action.
-d : Specifies temp directory that will be used for temporary files. Optional.
-e : Specifies export action.
-h : Prints usage information.
-j : Specifies that the generated JSFL file should be printed. If this option is specified, Flash will not be executed.
-o : Specifies the output file if -e flag is also set. Optional. If not specified, file will be output to same directory as source.
-p : Specifies publish action.
-s : Specifies source file. Required.
-t : Specifies timeout value. Optional.
-v : Specifies verbose mode. Optional.
-x : Specifies whether Flash should be closed after it is done processing. Optional.

Requires that python is installed on your system.

To install, download the file and copy the flashcommand file to somewhere within your path. Make sure to make it executable by running the following command:

chmod 755 flashcommand

If you find any bugs, or have questions or suggestions, then post them in the comments.

12 Responses to flashcommand Flash command line compiler for OS X

  1. rafa3l says:

    Nice work Mike!!I have 2 question, how I can launch from the flashcommand the exported file in Flash inmediately? and is possible to make a keyboard shortcut to run the command externally of the Terminal? for example, if I am in jEdit, how launch it from the shortcut?

  2. mani says:

    LOVE the fact that you got a mac now Mike!! :-)Some of those lovely Win-only featurettes finally coming to a computer ‘for the rest of us’…. 🙂

  3. >#i cant get used to using 1 and 0 for >booleans>false = 0>true = 1use: False and True (capitals

  4. Bob Ippolito says:

    there is also a better argument parsing module called optparse, tempfile.mktemp() shouldn’t be used (use one of the wrappers that cleans up), raising exceptions is better than sys.exit, that list.append stuff is weird (you can print >>fileobject, “””string””” for example.. and fileobject could be a StringIO), etc.Good start with Python though 🙂

  5. E. Wiggin says:

    In a bit of a pickle I am. I am using 2004MX on the MAC and trying to launch various projectors inside the FSCOMMAND subfolder to play from the main projector. The problem I am having is that some of the files have similar names to the .swfs, so I wanted to put them in a subfolder of FSCOMMAND. By doing this I elimate the problems of similar files names getting confused on the launch.How can I get this to happen? I want to put my individual projects in subfolders of FSCOMMAND but everything that I have tried seems to fail. I have tried “lcm/lcmlaunch” “/lcm/lcmlaunch” and “:lcm:lcmlaunch”… nothings doing it. PLEASE!!! Help this lonely little ole soul soon.Many thanksE. Wiggin

  6. Mark Llobrera says:

    Is there a way to set this up to recursively export a batch of .fla files instead of having to explicitly invoke the command on each file? I’m assuming I could run a unix command to find .fla files within a directory and somehow pipe the output to flashcommand, but my unix skills are fairly weak. Any help would be much appreciated.

  7. Marc-André Lavoie says:

    It would be cool to have some sort of a tutorial or explanation on how to use this app as a batch publish utility, for us Unix noobs.

  8. M-A Lavoie says:

    It would be cool to have some sort of a tutorial or explanation on how to use this app as a batch publish utility, for us Unix noobs.

  9. Mike Bedar says:

    for file in `find . -type f -name “*.fla”`; do mv $file ${file%%phtml}php;doneI barely know what I am doing in the terminal, but i figured out how to get this to work on a folder of FLA’s.First, you need to be running bash. If you are not, open the Terminal preferences and change the shell to “/bin/bash”.Next, “cd” to the directory that contains your FLA’s. This script will search subfolders as well.Last, the command to apply the flashcommand function to all FLA files in the current directory.for file in `find . -type f -name “*.fla”`; do flashcommand -pv -s $file ${file%%fla};doneThis will publish EVERY Fla it finds, so it is very important to make sure you are in the correct directory.

  10. Mike Bedar says:

    One more thing.. To make this easier i made a short shell script://for file in `find . -type f -name “*.fla”`doflashcommand -p -y -s $file ${file%%fla}done//I found the -y parameter in the code that closes each Fla after publishing.

  11. G says:

    Hey,How do I put the FlashCommand file into my system so I can then perform the command line instructions? Where do I copy it to?

  12. Kato Kingdick says:

    FlashCommand gives error: “You must specify an action.” But the help file doesn’t give any available actions. Can you post an example about how to use the -e flag?