Flash Lite 2.x and 3.0 ActionScript Language Reference

getMaxSize (SharedObject.getMaxSize method)

public static getMaxSize() : Number

Returns the total number of bytes the SWF file can use to store mobile shared objects on the device.

For example, if this method returns 1K, the movie can save one shared object of 1K, or multiple smaller shared objects, as long as their combined size does not exceed 1K. This method is a static method of the SharedObject class.

Returns

Number - A numeric value that specifies the total number of bytes the movie is allowed to store on the device. This is also the size available to all content that is loaded dynamically through loadMovie().

Example

The following example checks whether more than 1KB of storage is reserved before creating a Flash Lite shared object.

if (SharedObject.getMaxSize() > 1024) {
    var my_so:SharedObject = SharedObject.getLocal("sharedObject1");
} else {
    trace("SharedObject's maximum size is less than 1 KB.");
}