MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference page 1090

Actionscript 2.0 language reference
Table of Contents

Advertisement

If your SWF file is delivered over a non-HTTPS connection and you try to set this parameter
to
, the creation of a new shared object (or the access of a previously created secure shared
true
object) fails and
is returned. Regardless of the value of this parameter, the created shared
null
objects count toward the total amount of disk space allowed for a domain. The default value is
.
false
The following diagram shows the use of the
parameter:
secure
Returns
- A reference to a shared object that is persistent locally and is available only to
SharedObject
the current client. If Flash Player can't create or find the shared object (for example, if
was specified but no such directory exists, or if the
parameter is used
localPath
secure
incorrectly) this method returns
.
null
This method fails and returns
if persistent shared object creation and storage by third-
null
party Flash content is prohibited (does not apply to local content). Users can prohibit third-
party persistent shared objects on the Global Storage Settings panel of the Settings Manager,
located at http://www.macromedia.com/support/documentation/en/flashplayer/help/
settings_manager03.html.
Example
The following example creates a shared object that stores text that is typed into a
TextInput
component instance. The resulting SWF file loads the saved text from the shared object when
it starts playing. Every time the user presses Enter, the text in the text field is written to the
shared object. To use this example, drag a
component onto the Stage, and name
TextInput
the instance
. Copy the following code into the main Timeline (click in an empty
myText_ti
area of the Stage or press Escape to remove focus from the component):
// Create the shared object and set localpath to server root.
var my_so:SharedObject = SharedObject.getLocal("savedText", "/");
// Load saved text from the shared object into the myText_ti TextInput
component.
myText_ti.text = my_so.data.myTextSaved;
1090 ActionScript classes

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents