SharedObject class
127
// Register the listener with the TextInput component instance.
myText_ti.addEventListener("enter", textListener);
The following example saves the last frame that a user entered to a local shared object 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);
}
The following code block is placed on each SWF file frame:
// On each frame, call the rememberme function to save the frame number.
function rememberme() {
my_so.data.frame=this._currentframe;
my_so.data.user="John";
}
See also
SharedObject.close()
,
SharedObject.flush()
,
SharedObject.getRemote()
SharedObject.getRemote()
Availability
■
Flash Player 6.
■
Flash Communication Server MX 1.0.
Usage
SharedObject.getRemote(
objectName, URI
[,
persistence
])
Parameters
objectName
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: ~ % & \ ; : " ' , < > ? #
URI
The URI of the server on which the shared object will be stored. This URI must be
identical to the URI of the NetConnection object to which the shared object will be
connected. For more information and an example, see the
SharedObject class
entry.
NO
TE
The correct syntax is
SharedObject.getRemote()
. To assign the object to a variable, use
syntax like
var myRemote_so:SharedObject = SharedObject.getRemote(
objectName
,
URI
)
.