User Guide

216 Chapter 6: Components Dictionary
src.component = src_txt;
src.property = "text";
src.event = "focusOut";
var dest= new EndPoint();
dest.component = text_dest;
dest.property = "text";
new Binding(src, dest, {cls: mx.data.formatters.Custom, settings: {classname:
"com.mycompany.SpecialFormatter"}});
Binding.execute()
Availability
Flash Player 6.
Edition
Flash MX Professional 2004.
Usage
myBinding.execute([reverse])
Parameters
reverse
A Boolean value that specifies whether the binding should also be executed from the
destination to the source (
true), or only from the source to the destination (false). By default,
this value is
false.
Returns
A null value if the binding executed successfully; otherwise, the method returns an array of error
message strings that describe the errors that prevented the binding from executing.
Description
Method; fetches the data from the source component and assigns it to the destination
component. If the binding uses a formatter, then the data is formatted before being assigned to
the destination.
This method also validates the data and causes either a
valid or invalid event to be emitted by
the destination and source components. Data is assigned to the destination even if it’s invalid,
unless the destination is read-only.
If the
reverse parameter is set to true and the binding is two-way, then the binding is executed
in reverse (from the destination to the source).
Example
The following code, attached to a Button component instance, executes the binding in reverse
(from the destination component to the source component) when the button is clicked.
on(click) {
_root.myBinding.execute(true);
}