MTASC: Truths Flash Never Told Me



If you're doing some serious actionScripting, then MTASC(Motion Twin Action Script Compiler) is definitely worth a look. MTASC is just what it sounds like - a command line compiler for ActionScript. What is the point of this you may ask? Well, for one, you don't need the Flash IDE to compile your scripts and you can tie MTASC into your favorite development IDE (Eclipse, Code Wright, etc..)

Secondly, in many respects it has helpful features that you just wish were built into the Flash ActionScript compiler. I've only been playing with it for a little while-but here are the things that I've run into:
  • MTASC is definitely stricter. It doesn't allow one-sided expressions. For example, there have been times I've been lazy and tried to do something like this:
      new MyLLC();
    (You might be wondering what the point of this is if this new instance isn't assigned to a variable-sometimes I've done this in order to initialize static variables that belong to the MyLLC class).
  • MTASC will flag unnecessary dependencies. In other words, if my class file imports five classes but I only use four of them in the code, MTASC will tell me one of my import statements isn't necessary. Nice!
  • One mistake I made in a few places was calling a static method as an instance method-Flash doesn't flag this. MTASC on the other hand won't allow things like this.
  • In one case in my code I had boolean ^^ boolean for an exclusive-or which isn't supported in ActionScript (at least as of 2.0). Flash didn't flag this but MTASC correctly informed me that this might be interpreted as a power sign and fail.
  • At one point I had a constructor with a different name then the class it was in (sloppy cutting and pasting will do this to you). Flash just ignored this thinking the different named function was just a method-but MTASC saw that this method was trying to call super() and immediately thought something wasn't right-since super() is only supposed to be called in class constructors. This is the kind of nit picky thing that will save you days of bug hunting.
What's the downside? One thing that came up during the OS Flash Conference was that the creator of MTASC announced he had no intention of supporting ActionScript 3.0. He said instead he was inventing another programming language that MTASC will use in the next version (because every developer out there knows that what we need most is yet another programming language). This strikes me as a terrible move, and I can see it driving MTASC fans back to MMC(Macromedia Compiler).