Lingo Dictionary > G-K > getPref()

 

getPref()

Syntax

getPref(prefFileName)

Description

Function; retrieves the content of the specified file.

When you use this function, replace prefFileName with the name of a file created by the setPref function. If no such file exists, getPref returns VOID.

The file name used for prefFileName must be a valid file name only, not a full path; Director supplies the path. The path to the file is handled by Director. The only valid file extensions for prefFileName are .txt and .htm; any other extension is rejected.

Do not use this command to access read-only or locked media.

Note: In a browser, data written by setPref is not private. Any Shockwave movie can read this information and upload it to a server. Confidential information should not be stored using setPref.

To see an example of getPref() used in a completed movie, see the Read and Write Text movie in the Learning\Lingo Examples folder inside the Director application folder.

Example

This handler retrieves the content of the file Test and then assigns the file's text to the field Total Score:

on mouseUp
	theText = getPref("Test")
	member("Total Score").text = theText
end

See also

setPref