On the Stage, select the products_ds instance. In the Bindings tab of the Component inspector,
8.
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.
With the products_ds instance still selected, click the Add Binding button in the Bindings tab.
9.
In the Add Binding dialog box, select the
10.
In the Bindings tab, make sure the
11.
Click the Bound To item in the Binding Attributes pane.
12.
In the Value column for the Bound To item, click the magnifying glass icon to open the Bound
13.
To dialog box.
In the Bound To dialog box, select the products_dg (DataGrid) instance in the Component
14.
Path pane. Select
Add ActionScript to the main Timeline
With the application architecture and data binding in place, you're 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
You'll need these classes:
WebService class
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.
dataProvider: array
dataProvider:array
, rather than
instanceName:mx.controls.ComboBox
This class populates the ComboBox instance with a list of "problems." For
dataProvider: array
item is selected in the Binding List.
in the Schema Location pane. Click OK.
Add ActionScript to the main Timeline
item and click OK.
.
33
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers