![MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Скачать руководство пользователя страница 65](http://html1.mh-extra.com/html/macromedia/flex-developing-components-and-themes/flex-developing-components-and-themes_manual_3388115065.webp)
Writing the component’s ActionScript code
65
The
InspectableList
metadata keyword has the following syntax:
[InspectableList("
attribute1
"[,...])]
The
InspectableList
keyword must immediately precede the class definition because it applies
to the entire class and not individual members of the class.
The following example allows the
flavorStr
and
colorStr
properties to be displayed in the
Property inspector, but excludes other inspectable properties (such as
flavorAge
) from the
DotParent class:
[InspectableList("flavorStr","colorStr")]
class BlackDot extends DotParent {
[Inspectable(defaultValue="strawberry")]
public var flavorStr:String;
[Inspectable(defaultValue="blue")]
public var colorStr:String;
[Inspectable(defaultValue="10")]
public var flavorAge:String;
...
}
NonCommittingChangeEvent
The
NonCommittingChangeEvent
metadata keyword identifies an event as an interim trigger.
You use this keyword for properties that might change often, but for which you do not want
validation to occur on every change.
An example of this is if you tied a validator function to the text property of a TextInput control.
The text property changes on every keystroke, but you do not want to validate the property until
the user presses the Enter key or changes focus away from the field. The
NonCommittingChangeEvent
keyword lets you trigger validation when the user is done editing
the text field.
The
NonCommittingChangeEvent
metadata keyword has the following syntax:
[NonCommittingChangeEvent("
event_name
")]
In the following example, the component is aware that the property has changed if the change is
triggered; however, that change is not final. There is another
ChangeEvent
keyword that probably
triggers when the change is final.
[Event("change")]
...
[ChangeEvent("valueCommitted")]
[NonCommittingChangeEvent("change")]
function get text():String {
return getText();
}
function set text(t):Void {
setText(t);
}
Содержание 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 ...