I have an EXE and/or SWF movie that I use to display info from an XML file.
The XML file I am using is created and written by a CSharp program every
second. Regardless of how often I load the XML via my movie, this error
message pops up over the CSharp program, causing it to crash..."The process
cannot access the file because it is being used by another process". I load
the XML the most common way I think possible...
XMLobs = new XML();
XMLobs.ignoreWhite = true;
XMLobs.load(XMLFILENAME);
XMLobs.onLoad = function () {
XMLfile = new XML();
XMLfile = XMLobs.firstChild.firstChild.nextSibling;
XMLvars = XMLfile.childNodes;
for (var i = 0; i < XMLvars.length; i++) {
if (XMLvars[i].nodeName == "displayname") {
title = XMLvars[i].firstChild.nodeValue;
} else if (XMLvars[i].nodeName == "rawstring") {
udp = XMLvars[i].firstChild.nodeValue;
} else if (XMLvars[i].nodeName == "localtime") {
wxtime = XMLvars[i].firstChild.nodeValue;
}
}
}
Anyone know what I'm doing wrong or is there anything I can do differently to
load the XML without crashing the CSharp program...
Thanks
GenaroRG - 15 Jan 2008 23:57 GMT
Looks like a CSharp issue with file permissions. Looks like the Csharp script
is attempting to write to the xml at the same time flash is reading and parsing
it, and this is sure to happen if both writing and reading are occurring in an
asynchronous way. Have you tried using sockets instead of xml files? I would
recommend you take a look at the XMLSocket class in flash.