Hi, I'm trying to allow to my flash application user's to create a xml file on their disk with the support of a simple script aspx. The script I'm sure it works because if I call it with the browser with the right parameters it creates the file, but if I call it from the movie it doesn't work. The code is
ActionScript Code:
fileExtension = ".xml";
fileFolder = "Files";
saveSeparator = "\\";
loadSeparator = "/";
var File = new XML(XML);
File.xmlDecl = "<?xml version=\"1.0\" ?>";
var resultXML = new XML();
resultXML.ignoreWhite = true;
resultXML.onLoad = verifySave;
var URL = "http://localhost/";
URL += "saveFile.aspx?filename=";
URL += escape(fileFolder + saveSeperator + filename + fileExtension);
File.sendAndLoad(URL,resultXML);
verifySave = function(save_success) {
if (save_success) {
var server_error = this.firstChild.firstChild.firstChild.nodeValue;
switch (server_error) {
case "none":
canvas.openErrorPopUp("File saved successfully.");
break;
case null:
case "":
case "error":
default:
canvas.openErrorPopUp("Error saving file.\nFile not saved.");
break;
case "exists":
canvas.openErrorPopUp("File already exists\nwith that name.\nTry a different\nfile name.");
break;
}
} else {
canvas.openErrorPopUp("Error saving file.\nFile not saved.");
}
}
Any suggests? Thank u, bye!