I have a calculator that loads an xml file which contains a
load of factors. If the user changes their details (age or sex)
then it reloads this xml file to pull out the relevant factor.
On my local disk this works fine. However, when on the server
it will work 1 or 2 times accessing and parsing the xml file
perfectly, but then will stop working and freeze for a while. It'll
then work again for 1 time and then stop again and so on. I've
attached the code that loads the xml file.
The strange thing is that whether it's working or not it
loads a 0 error code thing (success) and doesn't display "document
failed" - but with the line of text I added to access
childNode, it works ok 1 or 2 times, but is undefined when the
It seems flash is being a bit hit and miss at loading the xml
file properly. Once it's loaded into flash should it be continually
available or do I need to keep reloading it every time they change
their details? If it's always available, that also doesn't seem to
I have solved this I think - not entirely sure how.
In the above code links to a function called processBook and
passes through the value of book_xml. In declaring the processBook
function I pull this into xmlDoc_xml (function
processBook(xmlDoc_xml). Not entirely sure why as I borrowed that
bit from a book.
Anyway, I've removed the reference to xmlDoc_xml and replaced
it with book_xml and it seems to work perfectly. I believe it the
reason is that when it goes back to that function it looks for
xmlDoc_xml which is only available the first time... something like