Macromedia flex 2 Manuale

Pagina di 254
62
Using Metadata Tags in Custom Components
The following example shows the definition of the 
textSelectedColor
 style property:
[Style(name="textSelectedColor",type="Number",format="Color",inherit="yes")]
The next example shows the definition of the 
verticalAlign
 style property:
[Style(name="verticalAlign", type="String", 
enumeration="bottom,middle,top", inherit="no")]
For more information on the 
[Style]
 metadata tag, see 
arrayType
String
If 
type
 is 
Array
arrayType
 specifies the data type of the Array 
elements. If the data type is not an ActionScript type such as 
Number or Date, use a qualified class name in the form 
packageName.className.
format
String
Specifies the units of the property. For example, if you specify 
type
 
as 
“Number”
, you might specify 
format="Length"
 if the style defines a 
length measured in pixels. Or, if you specify 
type="uint"
, you might 
set 
format="Color"
 if the style defines an RGB color. 
enumeration
String
Specifies an enumerated list of possible values for the style property.
inherit
String
Specifies whether the property is inheriting. Valid values are 
yes
 and 
no
. This property refers to CSS inheritance, not object-oriented 
inheritance. All subclasses automatically use object-oriented 
inheritance to inherit the style property definitions of their 
superclasses. 
Some style properties are inherited using CSS inheritance. If you set 
an inheritable style property on a parent container, its children inherit 
that style property. For example, if you define 
fontFamily
 as Times 
for a Panel container, all children of that container will also use Times 
for 
fontFamily
, unless they override that property. 
If you set a noninheritable style, such as 
textDecoration
, on a parent 
container, only the parent container and not its children use that 
style. For more information on inheritable style properties, see 
“About style inheritance” iFlex 2 Developer’s Guide.
Option
Type
Description