MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 584

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

Advertisement

Example
In the following example, a SWF file creates a listener function named
a shared object. The player calls the
function loadCompletePrefs (SharedObject:mySO) {
if (0 == mySO.getSize() )
{
// If the size is 0, we need to initialize the data:
mySO.data.name = "Sigismund";
mySO.data.email = "siggy@macromedia.com";
}
else
}
// Trace all the data in mySO:
trace( "Prefs:" );
for (var idx in mySO.data) {
trace( " " + idx +": " + mySO.data[idx] );
}
}
}
SharedObject.addListener( "Prefs", loadCompletePrefs );
// We can now create the shared object:
var Prefs:SharedObject = SharedObject.getLocal("Prefs");
When the player has notified the listener that the data is available, the application can use the
shared object returned from the call to the
object is used in Flash. The application can add, modify, or remove properties while the
content is playing. When the content is unloaded, the shared object might be written to the
device; however, to guarantee that the shared object will be written to the device, the
application must force a write operation by calling the
Flash Lite shared objects are available only to locally stored SWF files. SWF files playing back
in a network-enabled browser cannot use Flash Lite shared objects.
The total amount of storage for Flash Lite shared objects per SWF file is limited by the
deviceto a predetermined size. You can determine this size by using the
SharedObject.getMaxSize()
Note: Remote shared objects are not supported in Flash Lite 2.0.
See also
getLocal (SharedObject.getLocal method)
onStatus (SharedObject.onStatus handler)
584
ActionScript classes
loadCompletePrefs
getLocal()
method.
,
flush (SharedObject.flush method)
Prefs
function when the data is available.
method in the same way a shared
method.
flush()
and then creates
,

Advertisement

Table of Contents
loading

Table of Contents