Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 61

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

You insert the
[NonCommittingChangeEvent]
definition or before a setter or getter method. The
tag has the following syntax:
[NonCommittingChangeEvent("event_name")]
In the following example, the component dispatches the
enters a keystroke, but the
When the user completes data entry, by pressing the Enter key, the component broadcasts the
event to trigger any data bindings and data validators:
valueCommit
[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
metadata tag to define the MXML tag attribute for a style property for the
[Style]
component. You insert the
ActionScript file, or in the
The
metadata tag has the following syntax:
[Style]
[Style(name="style_name"[,property="value",...])]
The following table describes the properties for the
Option
Type
name
String
String
type
event does not trigger data binding or data validators.
change
metadata tag before the class definition in an
[Style]
block in an MXML file.
<mx:Metadata>
Description
(Required) Specifies the name of the style.
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.
metadata tag before an ActionScript property
[NonCommittingChangeEvent]
event every time the user
change
metadata tag:
[Style]
metadata
Metadata tags
61

Advertisement

Table of Contents
loading

Table of Contents