User Guide
538 Chapter 12: Methods
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.
This method does not perform any sophisticated manipulation of the string data or its
formatting. You must perform any formatting or other manipulation in conjunction with
getPref(); you can manipulate the data in memory and write it over the old file using
setPref().
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, the
setPref() method 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
stringPrefName
Required. A string that specifies the name of the file to which the string
prefString is written. The file is a standard text file.
prefString Required. The string to write to the file specified by stringPrefName.
Example
This handler saves the contents of the field cast member Text Entry in a file named DayWare
settings:
See also
getPref(), Player
setTrackEnabled()
Usage
-- Lingo syntax
spriteObjRef.setTrackEnabled(whichTrack, trueOrFalse)
// JavaScript syntax
spriteObjRef.setTrackEnabled(whichTrack, trueOrFalse);
Description
Command; determines whether the specified track in the digital video is enabled to play.
• When setTrackEnabled is TRUE, the specified track is enabled and playing.
• When setTrackEnabled is FALSE, the specified track is disabled and muted. For video tracks,
this means they will no longer be updated on the screen.
To test whether a track is already enabled, test the
trackEnabled sprite property.
Parameters
whichTrack Required. Specifies the track to test.