Using MTASC to compile Flash Lite (FSCommand2) on OSX


For some time I have used Eclipse, FDT and MTASC as my preferred weapon of choice when doing AS2 development, I switch to Flex Builder for AS3 , Flex or AIR. One spanner in these works when using Mac OSX had been when producing mobile content for FlashLite 2+. Flash Lite 2 and FLash Lite 3 can both use ActionScript 2 and so as MTASC should be able to compile FLash Lite content. However on OS X MTASC still appears to have an issue compiling the FSCommand2() function, this was fixed in teh 1.13 version of the win32 version of the compiler but It seems the OS X version does not include the same fix for FSCommand2(). The FSCommand2() function used in Flash Lite development to control things like the SoftKeys or forcing an application to display at full screen on mobiles or devices.

Last week I took the time to find a way to work around this issue in order to get back to my development tool chain when developing Flash Lite content. For those users that are more experienced with this form of development the only answer seems to be to create a symbol in the library of your fla associate any classes that make use of the FSCommand2 to the new symbol. Make sure the Clip is exported in some fashion, either by physically placing it on the stage, or setting it to export for ActionScript. Next export a stub SWF from the fla. In eclipse, or when using MTASC you will need to use the ‘-keep’ switch on the command line when you run MTASC to compile your Flash Lite content, this will also make sure the Flash Lite swf header will remain in tact as well. This forces MTASC to keep any assets that are already in the target output swf.

It is also worth mentioning that in your application code you will not be able to refer to the class that contains functionality using the FSCommand2. So applications like FDT will think there is an error as you will be unable to define the ‘type’ of your class. A second note is that MTASC will flag that there is a movie clip associated with a class, but that is has not been compiled.


Warning : The MovieClip KeyController needs the class { Class path containing FSCommand2() function } which was not compiled :
Please force compilation of this class by adding it to the commandline.

I have not been able to completely remove the FLA or the Flash IDE completely from my tool chain, but in all honesty I think there are alot of use cases in Flash Lite development that still require a level of timeline usage, so I happy with this compromise.

I have created an example package of files that you can download from here or in the download area.

2 thoughts on “Using MTASC to compile Flash Lite (FSCommand2) on OSX”

  1. I’ve got MTASC compiling FSCommand2() on Mac with FDT. I’m using mtasc-1.13-osx and a customized mtasc std8 lib. The trick is to make a new lib with the contents of the std lib, then copy the contents of the std8 lib over that. If you use the latest one it should have FSCommand2 (careful with the case) already in there…

  2. Hi Rob. Thanks for the tip, just curious where did you download the 1.13-osx binary from. I hunted high and low for that binary but was not able to find it. If you could post a link that would be great to add to/replace this post.

Leave a Reply

Your email address will not be published. Required fields are marked *