Adding comments to your code in Flex that can be picked up by the IDE’s Intellisense is very easy, it’s not as elegant as .NET’s implementation in my opinion but it’s simple and it works (I haven’t had any issues yet :) ).

You just need to add a block comment before your function that starts with two stars, i.e. /** */. Inside this block you can enter your comments about the function, if the function has parameters just include @param then the name of parameter and then the comment about it, and for return values you insert @return and the comment about the return value. See the example below:

public final class Strings
{
    /**
    * Checks if two strings are equal
    * @param value1 The first string
    * @param value2 The second string
    * @param caseSensitive Should a case sensitive comparision be done, default is <b>false</b>
    * @return Returns true if the strings are equal otherwise returns false
    */
    public static function AreEqual(value1:String, value2:String, caseSensitive:Boolean=false):Boolean
    {
        // Function body here
    }
}

Doing this will display the following information when you navigate through the Intellisense list to the function you added the comment to:
FlexIntellisense

Note you can include HTML tags in your intellisense comments, I’m not sure which tags are supported as I haven’t checked, I assume just the basic font formatting tags.

Also this works on fields, property getters/setters, etc.

Post based on Adobe Flash Builder 4 Beta 2 (I assume it is the same in Adobe Flex Builder 3)


Kick It on DotNetKicks.com