SharedObject.getLocal()
403
Example
The following function gets a shared object,
my_so,
and fills writable properties with user-
provided settings. Finally,
flush()
is called to save the settings and allot a minimum
of 1000 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);
};
SharedObject.getLocal()
Availability
Flash Player 6.
Usage
SharedObject.getLocal(
objectName:String
[,
localPath:String
])
: SharedObject
Note:
The correct syntax is
SharedObject.getLocal
. To assign the object to a variable, use syntax like
myLocal_so
= SharedObject.getLocal
.
Parameters
objectName
A string that represents the name of the object. The name can include forward
slashes (
/
); for example,
work/addresses
is a legal name. Spaces are not allowed in a shared
object name, nor are the following characters:
~ % & \ ; : " ' , < > ? #
localPath
An optional string parameter that specifies the full or partial path to the SWF file
that created the shared object, and that determines where the shared object will be stored locally.
The default value is the full path. See the Description section for a discussion of this parameter’s
importance.
Returns
A reference to a shared object that is persistent locally and is available only to the current client. If
Flash can’t create or find the shared object (for example, if
localPath
was specified but no such
directory exists), this method returns
null
.
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...