User Guide

1092 ActionScript classes
Example
The following example gets the size of the shared object
my_so:
var items_array:Array = new Array(101, 346, 483);
var currentUserIsAdmin:Boolean = true;
var currentUserName:String = "Ramona";
var my_so:SharedObject = SharedObject.getLocal("superfoo");
my_so.data.itemNumbers = items_array;
my_so.data.adminPrivileges = currentUserIsAdmin;
my_so.data.userName = currentUserName;
var soSize:Number = my_so.getSize();
trace(soSize);
onStatus (SharedObject.onStatus handler)
onStatus = function(infoObject:Object) {}
Invoked every time an error, warning, or informational note is posted for a shared object. If
you want to respond to this event handler, you must create a function to process the
information object that is generated by the shared object.
The information object has a code property containing a string that describes the result of the
onStatus handler, and a level property containing a string that is either "Status" or
"Error".
In addition to this
onStatus handler, Flash also provides a super function called
System.onStatus. If onStatus is invoked for a particular object and no function is assigned
to respond to it, Flash processes a function assigned to
System.onStatus, if it exists.
The following events notify you when certain
SharedObject activities occur:
Availability: ActionScript 1.0; Flash Player 6
Code property Level property Meaning
SharedObject.Flush.Fa
iled
Error SharedObject.flush() command that
returned
"pending" has failed (the user did
not allot additional disk space for the shared
object when Flash Player showed the Local
Storage Settings dialog box).
SharedObject.Flush.Su
ccess
Status SharedObject.flush() command that
returned
"pending" has been successfully
completed (the user allotted additional disk
space for the shared object).