Created
May 27, 2011 10:53
-
-
Save cbiggins/995034 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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