User Guide
302 Chapter 6: Components Dictionary
logChanges is a Boolean value that defaults to true. If this parameter is set to true, the data set
logs all changes made to its data and any method calls made on the associated transfer objects.
readOnly is a Boolean value that defaults to false. If this parameter is set to true, the data set
cannot be modified.
You can write ActionScript to control these and additional options for the DataSet component
using its properties, methods, and events. For more information, see “DataSet class (Flash
Professional only)” on page 304.
Common workflow for the DataSet component
The typical workflow for the DataSet component is as follows.
To use a DataSet component:
1.
Add an instance of the DataSet component to your application and give it an instance name.
2.
Select the Schema tab for the DataSet component and create component properties to represent
the persistent fields of the data set.
3.
Load the DataSet component with data from an external data source. (For more information,
see “About loading data into the DataSet component” in Using Flash.)
4.
Use the Bindings tab of the Component inspector to bind the data set fields to UI components
in your application.
The UI controls are notified as records (transfer objects) are selected or modified within the
DataSet component, and updated accordingly. In addition, the DataSet component is notified
of changes made from within a UI control; those changes are tracked by the data set and can be
extracted by means of a delta packet.
5.
Call the methods of the DataSet component in your application to manage your data.
Note: In addition to these steps, you can bind the DataSet component to a connector and a
resolver component to provide a complete solution for accessing, managing, and updating data
from an external data source.
Creating an application with the DataSet component
Typically, you use the DataSet component with other user interface components, and often with a
connector component such as XMLConnector or WebServiceConnector. The items in the data
set are populated by means of the connector component or raw ActionScript data, and then
bound to user interface controls (such as List or DataGrid components).
The DataSet component uses functionality in the data binding classes. If you intend to work with
the DataSet component in ActionScript only, without using the Binding and Schema tabs in the
Component inspector to set properties, you’ll need to import the data binding classes into your
FLA file and set required properties in your code. See “Making data binding classes available at
runtime (Flash Professional only)” on page 213.