
SharedObject.flush() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
763
The default maximum amount of data that can be saved to disk is 100 KB per domain. For
details, see SharedObject.flush(). To determine the size of the properties assigned to
data,
use SharedObject.getSize().
When a property of
data is an object that belongs to a custom class, the save/retrieve
process disconnects the object from its class. Methods and properties accessed via the
prototype chain will not be available to the object after it is retrieved. However, we can use
Object.registerClass() to associate the object with an identifier used to restore its class at
retrieval time. For details, see Object.registerClass().
Example
The following code retrieves a local SharedObject named “gameData”. It then assigns a
property,
player1score, and saves the object by invoking flush():
// Create/retrieve the SharedObject.
gameData_so = SharedObject.getLocal("gameData");
// Make a property to save.
gameData_so.data.player1score = 2600;
// Attempt to save the SharedObject.
gameData_so.flush();
See Also
Object.registerClass(), SharedObject.flush(), SharedObject.getLocal(), SharedObject.getSize()
SharedObject.flush() Method
forces data to be written (flushed) to disk
Flash 6
theSharedObj.flush()
theSharedObj.flush(minimumDiskSpace);
Arguments
minimumDiskSpace ...