User Guide

DataSet.saveToSharedObj() 403
Parameters
objName A string that specifies the name of the shared object to create. The name can
include forward slashes (for example, “work/addresses”). Spaces and the following characters
are not allowed in the specified name:
~ % & \ ; : " ' , < > ? #
localPath
An optional string parameter that specifies the full or partial path to the SWF
file that created the shared object. This string is used to determine where the object is stored
on the users computer. The default value is the SWF file’s full path.
Returns
Nothing.
Description
Method; saves all of the relevant data needed to restore this DataSet collection to a shared
object. This allows users to work when disconnected from the source data, if it is a network
resource. This method overwrites any data that might exist within the specified shared object
for this DataSet collection. To restore a DataSet collection from a shared object, use
DataSet.loadFromSharedObj(). Note that the instance name of the DataSet collection is
used to identify the data within the specified shared object.
If the shared object cant be created or there is a problem flushing the data to it, this method
throws a
DataSetError exception.
Example
The following example calls saveToSharedObj() in a try..catch block and displays an
error if there is a problem saving the data to the shared object.
import mx.data.components.datasetclasses.DataSetError;
try {
my_ds.saveToSharedObj("webapp/customerInfo");
} catch(e:DataSetError) {
trace("Unable to create shared object”);
}
See also
DataSet.loadFromSharedObj()