View Full Version : Create a xml file on the disk

09-22-2005, 02:51 PM
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

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);
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.");
case null:
case "":
case "error":
canvas.openErrorPopUp("Error saving file.\nFile not saved.");
case "exists":
canvas.openErrorPopUp("File already exists\nwith that name.\nTry a different\nfile name.");
} else {
canvas.openErrorPopUp("Error saving file.\nFile not saved.");

Any suggests? Thank u, bye!

09-22-2005, 03:40 PM
You can only use URL += "saveFile.aspx?filename="; in the browser.

As soon as you start passing variables to a URL, it has to run in the browser... Maybe look into using a 3rd party tool.. like Flash Jester or something. It could solve your problem.

09-22-2005, 06:28 PM
So, you said that it's impossible pass variables to a URL that doesn't run in the browser, right? Sorry, but I don't know Flash Jester, where can I download it?Is it free? Does it work whith flash mx 2004?
Thanks for the help!

09-23-2005, 07:07 AM

Dont think its free, but I dont think its expensive either... Theres a trial download, I think...

10-08-2005, 04:15 AM
Another one is MDM Zinc: http://www.multidmedia.com. That one's more expensive but it's 100 times better for larger projects.