User Guide
Workflows for using the data components 257
8.
Next, 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. 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 270.
Workflows for using the data components
This section provides a high-level overview of the steps required to create a Flash application that
can dynamically interact with an external data source. You can find instructions and examples to
complete each step throughout the rest of the chapter.
There are two general workflows: one for connecting to web services or XML documents as your
data source, and one for connecting to an external database.
Workflow for data source from web services or XML documents:
1.
Get the URL of your external data source:
■ A web service.
■ An XML document.
2.
Add components to the Stage:
■ Add a connector component.
■ Add a DataSet component, which you will bind to your data source and UI components.
■ Add UI components that will display data to users, such as a DataGrid component.
■ Add a resolver component.