Getlocal (Sharedobject.getlocal Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
The following function gets a shared object,
provided settings. Finally,
bytes of disk space.
this.syncSettingsCore = function(soName:String, override:Boolean,
settings:Object) {
var my_so:SharedObject = SharedObject.getLocal(soName, "http://
www.mydomain.com/app/sys");
// settings list index
var i;
// For each specified value in settings:
// If override is true, set the persistent setting to the provided value.
// If override is false, fetch the persistent setting, unless there
// isn't one, in which case, set it to the provided value.
for (i in settings) {
if (override || (my_so.data[i] == null)) {
my_so.data[i] = settings[i];
} else {
settings[i] = my_so.data[i];
}
}
my_so.flush(1000);
};
See also
clear (SharedObject.clear method)

getLocal (SharedObject.getLocal method)

public static getLocal(name:String, [localPath:String], [secure:Boolean]) :
SharedObject
Returns a reference to a locally persistent shared object that is available only to the current
client. If the shared object does not already exist, this method creates one. This method is a
static method of the SharedObject class. To assign the object to a variable, use syntax like the
following:
var so:SharedObject = SharedObject.getLocal("savedData")
If the user has selected to never allow local storage for this domain, the object is not
saved locally, even if a value for localPath is specified. The exception to this rule is local
content. Local content can always write shared objects from third-party domains
(domains other than the domain in the current browser address bar) to disk, even if
writing of third-party shared objects to disk is disallowed. .
my_so,
is called to save the settings and allot a minimum of 1000
flush()
,
onStatus (SharedObject.onStatus handler)
and fills writable properties with user-
SharedObject
1087

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF