Tuesday, June 20, 2006

FlashDevelop.org: Flash Development IDE for Coders

I've been working on an article on the basics of a development workflow using MTASC (MotionTwin Actionscript Compiler) and bumped into a very impressive IDE for Flash called FlashDevelop.



Wow! Guys, this is a very impressive piece of work. As of this writing it is in RC2 and is very stable so far in my testing.



In the past I've tried using PrimalScript but found it too clunky. Everyone raves about it but I just don't see any benefit to using PrimalScript other than the so-so code completion and at several hundred dollars I could never justify it.


Everyone raves about it but I just don't see any benefit to using PrimalScript other than the so-so code completion ...

Well, if you are a big fan of code completion then you really need to take a look at FlashDevelop. It's code completion works quickly and much better than PrimalScript. The features don't stop there!



MTASC comes with the installation so there is no need to go grab the binaries separately. This really makes it easy to get up and running quickly.



Features that most developers have come to expect from any IDE are there. Syntax highlighting, multiple tabbed document editing and a project panel for managing all of your code and assets are there. What's great is that it is very targeted to the needs of Actionscript development.



For instance, you can add a SWF to the library class path just by right-clicking it and choosing Add to Library. At that point you can reference symbols in the SWF as they will be included by MTASC during compilation.



The Actionscript tab is pretty cool. This tab gives you an outline view of your code so you can quickly locate methods and properties of your classes.


Another big bonus is that you can define regions of code (like Visual Studio) and collapse code based on region.

FlashDevelop also has code folding / collapsing which is so handy. Thanks for including this! Another big bonus is that you can define regions of code (like Visual Studio) and collapse code based on region. If you haven't used a feature like this before, once you try it you will be hooked. It makes it much easier to read through your code when you can collapse areas that your aren't interested in viewing.



Capturing trace output is critical for debugging in Flash. The Flash debugger is all but worthless so this is really your only option. Well, FlashDevelop has several options for capturing trace output. By default it uses something called FlashOut. I've never heard of this until using FlashDevelop but it is incredibly useful. Essentially FlashOut routes your traces through to FlashDevelop via a call to fscommand. FlashDevelop displays your trace output in the output panel at the bottom while your movie is running.



Another option is to use FlashConnect. You can choose this in your project properties on the Compiler Options tab. FlashConnect does its work differently than FlashOut. FlashConnect sends trace output through an XMLSocket that FlashDevelop listens on. One advantage of FlashConnect is that you can send your trace output anywhere, even across the Internet if necessary. Another advantage is that you can categorize your output as INFO, DEBUG, WARNING, ERROR or FATAL. If FlashDevelop is collecting the output, it will colorize the trace information based on how it is categorized. Very cool.



The only issues I have with FlashDevelop at this point is that it doesn't support a couple of keyboard shortcuts I use all the time. For instance I use CTRL-F4 to close a tabbed window all the time. It's pretty standard for apps that support tabs or embedded documents. I also don't see how I can customize the keyboard shortcuts. Granted, I'm thrilled that they have chosen many shortcuts I already use from Visual Studio (F7: build, F5: run etc) there are a couple I'd like to change to be more consistent with other tools I use.



Another shortcut I'd really like to have: F4 to cycle through build errors. In Visual Studio if you have a build error, you can press F4 to jump to the line of code for the first error. Press F4 again to jump to the next error. I hope they add this.