|
|||
|
Hello,
I want to save an XML file through SWFKit. I have invoked the data in a variable from Flash file. Now, when user click on the submit button, I want to open a "Save As" dialogue box. User will select the desired path and then the file should save as(with only .xml extenstion) to the selected path with data. Can anyone tell me how to achieve this? Many Thanks, Guy Logical |
|
|||
|
Code:
function saveScores()
{
var score = FlashPlayer.getVariable("_level0.gResultXml"); //gResultXml is global variable in flash which contains a huge XML type of string.
// remove the old file
var df = Dialogs.fileSave("XML Files(*.xml)|*.xml|All Files(*.*)|*.*|", "xml");
if (df)
{
var xmlFile = new FileStream(df, "w");
xmlFile.write(score);
}
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|