User Guide
342 Chapter 12: Methods
To see an example of getPref() 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 file for which content is retrieved.
Example
This handler retrieves the content of the file Test and then assigns the file’s text to the field
Total Score:
-- Lingo syntax
on mouseUp
theText = _player.getPref("Test")
member("Total Score").text = theText
end
// JavaScript syntax
function mouseUp() {
var theText = _player.getPref("Test");
member("Total Score").text = theText;
}
See also
Player, setPref()
getPos()
Usage
list.getPos(value)
getPos(list, value)
Description
List function; identifies the position of a value in a list. When the specified value is not in the list,
the
getPos command returns the value 0.
For values contained in the list more than once, only the first occurrence is displayed. This
command performs the same function as the
getOne command when used for linear lists.
Parameters
value Required. Specifies the value associated with the position.
Example
This statement identifies the position of the value 12 in the list Answers, which consists of [#a:10,
#b:12, #c:15, #d:22]:
put Answers.getPos(12)
The result is 2, because 12 is the second value in the list.
See also
getOne()