SetPref

From Director Online Wiki
Jump to: navigation, search
setPref
Type: method
Version:  ?
Language: Lingo, JavaScript
Dependencies: none
Links/Related
getPref, fileIO






Saves the given text to a file on the user's hard drive.

Syntax

 setPref(string file name, string file contents)


from MX 2004 Documentation

-- Lingo syntax

 _player.setPref(stringPrefName, prefString)

// JavaScript syntax

 _player.setPref(stringPrefName, prefString);


File Locations

Here are the paths to where the SetPref files are stored, depending on platform, version and runmode:

Mac OS X

Director MX 2004 (authoring)

Mac HD:User:username:Library:Application Support:Macromedia:Director MX 2004:Prefs:

D10 Application (runtime)

Mac HD:User:username:Library:Application Support:Macromedia:Director MX 2004:AppName.osx:Prefs:

D11 (authoring)

Mac HD:User:username:Library:Application Support:Adobe:Director 11:Prefs:

D11 Application (runtime)

Mac HD:User:username:Library:Application Support:Adobe:Director 11:AppName:Prefs:

Windows XP

Director MX 2004 (authoring)

C:\Documents and Settings\username\Application Data\Macromedia\Director MX 2004\Prefs\

D10 Application (runtime)

C:\Documents and Settings\username\Application Data\Macromedia\Director MX 2004\AppName\Prefs\


Locked Media

If your projector is running from a read-only disk, such as a CD-ROM, SetPref() will save a file to the Temp folder on your hard disk. This file will be deleted when your projector quits, so it will only save the user's preferences for the current session.

If you need to allow users to save data permanently from an application running from a locked disk, try using fileIO to save a file to one of the following paths:

Mac HD:User:username:Library:Application Support:publisher:project:
C:\Documents and Settings\username\Application Data\publisher\project\

For Director MX 2004 and earlier, you can use the fx_FolderGetSpecialPath() method of FileXtra4 to determine the path to the Application Stuff folder.


See also

GetPref


External links

SetPref in Director MX 2004 LiveDocs]