03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Returns the total number of bytes the SWF file can use to store mobile shared objects on the<br />

device.<br />

For example, if this method returns 1K, the movie can save one shared object of 1K, or<br />

multiple smaller shared objects, as long as their combined size does not exceed 1K. This<br />

method is a static method of the SharedObject class.<br />

Returns<br />

Number - A numeric value that specifies the total number of bytes the movie is allowed to store<br />

on the device. This is also the size available to all content that is loaded dynamically through<br />

loadMovie().<br />

Example<br />

The following example checks whether more than 1KB of storage is reserved before creating a<br />

Flash Lite shared object.<br />

if (SharedObject.getMaxSize() > 1024) {<br />

var my_so:SharedObject = SharedObject.getLocal("sharedObject1");<br />

} else {<br />

trace("SharedObject's maximum size is less than 1 KB.");<br />

}<br />

getSize (SharedObject.getSize method)<br />

public getSize() : Number<br />

Gets the current size of the shared object, in bytes.<br />

Flash calculates the size of a shared object by stepping through all of its data properties; the<br />

more data properties the object has, the longer it takes to estimate its size. Estimating object<br />

size can take significant processing time, so you may want to avoid using this method unless<br />

you have a specific need for it.<br />

If the shared object listener has not yet been called, getSize() returns 0. For details about<br />

using the listener, see the addListener() method.<br />

Returns<br />

Number - A numeric value specifying the size of the shared object, in bytes.<br />

Example<br />

The following example gets the size of the shared object my_so:<br />

var items_array:Array = new Array(101, 346, 483);<br />

var currentUserIsAdmin:Boolean = true;<br />

var currentUserName:String = "Ramona";<br />

560 ActionScript classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!