User Guide
EndPoint class (Flash Professional only) 221
The EndPoint objects, srcEndPoint and destEndPoint, might be defined as follows:
var srcEndPoint = new mx.data.binding.EndPoint();
var destEndPoint = new mx.data.binding.EndPoint();
srcEndPoint.component = source_txt;
srcEndPoint.property = "text";
srcEndPoint.event = "focusOut";
destEndPoint.component = dest_txt;
destEndPoint.property = "text";
In English, the above code means “When the source text field loses focus, copy the value of its
text property into the text property of the destination text field.”
You can also pass generic ActionScript objects to the Binding constructor, rather than passing
explicitly constructed EndPoint objects. The only requirement is that the objects define the
required EndPoint properties,
component and property. The following code is equivalent to
that shown above.
var srcEndPoint = {component:source_txt, property:"text"};
var destEndPoint = {component:dest_txt, property:"text"};
new mx.data.binding.Binding(srcEndPoint, destEndPoint);
For an overview of the classes in the mx.data.binding package, see “Classes in the
mx.data.binding package (Flash Professional only)” on page 208.
Property summary for the EndPoint class
The following table lists the properties of the EndPoint class.
NOTE
To make this class available at runtime, you must include the data binding classes in your
FLA file.
Method Description
EndPoint.component A reference to a component instance.
EndPoint.constant A constant value.
EndPoint.event The name of an event, or array of event names, that the component
emits when the data changes.
EndPoint.location The location of a data field within the property of the component
instance.
EndPoint.property The name of a property of the component instance specified by
EndPoint.component.