MACROMEDIA FLASH 8-USING FLASH Use Manual page 395

Using flash
Table of Contents

Advertisement

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
on page
412.
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 the Components Language Reference.
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
stepper2_nm
and
stepper3_nm
myInput_txt
would 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:
1.
Add a NumericStepper component to the Stage, and name it
2.
Add another NumericStepper component, and name it
3.
With
stepper1_nm
4.
Click the Add Binding (+) button to add a binding.
5.
In the Add Binding dialog box, select Value, and click OK.
6.
In the Name/Value section at the bottom of the Bindings tab, click the Bound To
item under Name, and click the magnifying glass icon across from the Bound To item
under Value.
7.
In the Bound To dialog box, select component
click OK.
8.
Select Control > Test Movie. Click the Up and Down buttons on component
.
stepper1_nm
Each time you click the buttons on
copied to the
value
, the
stepper2_nm
.
stepper1_nm
are bound to each other, and the value properties of
are bound to each other. In a real-world application, you
selected, open the Component inspector, and click the Bindings tab.
stepper1_nm
property of
stepper2_nm
property of
value
stepper2_nm
"Data connectivity (Flash Professional only)"
stepper1_nm
stepper2_nm
under Component Path, and
stepper2_nm
, the
property of
value
. Each time you click the buttons on
is copied to the
Data binding (Flash Professional only)
.
.
is
stepper1_nm
property of
value
395

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents