User Guide
160 Creating Components
The following example sets several component parameters in the JellyBean class file, and
exposes them with the Inspectable tag in the Component inspector:
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;
// a setter
[Inspectable(defaultValue="default text")]
function set text(t:String)
}
You can use any of the following types for parameters:
■ Array
■ Object
■ List
■ String
■ Number
■ Boolean
■ Font Name
■ Color
NOTE
The JellyBean class is a theoretical example. To see an actual example, look at the
Button.as class file that installs with Flash in the language/First Run/Classes/mx/
controls directory.