User Guide

setProp 535
After setPref() runs, if the movie is playing in a browser, a folder named Prefs is created in the
Plug-In Support folder. The
setPref() method can write only to that folder.
If the movie is playing in a projector or Director, a folder is created in the same folder as the
application. The folder receives the name Prefs.
Do not use this method to write to read-only media. Depending on the platform and version of
the operating system, you may encounter errors or other problems.
In a browser, data written by
setPref() is not private; any movie with Shockwave content can
read this information and upload it to a server. Do not store confidential information using
setPref().
On Windows,
setPref() fails if the user is a restricted user.
To see an example of
setPref() used in a completed movie, see the Read and Write Text movie
in the Learning/Lingo folder inside the Director application folder.
Parameters
prefName
Required. A string that specifies the file to write to. The prefName parameter must be
a valid filename. To make sure the filename is valid on all platforms, use no more than eight
alphanumeric characters for the file name.
prefValue Required. A string that specifies the text to write to the file prefName.
Example
This handler saves the contents of the field cast member Text Entry in a file named DayWare
settings:
-- Lingo syntax
on mouseUp me
_player.setPref("CurPrefs", member("Text Entry").text)
end
// JavaScript syntax
function mouseUp() {
_player.setPref("CurPrefs", member("Text Entry").text);
}
See also
getPref(), Player
setProp
Usage
setProp list, property, newValue
list.listProperty = newValue
list[listProperty] = newValue
Description
Command; in a list, replaces the value assigned to a specified property with a new value. If the list
does not contain the specified property,
setProp returns a script error.
The
setProp command works with property lists only. Using setProp with a linear list produces
a script error.