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.

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

my_so.data.itemNumbers = items_array;<br />

my_so.data.adminPrivileges = currentUserIsAdmin;<br />

my_so.data.userName = currentUserName;<br />

var soSize:Number = my_so.getSize();<br />

trace(soSize);<br />

onStatus (SharedObject.onStatus h<strong>and</strong>ler)<br />

onStatus = function(infoObject:Object) {}<br />

Invoked every time an error, warning, or informational note is posted for a shared object. To<br />

respond to this event h<strong>and</strong>ler, you must create a function to process the information object<br />

that is generated by the shared object.<br />

The information object has a code property that contsins a string that describes the result of<br />

the onStatus h<strong>and</strong>ler, <strong>and</strong> a level property that contains a string that is either "Status" or<br />

"Error".<br />

In addition to this h<strong>and</strong>ler, Flash Lite also provides a super function called System.onStatus.<br />

If onStatus is invoked for a particular object <strong>and</strong> no function is assigned to respond to it,<br />

Flash Lite processes a function assigned to System.onStatus, if it exists.<br />

The following events notify you when certain SharedObject activities occur:<br />

Code property Level property Meaning<br />

SharedObject.Flush.Fai<br />

led<br />

SharedObject.Flush.Suc<br />

cess<br />

Parameters<br />

Error SharedObject.flush() method that<br />

returned "pending" has failed (the user<br />

did not allot additional disk space for<br />

the shared object when Flash Player<br />

showed the Local Storage Settings<br />

dialog box).<br />

Status SharedObject.flush() method that<br />

returned "pending" was successfully<br />

completed (the user allotted additional<br />

disk space for the shared object).<br />

infoObject:Object - A parameter defined according to the status message.<br />

Example<br />

The following example displays different messages based on whether the user chooses to allow<br />

or deny the SharedObject instance to write to the disk.<br />

SharedObject 561

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

Saved successfully!

Ooh no, something went wrong!