Skip to content

Instantly share code, notes, and snippets.

@cbiggins
Created May 27, 2011 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbiggins/995034 to your computer and use it in GitHub Desktop.
Save cbiggins/995034 to your computer and use it in GitHub Desktop.
function writePrefs(){
prefsFile = getPrefsFile();
if (prefsFile.exists) {
var cr = air.File.lineEnding;
prefsXML = "<?xml version='1.0' encoding='utf-8'?>" + cr +
"<preferences>" +
cr +
"<time>" + getTimeSelection() + "</time>" +
cr +
"<bounce>" + getBounce() + "</bounce>" +
cr +
"<sound>" + getSound() + "</sound>" +
cr +
"<saveDate>" +
new Date().toString() +
"</saveDate>" +
cr +
"</preferences>";
stream = new air.FileStream();
stream.open(prefsFile, air.FileMode.WRITE);
stream.writeUTFBytes(prefsXML);
stream.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment