Data Binding (Flash Professional Only) - MACROMEDIA FLASH MX 2004-USING FLASH Use Manual

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

Advertisement

Data binding (Flash Professional only)

Data binding lets you map the properties of one component to another component. A binding is
simply a statement that says "When property X of component A changes, copy the new value to
property Y of component B."
For rich internet applications, you can map data from external data sources to Flash components.
The external data source is represented in your application by a component; items in the data
source's schema are represented as properties of the component. You can define component
properties to meet your business needs; these properties, which contain dynamic data that you
want to manipulate, are referred to as bindable properties.
The most powerful use of data binding in Flash is to define the flow of data between UI
components, data management components, and connector components that access external data
sources such as web services, XML documents, and relational databases.
In the Flash interface, you bind data by using the Bindings and Schema tabs of the Component
inspector. Although you need to understand how bindings and schemas work in Flash, your
connector component is usually the first component you need to set up, because it brings in the
schema for your data source; see
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.
You can also create runtime bindings by writing ActionScript code. For more information, see
"Data binding classes (Flash Professional only)" in Using Components.
A simple binding example
The following procedure provides a simple illustration of how data binding connects one UI
component to another. In the example, the value properties of component instances
and
stepper1_nm
and
stepper3_nm
most likely import a schema, define additional bindable component properties, and create
multiple bindings between data components and UI components.
To connect UI components to create data binding:
Add a NumericStepper component to the Stage, and name it
1.
Add another NumericStepper component, and name it
2.
With
3.
stepper1_nm
Click the Add Binding (+) button to add a binding.
4.
In the Add Binding dialog box, select Value, and click OK.
5.
In the Name/Value section at the bottom of the Bindings tab, click the Bound To item under
6.
Name, and click the magnifying glass icon across from the Bound To item under Value.
In the Bound To dialog box, select component
7.
OK.
"Data connectivity (Flash Professional only)" on page
are bound to each other, and the value properties of
stepper2_nm
are bound to each other. In a real-world application, you would
myInput_txt
selected, open the Component inspector, and click the Bindings tab.
stepper1_nm
stepper2_nm
under Component Path, and click
stepper2_nm

Data binding (Flash Professional only)

274.
.
.
259

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING FLASH and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents