Metadata tags
61
You insert the
[NonCommittingChangeEvent]
metadata tag before an ActionScript property
definition or before a setter or getter method. The
[NonCommittingChangeEvent]
metadata
tag has the following syntax:
[NonCommittingChangeEvent("
event_name
")]
In the following example, the component dispatches the
change
event every time the user
enters a keystroke, but the
change
event does not trigger data binding or data validators.
When the user completes data entry, by pressing the Enter key, the component broadcasts the
valueCommit
event to trigger any data bindings and data validators:
[Event(name="change", type="flash.events.Event")]
class MyText extends UIComponent {
...
[Bindable(event="valueCommit")]
[NonCommittingChangeEvent("change")]
function get text():String {
return getText();
}
function set text(t):void {
setText(t);
// Dispatch events.
}
}
Style metadata tag
Use the
[Style]
metadata tag to define the MXML tag attribute for a style property for the
component. You insert the
[Style]
metadata tag before the class definition in an
ActionScript file, or in the
<mx:Metadata>
block in an MXML file.
The
[Style]
metadata tag has the following syntax:
[Style(name=
"style_name"[,property="value",...]
)]
The following table describes the properties for the
[Style]
metadata tag:
Option
Type
Description
name
String
(Required) Specifies the name of the style.
type
String
Specifies the data type of the value that you write to the style
property. If the type is not an ActionScript type such as Number or
Date, use a qualified class name in the form
packageName
.
className
.
Содержание FLEX 2 - CREATING AND EXTENDING COMPONENTS
Страница 1: ...Creating and Extending Flex 2 Components Adobe Flex 2...
Страница 6: ...6 Contents...
Страница 10: ...10 About Flex Documentation...
Страница 12: ......
Страница 24: ...24 Creating Flex Components...
Страница 74: ...74 Compiling Components...
Страница 76: ......
Страница 118: ...118 Creating Advanced MXML Components...
Страница 120: ......
Страница 182: ...182 Creating Advanced Visual Components in ActionScript...
Страница 194: ...194 Creating Custom Style Properties...
Страница 204: ...204 Creating Template Components...
Страница 206: ......
Страница 216: ...216 Creating Custom Formatters...
Страница 254: ...254 Index...