64
Chapter 3: Creating Advanced Components in Flash MX 2004
The following example defines the
enabled
parameter as inspectable:
[Inspectable(defaultValue=true, verbose=1, category="Other")]
var enabled:Boolean;
The
Inspectable
keyword supports loosely typed properties, as the following example shows:
[Inspectable("danger", 1, true, maybe)]
InspectableList
Use the
InspectableList
metadata keyword to specify exactly which subset of inspectable
parameters should appear in the Property Inspector or Component definition panels in the Flash
MX 2004 user interface.
The
InspectableList
metadata keyword eliminates inheritance of inspectable properties in the
base class. Only the properties in this list are marked as inspectable. Use the
InspectableList
keyword in combination with the
Inspectable
keyword to hide inherited attributes for
subclassed components.
If you do not add an
InspectableList
metadata keyword to your component’s class, all
inspectable parameters, including those of the component’s parent classes, appear in the Flash
Property inspector.
environment
String
(Optional) Notes which inspectable properties should not be allowed
(
none
), which are used only for Flash (
Flash
), and which are used
only by Flex and not Flash (
MXML
).
format
String
(Optional) Indicates that the property holds a value with a file path.
listOffset
Number
(Optional) Defines the default index of a List value. Added for
backward compatibility with Flash MX components.
name
String
(Optional) Defines a display name for the property; for example,
Font
Width
. If not specified, use the property’s name, such as
_fontWidth
.
type
String
(Optional) Specifies the type. If omitted, use the property’s type. The
following values are acceptable:
•
Array
•
Object
•
List
•
String
•
Number
•
Boolean
•
Font Name
•
Color
If the property is an array, you must list the valid values for the array.
variable
String
(Optional) Specifies the variable to which this parameter is bound.
Added for backward compatibility with Flash MX components.
verbose
Number
(Optional) Indicates that this inspectable property should be
displayed in the Flash user interface only when the user indicates
that verbose properties should be included. If this property is not
specified, Flash assumes that the property should be displayed.
Option
Type
Description
Содержание FLEX - DEVELOPING COMPONENTS AND THEMES
Страница 1: ...Developing Flex Components and Themes in Flash Authoring ...
Страница 4: ...4 Contents ...
Страница 44: ...44 Chapter 2 Creating Basic Components in Flash MX 2004 ...
Страница 82: ...82 Index ...