![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
When building a component, you can add parameters that define its appearance and behavior. The most commonly used properties appear as authoring parameters in the Component Inspector panel. You define these properties by using the Inspectable keyword (see Inspectable). You can also set all inspectable parameters with ActionScript. Setting a parameter with ActionScript overrides any value set during authoring.
The following example sets several component parameters in the JellyBean class file, and exposes them with the Inspectable metadata keyword in the Component Inspector panel:
class JellyBean{ // a string parameter [Inspectable(defaultValue="strawberry")] public var flavorStr:String; // a string list parameter [Inspectable(enumeration="sour,sweet,juicy,rotten",defaultValue="sweet")] public var flavorType:String; // an array parameter [Inspectable(name="Flavors", defaultValue="strawberry,grape,orange", verbose=1, category="Fruits")] var flavorList:Array; // an object parameter [Inspectable(defaultValue="belly:flop,jelly:drop")] public var jellyObject:Object;
// a color parameter [Inspectable(defaultValue="#ffffff")] public var jellyColor:Color; }
Parameters can be any of the following supported types:
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |