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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

notifyFunction:Function - The name of a function the player calls to notify the<br />

application that the getLocal() method has executed <strong>and</strong> the data is finished loading.<br />

clear (SharedObject.clear method)<br />

public clear() : Void<br />

Purges all the data from the shared object <strong>and</strong> deletes the shared object from the disk. The<br />

reference to my_so is still active, <strong>and</strong> my_so is now empty.<br />

Example<br />

The following example sets data in the shared object, <strong>and</strong> then empties all of the data from the<br />

shared object:<br />

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

my_so.data.name = "Hector";<br />

trace("before my_so.clear():");<br />

for (var prop in my_so.data) {<br />

trace("\t"+prop);<br />

}<br />

trace("");<br />

my_so.clear();<br />

trace("after my_so.clear():");<br />

for (var prop in my_so.data) {<br />

trace("\t"+prop);<br />

}<br />

This ActionScript displays the following message in the Output panel:<br />

before my_so.clear():<br />

name<br />

after my_so.clear():<br />

data (SharedObject.data property)<br />

public data : Object<br />

The collection of attributes assigned to the data property of the object. Each attribute can be<br />

an object of any basic ActionScript or JavaScript type—Array, Number, Boolean, <strong>and</strong> so on.<br />

For example, the following lines assign values to various aspects of a shared object.<br />

Note: For Flash Lite, if the shared object listener has not been invoked, the data property<br />

could contain undefined values. For details, see the description of the addListener()<br />

method.<br />

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

var currentUserIsAdmin:Boolean = true;<br />

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

SharedObject 555

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

Saved successfully!

Ooh no, something went wrong!