Productive Tools on top of Flex Builder 3

As I got introduced to Flex world some times back, I started using Flex Builder as an IDE, a product from Adobe on top of Eclipse platform. I assumed that it'll provide all the basic features available in Eclipse for Java, but I was wrong. Flex Builder is in nascent phase from tooling point of view. Just to refresh your memories, Flex Builder lacks some of the following Eclipse features.

  1. Support for generating getters-setters automatically.
  2. Support of templates for creating constants.
  3. Organize imports. If some type has not been included already, organize-import should do that.
  4. Better refactoring support. Right now refactoring is just limited to renaming and you start missing real sense of refactoring in terms of creating new methods etc.
  5. Sometimes you may want to create your own templates for creating ASDoc instead of doing it from the scratch all the time
  6. Formatting ActionScript/Flex files

I did some research on internet and found some options to resolve these problems.

Eclipse Monkey

Eclipse Monkey currently is a part of Eclipse Dash project. It is proposed to be split from Dash to make it full-fledged project in itself. It's a very powerful tool. Instead of extending Eclipse platform through creating plugins, you can extend Eclipse functionality through some scripting. Eclipse Monkey uses the Mozilla Rhino Javascript interpreter at its core. You guessed it right, scripting couldn't have been easier for Eclipse than the way it does with Monkey using Javascript.

Eclipse Monkey can be used to create getters and setters in ActionScript in automated fashion. You may want to take a look on a ~eokyere blog to see how Monkey is used to create getters and setters. As I searched some more available Monkey scripting resources, I found more examples and one of them satisfied my problem no 2 also.

If you have already downloaded and executed Monkey scripts on your Eclipse platform, you may have realized how powerful this Scripting tool is for Eclipse. You can create a lot of scripting based tools to enhance productivity without creating specialized plugin.

FDT ActionScript Editor

For rest of the problems mentioned above, I tried many options but somehow they didn't provide desired outcome. However one ActionScript based editor FDT comes very close. It supports most of features mentioned in the list and is certainly a better choice from ActionScript editor point of view. However it's not free and sometimes I wonder why somebody will invest yet another €599 to buy this tool if he already has Flex Builder. Flex Builder is a defacto tool for Flex based development whereas FDT mainly focuses on ActionScript based programming. FDT doesn't support MXML yet.

No wonder that we come to conclude that Flex Builder has a lot to catch up in terms of enhancing its tooling for Flex developers. However the tools I just mentioned come a bit close in providing the required support.

Comments (7)

  1. Chetan Sachdev - Reply

    November 18, 2008 at 8:52 pm

    You can have a look at FlashDevelop, it is free and provides many functionality. Coolest one which I like is sol file editor to edit content of AMF.

  2. Sebastien Arbogast - Reply

    November 22, 2008 at 11:11 pm

    I'm having a hard time getting Monkey scripts to work. When I try to run "generate properties", I get a NullPointerException on line 13:

    var source = editor.source;

    Which seems to indicate that editors.activeEditor is null.

    Is it supposed to work with Eclipse 3.3.2 and Flex Builder plugin 3.0.2?

  3. Shrikant Vashishtha - Reply

    November 23, 2008 at 10:36 am

    Hi Sebastien,

    I am using Eclipse 3.3.0 and FlexBuilder plugin 3.0.2 and it works perfectly fine for me. I get this error when I try to generate properties in MXML. Somehow Monkey doesn't work for MXML files. However for ActionScript files it works perfectly OK.

    One mistake I did in the beginning, one needs to select the properties in the editor before running the script. Otherwise it throws NullPinterException at "for (var i = 0, n = result.length; i < n; ++i)" line.

  4. Ankur - Reply

    February 3, 2009 at 5:45 am

    Hi Shrikant,

    Nice post. I am getting the same NPE you mentioned in your last comment, even if I highlight the property or the entire line of code.
    eg private var _desc : String;

    What exactly do you mean by "select the properties in the editor before running the script"?

  5. Laurenţiu Lozan - Reply

    February 4, 2009 at 4:33 pm

    I get the NPE in ActionScript files too. And not the "editors.activeEditor" is null but the "source" property of the active editor is.

  6. Shrikant Vashishtha - Reply

    March 3, 2009 at 6:50 am


    “select the properties in the editor before running the script” means highlight the fields of ActionScript class you want to run the script on and then run the script.

  7. Chad Jorgenson - Reply

    October 23, 2009 at 5:01 pm

    I think it needs to be plainly said that the NPE occurs in files that end in .mxml and but it does work in .as files.

    MyFrontPage.mxml => NPE occurs => Works

Add a Comment