« FlashTeam and questionable content | Main | WebServices, Remoting and AS2 »

October 20, 2004

PropertyInspector and Custom Class Types

This has got me thinking today!

A feature I want, but is it there already and I just don't know enough?

I was thinking it would be nice to be able to have compound properties in the PropertyInspector. What I mean by this is a property that is actually an object with its own properties.

For example a property called CD which is an object with properties Artist and Title.

Daft example but bear with me.

You see the PropertyInspector actually can handle some complex properties already. You can define a property as a Collection i.e. basically an Array but with a custom class for the CollectionItem.

To quote from the Flash help file....
You code the properties for a collection item in a separate ActionScript class, which you define as follows:

Define the class such that it does not extend UIObject or UIComponent.
Define all properties using the Inspectable tag.
Define all properties as variables. Do not write get and set (getter/setter) methods.
The following is a simple example of a collection item class file called CompactDisc.as.

class CompactDisc{
[Inspectable(type="String", defaultValue="Title")]
var title:String;
[Inspectable(type="String", defaultValue="Artist")]
var artist:String;
}

There you see! If my property was a Collection or an Array of CD's then I could have what I want now.

But I want less than that, I just want one single item not an array of them.

Hmmmm so that has to be asking less of MM not more, if they went to the trouble of making it handle an Array of Objects wouldn't they first have thought of it handling a single Object?

...... is there a way to do it ...

I haven't seen any documentation or examples on it so I suspect not.

Maybe another item for the wishlist

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)