MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 224

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

Advertisement

Each message you pass to
object that was passed to the
Example
See the Example section for
EndPoint class (Flash Professional only)
ActionScript Class Name
The EndPoint class defines the source or destination of a binding. EndPoint objects define a
constant value, component property, or particular field of a component property, from which you
can get data, or to which you can assign data. They can also define an event, or list of events, that
a Binding object listens for; when the specified event occurs, the binding executes.
When you create a new binding with the Binding class constructor, you pass it two EndPoint
objects: one for the source and one for the destination.
new mx.data.binding.Binding(srcEndPoint, destEndPoint);
The EndPoint objects,
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
property into the
text
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,
shown above.
var srcEndPoint = {component:source_txt, property:"text"};
var destEndPoint = {component:dest_txt, property:"text"};
new mx.data.binding.Binding(srcEndPoint, destEndPoint);
Note: To make this class available at runtime, you must include the data binding classes in your FLA
document.
For an overview of the classes in the mx.data.binding package, see
package (Flash Professional only)" on page
224
Chapter 6: Components Dictionary
validationError()
event handler.
invalid
CustomValidator.validate()
mx.data.binding.EndPoint
and
srcEndPoint
destEndPoint
property of the destination text field."
text
and
component
213.
is available in the
messages
.
, might be defined as follows:
. The following code is equivalent to that
property
"Classes in the mx.data.binding
property of the event

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents