Getlocal (Sharedobject.getlocal Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

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

Advertisement

getLocal (SharedObject.getLocal method)

public static getLocal(name:String) : 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,
static method of the SharedObject class.
Note: In Flash Lite, a shared object cannot be shared between two SWF files.
To assign the object to a variable, use syntax like the following
var so:SharedObject = SharedObject.getLocal("savedData")
Because the data may not be immediately available for reading on the device, the application
must create and register a listener for the shared object identified by
description of the
addListener()
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- A string that represents the name of the object. The name can include forward
name:String
slashes (
); for example,
/
object name, nor are the following characters:
~ % & \ ; : " ' , < > ? #
Returns
- A reference to a shared object that is persistent locally and is available only to
SharedObject
the current client. If Flash can't create or find the shared object,
This method fails and returns
party Flash content is prohibited by the device.
Example
The following example saves the last frame that a user entered to a local shared object named
:
kookie
// Get the kookie
var my_so:SharedObject = SharedObject.getLocal("kookie");
// Get the user of the kookie and go to the frame number saved for this
user.
if (my_so.data.user != undefined) {
this.user = my_so.data.user;
this.gotoAndStop(my_so.data.frame);
}
method.
is a valid name. Spaces are not allowed in a shared
work/addresses
if persistent shared object creation and storage by third-
null
creates one. This method is a
getLocal()
name
getLocal()
. For details, see the
returns
.
null
SharedObject
591

Advertisement

Table of Contents
loading

Table of Contents