Archive forFebruary, 2006

Bug in component metadata

As some of you may know, the Macromedia V2 Component Architecture allows you, to work with metadata in your classfiles. You can i.e. add a icon-file to your component , which display in the component panel// add an icon to your component
[IconFile("CarGame.png")]

With another metadata-tag you declare params as inspectable, which means that the user can edit this param. // make the variable speed inspectable by the user
[Inspectable(defaultValue="5")]
public var speed:Number;

If you want to hide the internal var name, you can give the param a “display name” which is displayed in the component inspector panel.// set default value, give display name, set type of value
[Inspectable(defaultValue="5", name="Car Speed", type="Number")]
public var speed:Number;

Now the bug. You can’t use square bracket in the name value. When i want to show the user a range of the value i usually write something like this: Car Speed [0-10]. Unfortunately, this is not possible because flash return a compiling error, when you use the squared bracket close ( ] ) in the name value of the inspectable metadata tag. Time for another bug report…

Comments off