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.

0 Comments:

Post a Comment

<< Home