View Single Post
Codemonkey's Avatar Codemonkey Codemonkey is offline Super Moderator 2006-11-06 #22 Old  
019 - InspectableList metatag
Last edited by Codemonkey : 2006-11-07 at 07:50.
 
If you are creating your own components and you are extending an existing component class to do that, it may happen that you want to hide inherited public properties from the Component Inspector in Flash.

The answer is a Flash meta tag for components called InspectableList. While the component inspector knows what properties to list from each separate property that has Inspectable before it, you can override this list by using the InspectableList meta tag.

For example, when you know a component works with public x and y Numbers, but you want to work with a setPos() method and hide the x and y properties, you need a way to do this clean and simple (at least to users in the component inspector):

ActionScript Code:
  1. class ComponentA {
  2.         [Inspectable(defaultValue=0)]
  3.         public var x:Number;
  4.  
  5.         [Inspectable(defaultValue=0)]
  6.         public var y:Number;
  7.  
  8.         [Inspectable(defaultValue=100)]
  9.         public var size:Number;
  10. }
ActionScript Code:
  1. [InspectableList("size")]
  2. class ComponentB extends ComponentA {
  3. ...
  4. }
In component B, the x and y properties are not available in the component inspector, but the property size still is. Be cautious though, if you use this tag to exclude variables, you have to add all the others by hand to this meta tag.