MACROMEDIA FLASH MX 2004-USING FLASH Use Manual page 270

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

Advertisement

To use a dynamic value for the Bound To property:
Select a component in the Component Path pane.
1.
Do one of the following actions to select a schema item for the data:
2.
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
on page
302.
To use a constant value for the Bound To property:
Select Use Constant Value, and enter a constant value, such as
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
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
array, a setting for its value is dynamically added to the Schema Attributes pane; you use this
setting, the
Index for
Note: If a schema item location includes several array references such as
three index for settings are dynamically added to the Schema Attributes pane—one for each array
that needs to be indexed.
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.
To create an indexed binding:
If you haven't already done so, create the example application shown in
1.
application" on page
Drag a TextArea component to the Stage and name it
2.
270
Chapter 14: Data Integration (Flash Professional Only)
"Creating a simple application" on page
property of a UI element. When you create a binding to the index of an
field, to specify to what to bind the index.
256.
"Adding bindings using path expressions"
, a string, or
3
"foo/bar[]/abc[]/def[]"
.
myTextArea
. You can use
true
256, the data grid
,
"Creating a simple

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents