MACROMEDIA FLASH 8-USING FLASH Use Manual page 453

Using flash
Table of Contents

Advertisement

To request the data, use the
must access the array using numeric indices; that is,
the array, use the following statement:
for(var i=0; i < myArray.length; i++);
The expression
for(var i in myArray)
To control lazy decoding, you use ActionScript. For more information, see
"SOAPCall.doLazyDecoding" in the Components Language Reference.
Transfer objects in the DataSet component
It is important to remember that the DataSet component is a collection of transfer objects.
This differs from previous implementations of the component, when it was simply an in-
memory cache of data (array of record objects). Transfer objects expose business data from an
external data source through public properties or accessor methods. When you load data into
the DataSet component, the data is translated into a collection of transfer objects. In the
simplest scenario, the DataSet component creates and loads the data into anonymous objects.
Each anonymous object implements the TransferObject interface, which is all that is required
for the DataSet component to manage the objects. The DataSet component tracks changes
made to the data and any method calls that are made on the objects. If methods are called on
an anonymous object, nothing happens, because the methods don't exist. However, the
DataSet component tracks them in the DeltaPacket, which guarantees that they will be sent to
the external data source, where they can be called if appropriate.
In an enterprise solution you could create a client-side ActionScript transfer object that
mirrors a server-side transfer object. This client object can implement additional methods for
manipulating the data or applying client-side constraints. Developers can use the
parameter of the DataSet component to identify the class name of the client-
itemClassName
side transfer object that should be created. In this scenario, the DataSet component generates
multiple instances of the specified class and initializes it with the loaded data. When
is called on the DataSet component, the
addItem()
empty instance of the client-side transfer object.
If you take the enterprise solution one step further, you could implement a client-side transfer
object that uses web services or Flash Remoting. In this scenario, the object makes direct calls
on the server in addition to possibly storing the calls in the DeltaPacket.
You can create a custom transfer object for use by the DataSet component by creating a
class that implements the TransferObject interface. For more information on the
TransferObject interface, see "TransferObject interface" in the Components Language
Reference.
ActionScript expression, as for any array. You
myArray[myIndex]
won't work in this case.
must be a number. To iterate over
myIndex
is used to create an
itemClassName
Advanced topics in data integration
453

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents