Data binding (Flash Professional only)
407
The Schema Location pane shows the schema tree of the component selected in the
Component Path pane. This is the same information that appears in the Schema Tree pane of
the Component inspector Schema tab.
You can use a dynamic value or a constant value for the Bound To property.
To use a dynamic value for the Bound To property:
1.
Select a component in the Component Path pane.
2.
Do one of the following actions to select a schema item for the data:
■
Select a schema item using the Schema tree located within the Schema Location pane.
■
Select Use Path Expression, select a component property from the schema tree, and
enter a path expression. For more information, see
“Adding bindings using path
expressions” on page 446
.
To use a constant value for the Bound To property:
■
Select Use Constant Value, and enter a constant value, such as
3
, a string, or
true
. You
can use any value that is valid for the schema item. When you use a constant value, the
selected component path, schema location, and path expression are ignored. You can bind
to a constant value only when the Direction attribute for the binding is set to In.
Creating an indexed binding
In the example application created in
“Creating a simple application” on page 391
, the data
grid displays the dinner menu. The description of each food item, however, is too long to fit
in the data grid. Ideally, the user could click an item in the data grid and read the full
description of a food item, perhaps in a text box below the data grid. To accomplish this, you
would create an indexed binding to the data array.
This section shows you how to create an indexed binding to connect a field in your data
source with the selected index of another component. The most common use for an indexed
binding is to the
selectedIndex
property of a UI element. When you create a binding to the
index of an array, a setting for its value is dynamically added to the Schema Attributes pane;
you use this setting, the
Index for
field, to specify to what to bind the index.
In the following example, you add a text box to display the full description of the food item
when a user clicks on the item in the data grid.
NO
T
E
If a schema item location includes several array references such as
"foo/bar[]/abc[]/
def[]"
, three
index for
settings are dynamically added to the Schema Attributes
pane—one for each array that needs to be indexed.
Summary of Contents for FLASH 8-FLASH
Page 1: ...Using Flash ...
Page 12: ...12 Contents ...
Page 110: ...110 Using Symbols Instances and Library Assets ...
Page 128: ...128 Working with Color Strokes and Fills ...
Page 156: ...156 Drawing ...
Page 190: ...190 Working with Text ...
Page 224: ...224 Working with Graphic Objects ...
Page 270: ...270 Creating Motion ...
Page 310: ...310 Working with Video ...
Page 362: ...362 Working with Screens Flash Professional Only ...
Page 386: ...386 Creating Multilanguage Text ...
Page 454: ...454 Data Integration Flash Professional Only ...
Page 500: ...500 Publishing ...
Page 534: ...534 Creating Accessible Content ...