Archive for the 'FlexBuilder' Category

Inspect-ability

Monday, December 31st, 2007

Most of us, by now, know all about making things [Bindable] in our objects. There’s another FlexBulder trick in town that I see far too few folks using:

 

Inspectable

 

imageThis is the feature that gives the user the wonderful drop-menu of available options when they ask for code-assistance (control-space):

 

This feature is very easily accomplished and if you get used to it you will make all of your coding a bit tighter and quicker — if you ask me.

 

I’ve dug around and found a few examples of this tag but I’m sure there are more, so please reply with your examples as well!

 

For a Boolean

[Inspectable(attribute=true,false)]
public var myVar:Boolean    = false;

 

 

For a String

[Inspectable(enumeration="red,green")]
public var myApple:Boolean    = “red”;

 

Now, I’d just love it if someone would explain the true differences between “attribute” and “enumeration”. As well as the fact that there are other properties you can include in these tags

  • defaultValue
  • verbose
  • category

 

And more. It’s an odd tag and it’s usage can be confusing. But using it as above at the minimum I have enabled code-assist throughout my programs.

 

For more information:

http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001658.html

 

And some explanations

image