
392
Data Integration (Flash Professional Only)
6.
Load a sample of the data source’s schema: with the XMLConnector instance still selected,
in the Component inspector click the Schema tab and follow these steps:
a.
Select
results : XML
from the Schema tab top pane.
b.
Click the Import a Schema from a sample XML file button.
c.
Select the dinner_menu.xml file from the dialog box that appears.
The XML file’s schema structure appears in the Schema tab.
7.
Expose the XMLConnector’s
array
property for data binding and bind it to the
DataSet’s
dataProvider
property. With the XMLConnector component selected, follow
these steps:
a.
On the Bindings tab of the Component inspector, click the plus (+) sign and in the
dialog box, select
food:array
.
b.
On the Bindings tab again, click Bound To, click the magnifying glass icon, select
DataSet, and select
dataProvider:Array
.
Each time you create a binding, you perform at least these two basic steps.
8.
Populate the data grid with the XML data by binding the XML data—through the DataSet
component—to the data grid. Select the DataSet component and click the Bindings tab.
You see the binding to the
xmlConn
instance that you just added. Now, add two new
bindings:
a.
Bind the DataSet’s
dataProvider
property to the DataGrid’s
dataProvider
property: click the plus (+) sign, select the
dataProvider:Array
property, click
Bound To, click the magnifying glass icon, select DataGrid, then select the
dataProvider:Array
property. Select
out
for the direction.
b.
Bind the DataSet’s
selectedIndex
property to the DataGrid’s
selectedIndex
property: click the plus (+) sign, select the
selectedIndex:Number
property, click
Bound To, click the magnifying glass icon, select DataGrid, then select the
selectedIndex:Number
property.
9.
Set up the button to load data into the data grid. Click layer 1 in frame 1 of the Timeline
and open the Actions panel. Add the following code to the first frame:
form = new Object();
form.click = function(eventObj){
xmlConn.trigger();
}
loadData.addEventListener("click", form);
10.
Save and test the application. Click Load Data. The data from the XML file is loaded into
the DataGrid.
You've just created your first data integration application, with data dynamically loaded
from an XML file. To add more functionality to this application, see
“Creating an indexed
binding” on page 407
.
Summary of Contents for FLASH 8-USING 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...