User interfaces represent some of the best examples of stateful object-oriented design in part because it is natural to model a UI component as an object with state.
A button component, for instance, might have a state indicating whether the button is pressed or released, the text the button displays, and so on.
Data binding defines a syntax for automatically copying the value of a property of one object, the source property, to a property of another object, the destination property, at run time.
Data binding is usually triggered when the value of the source property changes.
The following example shows a Text control that gets its data from a HSlider control’s Properties in your custom components can take advantage of data binding.
For more information on using Action Script to define properties and methods, see Custom Action Script components.However, you then need a way to invoke the function to update the destination of the data binding.In the following example, you use the When you make an Object the source of a data binding expression, the data binding occurs when the Object is updated, or when a reference to the Object is updated, but not when an individual field of the Object is updated.This tutorial illustrates two-way data binding in Flex 4.A key concept in object-oriented programming centers around an object encapsulating some state, and then notifying other interested objects when that internal state changes.