FlashCommand Flash 2004 Command Line Compiler

Well, I am finally releasing the first public version of FlashCommand. FlashCommand is a command line compiler for Flash MX 2004 Pro.

I am sorry it took so long to release, but I have been super swamped. I also ran into a bug where the installer no longer worked (it errors when trying to automatically set the path environment variable). This bug delayed the release, and I ended up just removing the installer. Hopefully, I will have time soon to track the issue down, and release an updated version with the installer.

IMPORTANT : This is something that I did in my own time, and is not supported by Macromedia. Use at your own risk. If you run into any issues (and you will), please post them in the comments. This will make it easier for me to keep track of issues and suggestions.

Here is a screen shot of ActionScript code being compiled from EditPlus. Notice that it catches the output (it will also catch compile errors if they occur). Btw, if anyone can figure out how to get this to work with SciteFlash, post the info in the comments.

Note, this is Windows only and requires the .NET framework. Sorry about that. I will try to make a portable version in the future.

Download FlashCommand

Download FlashCommand Source

Here is the usage information (from the readme):

FlashCommand.exe -e | -c | -p [-q] [-v] [-x] [-q] (-s <sourcefile>) ([-l] [<logfile>])
	([-o] <exportpath>) ([-f] <flashpath>) ([-t] <timeout>)

-version : Prints out information about the program.
-help | Prints out usage information.

-e : Specifies export action.
-c : Specifies save and compact action. 
-p : Specifies publish action.

-l : Specifies whether output should be logged to a file. Optional. Takes an optional
	param specifying the path to the log file. If not specifies, log files will be
	place in \log
-q : Specifies quite mode. Optional. If specified, no output will be written to console
	(although it may still be logged).
-v : Specifies verbose mode.
-d : Specifies temp directory that will be used for temporary file.
-s : Specifies source files. Required.
-o : Specifies the output file if -e flag is also set. Optional. If not specifies,
	file will be output to same directory as source.
-x : Specifies whether Flash should be closed after it is done processing. Optional.
-k : Specifies whether the temp jsfl file should be deleted. Optional.

-f : Specifies Flash executable path. Optional.
-t : Specifies timeout value. Optional
-d : Specifies temp directory. Optional.

Thanks for Robin Debreuil, Owen van Dijk who provided valuable input and help.

Download FlashCommand

Comments

  1. November 1, 2003 3:56 PM
    great program :) btw, here's how you can add this to SciteFlash (v 1.53): go to Options/Open flash.properties and finde the line that says "Commands" .. (around line 162) .. enter your commands there (which will appear under Tools).. for example, here i added the flashCommand -help and publish command: #flashCommand command.name.4.$(file.patterns.flash)=flashCommand help command.4.$(file.patterns.flash)=FlashCommand.exe -help command.name.5.$(file.patterns.flash)=flashCommand publish command.5.$(file.patterns.flash)=FlashCommand.exe -p -v -s $(FileNameExt) hope it helps :)
  2. Mike Chambers
    November 1, 2003 4:13 PM
    Sweet. Works perfectly. Even catches the output and compile errors. mike chambers mesh@macromedia.com
  3. Mike Chambers
    November 1, 2003 4:31 PM
    fyi, on SciteFlash, any way to have it automatically save the file(s) before it runs the command? mike chambers mesh@macromedia.com
  4. November 1, 2003 4:52 PM
    for automatically saving - i don't know... but if you set the line in SciteGlobal.properties to: # Confirmation for saving files before building/compiling are.you.sure.for.build=1 it will prompt you to save the file before it runs the command (Options/Preferences/Global Options)
  5. November 3, 2003 11:38 AM
    Awesome stuff, loving it! ;) Now if only we could compile without launching the graphic part of the IDE...
  6. November 3, 2003 11:55 AM
    is this really windows only or is it possible to make it working with rotor ?
  7. beek
    November 3, 2003 12:09 PM
    will this ever be available for linux?
  8. mike chambers
    November 3, 2003 6:20 PM
    >is this really windows only or is it possible to make it working with rotor ? Yes. It is windows only, because it accesses the registry. If there is enough interest then I will try and make it work on OSX when i get some time. mike chambers mesh@macromedia.com
  9. deogee
    November 4, 2003 10:48 AM
    Is flash MX 2004 being installed a requirement?
  10. November 4, 2003 12:16 PM
    how can i run FlashCommand from Ant?
  11. mike chambers
    November 4, 2003 12:33 PM
    >Is flash MX 2004 being installed a requirement? Yes. mike chambers mesh@macromedia.com
  12. mike chambers
    November 4, 2003 12:34 PM
    >how can i run FlashCommand from Ant? yes mike chambers mesh@macromedia.com
  13. Mike Evans
    November 4, 2003 6:44 PM
    This is really neat... and chance you'd be willing to release the source?
  14. mike chambers
    November 5, 2003 1:01 PM
    >This is really neat... and chance you'd be willing to release the source? Yes. Once I get the time to clean it up. mike chambers mesh@macromedia.com
  15. ryan quigley
    November 5, 2003 1:33 PM
    Would LOVE an OS X version...
  16. November 10, 2003 6:43 PM
    i would also really like to see this on panther.
  17. eric
    November 11, 2003 7:18 PM
    i'll write an Ant task for this when you post the source code. Where should we look for it?
  18. Phil
    November 12, 2003 7:30 PM
    Hi! I'm very new to flash, and have only just tried editplus. I like both though, so could you please tell me how to set up editplus like you have in the screenshot, so that I can compile from within editplus? thanks, Phil
  19. Mike
    November 17, 2003 3:52 PM
    I downloaded your compiler, extracted it, set the path. But when i run the compiler, i get a program failed to initialize error. Help?
  20. November 26, 2003 6:33 PM
    Great news I am really interested in the Ant task. This is going to be a great tool for those of us building real applications in Flash. This confirms that Macromedia is really serious about being a production application platform. The new Actionscript 2.0 with a production compiler is a compelling reason to upgrade from MX.
  21. Henrik
    December 3, 2003 3:44 PM
    Hey folks. Probably a silly question, but I cannot get the flashcommander to work. When I run the command: flashcommand -s clientInfo.fla the trace says the following: An Error occured : Object reference not set to an instance of an object. at com.macromedia.mesh.Flash.FlashInfo.CreateFlashVersionTable() at com.macromedia.mesh.Flash.FlashInfo..ctor() at com.macromedia.mesh.Flash.FlashCommandRunner.DetermineFlashExecutablePath(Arguments arguments) at com.macromedia.mesh.Flash.FlashCommandRunner.Run() at com.macromedia.mesh.Flash.FlashCommandRunner.Main(String[] args) Please help me! I realize that there is something here I do not understand, so the error is probably easy to fix. I really need this tool to work in my project! Thanks, Henrik
  22. mike chambers
    December 3, 2003 4:38 PM
    hmm... What OS? Did you install the .NET framework? mike chambers mesh@macromedia.com
  23. Henrik
    December 3, 2003 5:31 PM
    I installed thed .net1.1 framework on win xp Henrik
  24. Henrik
    December 4, 2003 1:07 AM
    I also tried to install the .net SDK, but the same problem occurred. We want to evaluate this tool for our buildsystem. We are building tests for all kids in the norwegian elementary school (4th, 7th, 10th and 11th grade). There are approx 1500 testlets (flashfiles) that need to be compiled, and a commandline option is the only option for us. So I would really appreciate some help in making this promising tool work. Best regards Henrik
  25. Sandor
    December 4, 2003 6:37 AM
    Yeah, an OS X version would be great
  26. henrik
    December 4, 2003 11:57 PM
    I made it work on win 2k. On the xp version I still cannot make it run.
  27. Kyle
    December 7, 2003 6:15 PM
    Will there be a Java version? Then we have a cross-plaform solution.
  28. December 9, 2003 9:57 PM
    Sounds great. I am trying to get it to work on XP but no luck so far...
  29. Xeal
    December 11, 2003 8:53 AM
    >fyi, on SciteFlash, any way to have it automatically save the file(s) before it runs the command? # SciTE saves the file whenever the SciTE application loses focus save.on.deactivate=1
  30. December 14, 2003 3:29 PM
    Hello !
  31. January 12, 2004 5:05 PM
    "When the machine compiles your code, however, it does a little bit of translation. At run time, the computer sees nothing but 1s and 0s, which is all the computer ever sees: a continuous string of binary numbers that it can interpret in various ways." ???
  32. Quentin
    February 5, 2004 7:27 AM
    !! hello !! I'm french student and i downloaded your command-line flash compiler but the application doesn't work because i can't decompress it ?? could you help me ?? thanks !!
  33. Craig
    February 18, 2004 1:26 PM
    Is it possible to choose a profile to publish the FLA with?
  34. February 20, 2004 6:50 AM
    Hi All, I like to make charts. like candle chart and line chart graph etc. i have downloded one component from the macromedia site. iam not able to customise that component. pls help me whare i can find the charting components and in customise Thank u all Murali
  35. February 25, 2004 8:30 PM
    I was looking for ages for such a CMDline compiler!!! I use EditPlus a lot for actionscripting, so this one fits to my needs totally. Great work man! I hope you can expand it (e.g. update it often, maybe add new features). Are there ANY restrictions on this, maybe language (some byte-codes not to be translated etc) specific issues?
  36. February 29, 2004 4:08 AM
    still waitin for the win edition of this nice tool. :(
  37. mike chambers
    March 2, 2004 4:03 AM
    fyi, the downloads have been fixed now. mike chambers mesh@macromedia.com
  38. stef
    March 4, 2004 6:02 PM
    gr8 ! is there a eclipse plugin available too ???
  39. Jeremy Stein
    March 4, 2004 9:04 PM
    Any hints on how to do this for MX v6?
  40. March 10, 2004 1:34 PM
    Great tool. I'd like to make it work running under a windows service without interactive privs (automated build server); possible?
  41. artur
    March 18, 2004 5:49 AM
    Mamo ja spróbuje porozmawiac z facetka. jak mi sie nie ude to nie pojade do szkoly a wezme od dentystki zwolnienie artur
  42. Joe
    April 8, 2004 3:10 AM
    I run FlashCommand from a scripting program called Visual Build Pro. The script publishes 101 FLA files in a loop, with a 2 second delay in between. Periodically, the build fails to create SWFs, but no error code is returned, so the script does not know there is a failure. When this condition occurs, we find that Flash.exe is running, but not interctively. As if it were hung in the background. Two questions: -- How can I capture a return code to detect failures? -- What might be the cause of these intermittent failures?
  43. pi
    April 16, 2004 1:10 AM
    what is the jsfl code for import and export audio ? input == wav; output == swf
  44. Samson Chan
    April 21, 2004 10:33 AM
    Does this work for Flash MX (not 2004)? If not, is it possible to get this working for Flash MX?
  45. mike chambers
    April 21, 2004 11:49 AM
    No. It utilizes the new javascript extensibility layer in 2004, and thus will not work on MX. mike chambers mesh@macromedia.com
  46. Deniss Larka
    May 27, 2004 7:03 PM
    I get launched Flash with opened export settings dialog every time i invoke flashcommand. Is it ok ?
  47. nouriana
    May 28, 2004 1:36 PM
    no comment
  48. Richard T-J
    July 25, 2004 1:03 PM
    Hey Mike, Cool app, very useful (but...) I'm doing work with sequencial swf files for a mapping utility, and I often have over 30 swf files. Is it possible to add a cmd line parameter to also close the source file (but leave flash open), maybe an additional option to save & close. Also cool, but not vital would be the option to support wildcards in the source name: e.g. my files are often map_r1_c1.fla map_r1_c2.fla map_r2_c1.fla ... etc so a param of -s map_r?_c?.fla would be great. Cheers, and thanks, Richard
  49. July 29, 2004 1:55 AM
    Mike, I am not a C programmer. Everything I do is web-based technologies. (PHP, SQL, HTML, FLASH etc). Why would I want a compiler for Flash actionscript. Would this product allow me to hide my actionscript code from prying eyes? This would be of interest in a component I've taken two years to create and now must expose my code to sell my product. Your thoughts? Jay Lepore FlashBOMB.com
  50. July 29, 2004 10:10 PM
    Mike, I'm interested in combining several .swf files on the fly (dynamically selected) into a container .fla and then writing the end .swf file for production. Is there anything out there than can do this at a command line level? For example, calling it from a C# application. cheers, Bill
  51. August 23, 2004 6:44 AM
    WOW, thanks, that command line Compiler is really great. See Ya Gima
  52. Diego
    August 26, 2004 7:57 AM
    Great job :) But for integration with se|py actionscript editor?
  53. Wawb
    August 31, 2004 3:19 AM
    I've got a class directory: myBaseClasses And I've got a bunch of directories with .fla's where I set the publish settings to include ..\myBaseClasses in the classpath. When FlashCommand publishes (-p) my .fla files, I get no errors, but I also do not seem to be getting the base class definitions. Ergo, none of the .swf files behave at all as they are supposed to.
  54. ionut-stoica
    September 29, 2004 9:12 PM
    You see mike, everyone is somehow asking for a real standalone fla2swf compiler or similar, but this will be a "too killer application" for products like flex. For the name of eternity, such a compiler would be able to creat up2date swf files(of current FlashPlayer VM). I see some people placed their fun&struggles on the net. I know about a software called FLASM, its nice, its real, its up2date, but it is EXCLUDED for a time saving application. ASM <- yaiks Then there is that ming php extension.That looks promissing, beeing able to do understandable operations that generate swf files on the serverside. But the major issue of such a compiler is that it might go on macromedia's own software. For example : 1) Alternative to Flex - a PHP based sollution(Not using MM Flex's component architecture - maybe something different) of doing RAD on the server side with all the benefits of Flex. 2) Alternative to Flash IDE - on my dear linux box here. A gtk composition canvas like DIA or the one that they use with sodipodi svg editor. Conclusion: My linux machine cries for Macromedia's products.It in fact SCREAMS.But not how people are tring to use it , like using wine or such(wich always gives me a feeling of unstable and illegal wherever i see it here in Romania), a native port. Its a lot of struggle getting a computer full set up for design and multimedia here. I pay Windows, I pay firewall+antivirus, I pay Macromedia ( Flash and Fireworks make me complete ) , i just bought Photoshop + Visual C# + a dozen more small software for autoruncd makeing&managemet+pluggins. Its really a hell of a lot of money. And this prevents most of real software industry guys here from investing. Expeling the operating system from the list gives a lot of hope. And gives them a straight line of legallity and respect. I know so many people and companys here using unlicensed flash + dreamweaver + fireworks copys that if you see their work you would say the earn a lot of money and they actually do, with 3-4 medium flash sites they could buy a license of flash at least, but they dont. And imposing this by force wont help, it is a society that learns and learns to respect software cause this is what provides them food.
  55. November 6, 2004 7:30 PM
    Love it. I have Ant using it to compile my movies, but when I use the command line -x to shut down flash after publish, it will sometimes miss files in my file list ( going to fast? ). Also, it leaves the files open. Is there a way to say " close file after publish"?
  56. January 11, 2005 10:34 AM
    I need some scripts in Flash Mx 2004 about running any application or programs in their path (where the resource it is). Because i want to make a CD with an autorun file. Thanks.....
  57. January 11, 2005 10:39 AM
    I need some scripts in Flash Mx 2004 about running any application or programs in their path (where the resource it is). Because i want to make a CD with an autorun file. Thanks.....
  58. jules
    January 19, 2005 5:06 PM
    I may be missing something, but is it not possible to specify the "test movie" action? This tool is obviously handy for final build of a project, but I was hoping to use it from SE|PY to test my movies as well. This tool would totally rock if it didn't start the Flash IDE at all! But I'm thinking that's a far greater task than just controlling the IDE programmatically. BUT, having said that, all these tools (FlashCommand, SE|PY, Scite|Flash, etc) indicate a failing of the Flash tool itself. This may not be an appropriate forum, but: 1) When do we get a decent code editor?! 2) When do we get a production-level compiler that doesn't interrupt my flow for two minutes while I compile my SWFs?! I'd write one myself if it was MY job ;-) Thanks for the useful tool. I'll be using it to build our FLAs for deployment, but that's about all at present.
  59. FRANK
    January 26, 2005 11:52 PM
    >This may not be an appropriate forum, but: >1) When do we get a decent code editor?! >2) When do we get a production-level compiler >that doesn't interrupt my flow for two minutes >while I compile my SWFs?! >I'd write one myself if it was MY job ;-) Don't expect anything any time soon. I have a feeling MM are pushing FLEX at the expence of those of us that want to use plain flash to do the same thing. This will see a general shift towards the flash IDE being more aimed towards designers. All new cool components and technologies that could have been used in flash will be bundled with FLEX. You cant blame MM for trying to make more money and create vendor lock-in really. Have no fear though open souce has already provided an alternative. mtasc + eclipse + asdt
  60. January 27, 2005 5:33 AM
    My favorite editor is Professional Notepad. http://www.atechgroup.net Smart editor with easy interface
  61. Steve Buckley
    January 27, 2005 6:42 PM
    Can anyone tell me the more detailed syntax for the -e parameter. Could I export version 6 and version 7 files in some kind of batch process?
  62. HRK
    February 9, 2005 7:35 AM
    can you help me to developpe a QCM questions in my flash documents i use a quiz template of flash mx 2004 professional but i found a problems to navigate when i integrate it in my document
  63. Billtom
    February 24, 2005 12:31 PM
    I am TrackBacked this web: http://www.czhj.info/archives/000010.php
  64. poonam
    March 16, 2005 4:33 AM
    Hi, This compiler is good.But is there any way to publish an fla with an fscommand option.
  65. Sarah
    March 22, 2005 12:47 PM
    Is it possible to remove the functionality where specifying a path to the flash file is optional. In Editors like SEPY, you can Flush your actionscript and it will export and run the fla file that has focus in Flash at that time. As long as you have the right Flash file open, you're in business. The benefit of this is that I don't have to change my scripts that run FlashCommand, with a path to the files I'm working with each time. Ultimately, what I'm trying to do is come up with a good way to test my flash files when editing ActionScript using jEdit. Has anyone else had experience with this? Thanks!
  66. poonam
    April 11, 2005 2:19 AM
    Is the Ant target written for the flashcommand?If yes how to use iy? Where can i find the details regarding the same?
  67. Tod
    May 19, 2005 12:37 AM
    Yes Professional Notepad is very good! I do all my php stuff in it [url=http://www.atechgroup.net]Professional Notepad Official Site[/url]
  68. May 23, 2005 3:35 AM
    I have a little question about timeout. What units (seconds, milliseconds) should be used? Can you put an example here?
  69. May 24, 2005 2:43 AM
    ini gue
  70. June 14, 2005 5:03 AM
    Newbie question: Can you specify multiple source files at once? How do you delimit them?
  71. scott
    August 9, 2005 8:22 AM
    great tool. just thought Id point out another very handy tool for joining and creating .swfs called swftools. this has saved my bacon loads of time by allowing me to add extra code to a bunch movies by combining them with an actions movie.
  72. AnhQuan
    September 26, 2005 5:01 AM
    Thankx, Great work !
  73. Jen
    November 13, 2005 5:21 AM
    Hey... I don't know if you'd have the answer to this, but I'm trying everyone I come across. I had Flash Mx Pro 2004 7.0 on my computer (windows 2000) but ran into a problem with my c drive not too long ago and had to re-partion drive and re-install everything. Now, flash won't install. Everything else will. But when I try to install flash I get this dll function error: Error number: 0x80040703 dll function Macromedia_Licensing_Installer.CdaSysInstallEx2 Ever heard of this? I can find no solution online or at Macromedia. Any suggestions?
  74. Will
    March 3, 2006 9:32 PM
    Is there currently a OSX version of the FLASH COMMAND for Macromates text editor??? If so can someone please point me in the direction to download. I have tried so many of these editors Sepy is buggy, Primal is Windoze only, BBEdit sucks......... Thanks
  75. Steve Buckley
    March 27, 2006 7:12 AM
    Mike, This is sort of an off-topic request, but is there a way to launch Director to compile an app via an ant build file. What I am thinking of is if you have a hybrid Flash and Director program you modified some of your flash elements (classes) and then ant build all the flash dependancies and then launches Director to do the final update and compile of the application
  76. April 19, 2006 10:52 AM
    Anybody got this working for Flash 8 on OS X? Thanks, Sam
  77. May 16, 2006 2:49 AM
    Hi, Great tool. Quite usefull. Would it be possible to give publish commands (like publish version flash 6) ? Thanks, Morgan
  78. Charlie Skinner
    June 9, 2006 7:56 AM
    Is it possible to use this with a Project file? Or is there anyway to know if/when the publish has completed?
  79. Lei
    June 28, 2006 12:39 PM
    I tried this on PC with Flash 8, it open the flash 8, but always popup a window saying "Failed open document.", is there any flash 8 version for this great tool? Or am I setting it wrong? Thanks!
  80. Paul
    July 20, 2006 3:31 PM
    Hi, I use it with Ant and Flash 8, Write me if you want this build code. With my first 15 files it have been working fine. but with other files it miss some files. parameters used: Flashcommand -p -v -x -s my_file.fla its part of the log file: task.compile: [exec] Enabling Verbose mode. [exec] Using Source File : bonusGameSpin.fla [exec] Using Temp Directory : C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ [exec] Output File : bonusGameSpin.swf [exec] Starting Flash Process. [exec] ...... [exec] Total Process Time : 0m:5s:93ms [exec] Cleaning up temp files. [exec] Exiting. flash.bgWheelbonusGame.compile: task.compile: [exec] Enabling Verbose mode. [exec] Using Source File : bonusGameWheel.fla [exec] Using Temp Directory : C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\ [exec] Output File : bonusGameWheel.swf [exec] Starting Flash Process. [exec] ... [exec] Total Process Time : 0m:2s:46ms [exec] Cleaning up temp files. [exec] Exiting. it looks like both files where compiled, but bonusGameWheel.fla was not, and it didnot show any error message. Some idea?
  81. August 11, 2006 11:24 AM
    This is sort of an off-topic request, but is there a way to launch Director to compile an app via an ant build file. What I am thinking of is if you have a hybrid Flash and Director program you modified some of your flash elements (classes) and then ant build all the flash dependancies and then launches Director to do the final update and compile of the application
  82. September 5, 2006 12:27 AM
    Hey, is there any updated version and how does this relate to flashdevelop.org?
  83. October 4, 2006 12:52 AM
    I'm extremely interested in a command line compiler for flash/director combo's as well.
  84. October 5, 2006 6:22 AM
    Hello, first of all, great idea to compile flash via cmdline. But i guess, somevery important thing is missing here; the zipfile itself. Also is there an updated version to use with Flash 8, e.g. Flash 9alpha? I really would enjoy to ucompile from te EditPlus editor. Thank you very much!
  85. Omar sharifa
    November 6, 2006 4:33 AM
    that was Realy great Pro. ! I wanna Ask Maybe different thing ! Can we By using Flash macro. Action scripts , Do operating actions , like make Format for the PC as example ! Thx for time !
  86. January 18, 2007 8:41 AM
    okay here goes, I am using Flash MX on a PC. I have a command file and 2 .jsfl files that were created for Flash MC on MAC and I want to use them on my computer now. I can't find the proper folders to install these into. I put them into my keyboard shortcuts folder in macromedia flash MX, and they aren't showing up in my list when I go into MX, I did install both of the .jsfl files into my commands folder for Flash 8 and it works fine, they showed up in my flash 5 commands drop down inside the program and the shortcut is working fine - when I go here: C:\Documents and Settings\susan.chaisson\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Commands there is no folder for Flash MX so it's not showing up - Do you know where I can or should be installing these files to work in Flash MX? Thank you Susie
  87. regin
    January 21, 2007 11:08 PM
    how to publish a .fla file to a .swf file for eg the .fla file is sm.fla is this syntax correct FlashCommand -p -s sm.fla -o smoutput.swf
  88. Fazeel Gareeboo
    March 16, 2007 1:02 PM
    Thanks for posting this ! Is there anyway to say publish a swf from the command line without firing up Flash author and have it bring up all its menus, etc... ? Maybe run it up in a 'silent/resident' mode and we can then fire off a number of command line publishes ? Thx
  89. M.AHMAD
    April 10, 2007 2:27 AM
    Hello, first of all, great idea to compile flash via cmdline. But i guess, somevery important thing is missing here; the zipfile itself. Also is there an updated version to use with Flash 8, e.g. Flash 9alpha? I really would enjoy to ucompile from te EditPlus editor. Thank you very much!

Post a comment




Remember Me?

(you may use HTML and Quickcode tags for style)