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.
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...