MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 941

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

About the ChangeEvent tag
The ChangeEvent tag tells data binding that the component will generate an event any time the
value of a specific property changes. In response to the event, data binding executes any binding
that has that property as a source. The component only generates the event if you write
appropriate ActionScript code in the component. The event should be included in the list of
Event metadata declared by the class.
You can declare a property by using
or getter/setter methods. If a property has both a getter
var
and a setter method, you only need to apply the ChangeEvent tag to one.
The ChangeEvent tag has the following syntax:
[Bindable]
[ChangeEvent("event")]
property_declaration or getter/setter function
In the following example, the component generates the
event when the value of the
change
bindable property
changes:
flavorStr
[Bindable]
[ChangeEvent("change")]
public var flavorStr:String;
When the event that is specified in the metadata occurs, Flash notifies bindings that the property
has changed.
You can register multiple events in the tag, as the following example shows:
[ChangeEvent("change1", "change2", "change3")]
Any one of those events indicates a change to the property. They do not all have to occur to
indicate a change.
Creating the ActionScript class file
941

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents