The destination endpoint of the binding. This parameter is nominally of type
destination
mx.data.binding.EndPoint
fields.
An optional object that contains formatting information. The object must have the
format
following properties:
•
An ActionScript class that extends the class mx.data.binding.DataAccessor.
cls
•
An object whose properties provide optional settings for the formatter class
settings
specified by
.
cls
An optional Boolean value that specifies whether the new Binding object is
isTwoWay
bidirectional (
true
Returns
Nothing.
Description
Constructor; creates a new Binding object. You can bind data to any ActionScript object that has
properties and emits events including, but not limited to, components.
A binding object exists as long as the innermost movie clip contains both the source and
destination components. For example, if movie clip named A contains components X and Y, and
there is a binding between X and Y, then the binding is in effect as long as movie clip A exists.
Note: It's not necessary to retain a reference to the new Binding object. As soon as the Binding
object is created, it immediately begins listening for "changed" events emitted by either endpoint. In
some cases, however, you might want to save a reference to the new Binding object, so that you can
call its
method at a later time (see
execute()
Example
In this example, the
property of another TextInput component (
(that is, when the
focusOut
.
dest_txt.text
import mx.data.binding.*;
var src = new EndPoint();
src.component = src_txt;
src.property = "text";
src.event = "focusOut";
var dest= new EndPoint();
dest.component = dest_txt;
dest.property = "text";
new Binding(src, dest);
The following example demonstrates how to create a Binding object that uses a custom formatter
class. For more information, see
import mx.data.binding.*;
var src = new EndPoint();
, but can be any ActionScript object that has the required Endpoint
) or not (
). The default value is
false
property of a TextInput component (
text
event is generated), the value of its
"CustomFormatter class (Flash Professional only)" on page
.
false
).
Binding.execute()
src_txt
). When the
dest_txt
text
Data binding classes (Flash Professional only)
) is bound to the
text field loses focus
src_txt
property is copied into
text
217.
215
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?