Sharedobject Class - MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

SharedObject class

Availability
Flash Player 6.
Description
Shared objects are quite powerful: they offer real-time data sharing between objects that are
persistent on the user's computer. You can think of local shared objects as "cookies."
You can use local shared objects to maintain local persistence. This is the simplest way to use a
shared object. For example, you can call
such as a calculator with memory, in the player. Because the shared object is locally persistent,
Flash saves its data attributes on the user's machine when the SWF file ends. The next time the
SWF file runs, the calculator contains the values it had when the SWF file ended. Alternatively, if
you set the shared object's properties to
any prior values the next time the SWF file runs.
To create a local shared object, use the following syntax:
// Create a local shared object
so = SharedObject.getLocal("foo");
Local disk space considerations
Local shared objects are always persistent on the client, up to available memory and disk space.
By default, Flash can save locally persistent remote shared objects up to 100K in size. When you
try to save a larger object, Flash Player displays the Local Storage dialog box, which lets the user
allow or deny local storage for the domain that is requesting access. Make sure your Stage size is at
least 215 x 138 pixels; this is the minimum size Flash requires to display the dialog box.
If the user clicks Allow, the object is saved and
property of
SharedObject.Flush.Success
SharedObject.onStatus
The user can also specify permanent local storage settings for a particular domain by right-
clicking (Windows) or Control-clicking (Macintosh) while a SWF file is playing, choosing
Settings, and then opening the Local Storage panel.
SharedObject.getLocal()
before the SWF ends, the calculator opens without
null
SharedObject.onStatus
; if the user clicks Deny, the object is not saved and
is invoked with a
code
to create a shared object,
property of
SharedObject.Flush.Failed
is invoked with a
code
.
SharedObject class
617

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Table of Contents