User Guide

Add ActionScript to the main Timeline 33
8.
On the Stage, select the products_ds instance. In the Bindings tab of the Component inspector,
notice that the component’s data provider appears in the Binding List (the top pane of the
Bindings tab). In the Binding Attributes pane, the Bound To parameter indicates that the
products_ds instance is bound to the products_xmlcom instance, and the binding direction
is In.
In the next few steps you’ll bind the DataSet instance to the DataGrid instance so that the data
that is filtered by the data set will be displayed in the data grid.
9.
With the products_ds instance still selected, click the Add Binding button in the Bindings tab.
10.
In the Add Binding dialog box, select the dataProvider: array item and click OK.
11.
In the Bindings tab, make sure the dataProvider: array item is selected in the Binding List.
12.
Click the Bound To item in the Binding Attributes pane.
13.
In the Value column for the Bound To item, click the magnifying glass icon to open the Bound
To dialog box.
14.
In the Bound To dialog box, select the products_dg (DataGrid) instance in the Component
Path pane. Select
dataProvider:array in the Schema Location pane. Click OK.
Add ActionScript to the main Timeline
With the application architecture and data binding in place, youre ready to add ActionScript to
the main Timeline to complete the application functionality.
Create references to component class names
Each component is associated with a class file that defines its methods and properties. In this
section of the tutorial, you’ll add ActionScript to create references to the class names for the
components used in the application. For some of these components, you have already added
instances to the Stage. For others, you’ll add ActionScript later in the tutorial to create instances
dynamically.
Creating a references to the class name makes it easier to write ActionScript for the component
because it enables code completion for component instances, so you can avoid using the fully
qualified name. For example, when you create a reference to the class file for the ComboBox
component, you can refer to instances of the ComboBox with the syntax
instanceName:ComboBox, rather than instanceName:mx.controls.ComboBox.
You’ll need these classes:
WebService class This class populates the ComboBox instance with a list of “problems.” For
this class, you’ll also need to import the WebServiceClasses item from the Classes common
library. This item contains compiled clips (SWC files) that you’ll need in order to compile and
generate the SWF file for your application.