Getmaxsize (Sharedobject.getmaxsize Method); Getsize (Sharedobject.getsize Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

The following code block is placed on each SWF file frame:
// On each frame, call the rememberme function to save the frame number.
function rememberme() {
my_so.data.frame=this._currentframe;
my_so.data.user="John";
}

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.
Availability: ActionScript 1.0; Flash Lite 2.0
Returns
- A numeric value that specifies the total number of bytes the movie is allowed to store
Number
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.");
}

getSize (SharedObject.getSize method)

public getSize() : Number
Gets the current size of the shared object, in bytes.
Flash calculates the size of a shared object by stepping through all of its data properties; the
more data properties the object has, the longer it takes to estimate its size. Estimating object
size can take significant processing time, so you may want to avoid using this method unless
you have a specific need for it.
592
ActionScript classes

Advertisement

Table of Contents
loading

Table of Contents