Thursday, September 09, 2004

I had this problem...

My day to day ActionScript workflow is starting to look more and more like the process that I'm reading about in XP books.

  • Create a Failing Unit Test

  • Get the test to Pass as Simply as possible

  • Refactor

  • Repeat



In ActionScript, the refactoring part is a giant pain. Thanks to the major lack of a quality IDE.

I use Sapien PrimalScript to write code and it is truly the best ActionScript 2.0 editor available on the market today.

As long as you create a "PrimalScript Project File", it will provide code-hinting (PrimalSense) and auto-complete with menus that include MY custom classes and their public members. (*Also whatever is in your Macromedia/Classes directory)

The tough part comes in with regard to managing that Project File. I'm cruising along creating new classes and modifying existing ones. I feel like things are working out great. Then I need to bring my project file up to date so that PrimalSense works. This was kind of inconvenient, but tolerable, until I recently started trying to work with a "core" package of shared, abstract classes and then multiple other packages of concrete classes that in many cases extend the shared functionality.

This means that I suddenly needed to keep multiple project files "synched up" with a single "core" directory and current with regard to their own concrete classes. This process became clearly unmanageable in about 10 minutes.

ENTER JSFL!

So, I sat down and wrote a JSFL script that will:

  • Allow a user to point it at 1 to n directories

  • Search through them in order

  • Find each file that matches a certain expression

  • Create a single PrimalScript Project that displays all chosen directories as if they are all in the same place!


It's not quite fully complete yet, but it serves my needs. As an experiment I even pointed it at the Macromedia/Classes directory. This was a little bit time-consuming, but worked also.

For the short term, I'm going to post the mxp here for whomever wants to take a look but you should be warned of a few things:

  • This isn't production ready

  • This will not be here long

  • This is *not* open source code

  • This belongs to Ali Mills and I

  • This has a couple of bugs


Ultimately, we're planning on adding the following to a custom UI and selling it for $5 or $10 bucks:

  • User-driven Regular Expression for included/excluded files

  • User Selection of 1 to n directories

  • User Selection of Project File Name


Once we built this thing and got it working for PrimalScript, someone asked us for a similar utilty that would output a Flash Project File (FLP). Personally, I can't see the value in using the Flash IDE as a text editor, but who am I to criticize?

So we ported over what we had and added FLP output. This gets a little bit complicated because the Flash IDE does not respect that an "open" project file has changed, but we worked around that with some notifications to the Output Panel.

If you're tired of trying to keep your PrimalScript or Flash Project files in synch with your constantly-changing ActionScript packages, feel free to download this MXP and let me know what you think!

Thanks.

AsUnit Cross Platform Support Released!

Ali and I finally got around to full cross-platform support in AsUnit!

We have released the .mxp installer and the source code on sourceforge.

Some features include:

  • Custom Unit Test Output Panel will provide instant feedback related to the status of your tests. This panel is accessible to the .swf file both locally in the Test Movie Player, and remotely from a .SWF running the browser.

  • Integration with Flash MX 2004 IDE Output Panel

  • Create Class Command will auto-create the Class in the package defined and an associated TestCase that has one passing test and one failing test.

  • Create Test Suites Command will recursively search for class files with the following name *Test.as and create TestSuites that instantiate them all.

  • External Debug Output that will allow you to view Test Output (using Sys.println("message");) even from .SWFs running outside the TestMovie player.

  • Simple .MXP installation/uninstallation using Macromedia Exchange file formats.

  • No Library or asset manipulation required on Flash Timelines

  • Open Source (LGPL License) so that you can fix whatever problems you perceive.

  • Integrates with Built-in ClassPath so that all newly created libraries are available to any files or projects that you are working on.

  • Immediately Available to all Existing Flash ActionScript 2.0 Projects

  • PrimalScript will provide code hinting for newly created custom classes.

  • Applications under test can be exported for the Flash 7 or Flash 6 player.



We have announced the first weekly meeting of the "Design Patterns Study Group".



The Design Patterns Study Group is a semi-formal organization of professional application developers that are interested in a deeper comprehension of design patterns, refactoring, test-driven development and other Agile development processes.We will meet every Wednesday to present and discuss in detail a single design pattern. All pattern examples will be presented in Flash ActionScript 2.0 and proofed using AsUnit.




There should be more info on my website...