
92
Example
The following example saves the last frame a user entered to a local shared object kookie.
// Get the kookie
so = sharedobject.getlocal("kookie");
// Get the user of the kookie and go to the frame number saved for this user.
if (so.data.user != undefined) {
this.user = so.data.user;
this.gotoAndStop(so.data.frame);
}
The following code block is placed on each movie frame.
// On each frame, call the rememberme function to save the frame number.
function rememberme() {
so.data.frame=this._currentFrame;
so.data.user="John";
}
See also
SharedObject.close, SharedObject.flush, SharedObject.getRemote
SharedObject.getRemote
Availability
• Flash Player 6.
• Flash Communication Server MX.
Usage
SharedObject.getRemote(objectName, URI [, persistence])
Note: The correct syntax is SharedObject.getRemote. To assign the object to a variable, use syntax like
myRemoteSO = SharedObject.getRemote.
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 (object)” entry.
persistence An optional value that specifies whether the attributes of the shared object’s data
property are persistent locally, remotely, or both, and that may specify where the shared object
will be stored locally. Acceptable values are as follows:
• null (default) or false specifies that the shared object is not persistent on the client or server.
(These values have the same effect as omitting the
persistence parameter.)
• true specifies that the shared object is persistent only on the server.
• A full or partial local path to the shared object, which indicates that the shared object is
persistent on the client and the server; on the client, it is stored in the specified path. On the
server, it is stored in a subdirectory within the FlashCom application directory. For more
information, see the description below.
Note: If the user has chosen to never allow local storage for this domain, the object will not be saved locally, even if a
local path is specified for persistence. For more information, see “Local disk space considerations” on page 83.
Comentarios a estos manuales