User Guide

742 Chapter 2: ActionScript Language Reference
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 cant create or find the shared object (for example, if
localPath was specified but no such
directory exists), this method returns
null.
Description
Method; returns a reference to a locally persistent shared object that is available only to the
current client.
Note: 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. For more information, see “Local disk space
considerations” on page 735.
To avoid name collisions, Flash looks at the location of the SWF file that is creating the shared
object. For example, if a SWF file at www.myCompany.com/apps/stockwatcher.swf creates a
shared object named
portfolio, that shared object will not conflict with another object named
portfolio that was created by a SWF file at www.yourCompany.com/photoshoot.swf because
the SWF files originate from different directories.