![]() | ![]() ![]() ![]() |
![]() | |
![]() | |
![]() |
Data binding is way of connecting components to each other. Components can be viewed as simple black boxes that have properties. A property is what lets you get data into and out of a component. A binding is a statement that says "When property X of component A changes, copy the new value to property Y of component B." You do data binding within the authoring tool using the Bindings tab of the Component Inspector panel. From here you can add, view, and remove bindings for a component.
Although data binding works with any component, its main purpose is to connect UI components to external data sources such as web services and XML documents. These external data sources are available as components with properties, which you can bind to other component properties. The Component Inspector panel is the main tool that is used within Flash MX Professional 2004 for data binding. It contains a Schema tab for defining the schema for a component and a Bindings tab for creating bindings between component properties.
Caution: If you copy and paste components, their bindings will be lost. You will need to reset the bindings manually. This is also the case if you select several components and convert them into a symbol.
The following example demonstrates how to create basic data binding by connecting one UI component to another.
Each time you click the buttons on A, the value
property of A is copied to the value
property of B. Each time you click the buttons on B, the value
property of B is copied to the value
property of A.
value
property of C to the text
property of D.Each time you enter a new value, the text
property of D is copied to the value
property of C. When you click the Up and Down buttons on C, the value
property of C is copied to the text
property of D.
Note: Data binding is supported only between components that exist in Frame 1 of the main Timeline, Frame 1 of a movie clip, or Frame 1 of a screen.
For a tutorial that introduces Flash data architecture, see www.macromedia.com/go/data_integration.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |