-- Lingo syntax _player.setPref(stringPrefName, prefString) // JavaScript syntax _player.setPref(stringPrefName, prefString);
Player method; writes a specified string to a specified file on the computers local disk. The file is a standard text file.
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.
These are the locations where the file is created.
Windows Projector/Director
..\Documents and Settings\<username>\Application Data\Adobe\Director<version number>\Prefs\
Windows Shockwave
..\Documents and Settings\<username>\Application Data\Adobe\Shockwave Player <version number>\Prefs\
MAC Projector
~/Library/Application Support/Adobe/Director <version number>/Prefs
MAC Shockwave
~/Library/Application Support/Adobe/Shockwave Player<version number>/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.
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.
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("DayWare", member("Text Entry").text)
end
// JavaScript syntax
function mouseUp() {
_player.setPref("DawWare", member("Text Entry").text);
}