Class: PrefsStorage

prefs. PrefsStorage

new PrefsStorage

Constructor for a PrefsStorage object that can be saved to the Fireworks preferences file. Any properties added to the object will be saved when you call its save() method. To recover the stored data, instantiate a new object with the same name that was originally used to save the preference:

var settings = new prefs.PrefsStorage("MySettings", { foo: 42 });
alert(settings.foo); // 42
settings.foo = "bar";
settings.baz = "hello, world";
settings.save();
var newSettings = new prefs.PrefsStorage("MySettings", { foo: 42 });
alert(newSettings.foo); // "bar"
alert(newSettings.baz); // "hello, world"

Note that the properties save and remove are reserved and cannot be modified on a PrefsStorage instance.

Parameters:
Name Type Argument Default Description
inName String

The name of the preference.

inDefaults Object <optional>
null

An optional object containing default properties that will be added to the stored preference data, if any.

Source:
  • lib/fwlib/prefs.js, line 134
Returns:

A PrefsStorage instance with all of the properties of the previously stored instance, if any.

Type
Object

Methods

remove

Sets the named preference to null in the Fireworks preferences file, since there is no way to fully remove a value from that file.

Source:
  • lib/fwlib/prefs.js, line 158

save

Saves all of non-method properties of the PrefsStorage instance to the Fireworks preferences file as a JSON string.

Source:
  • lib/fwlib/prefs.js, line 145