View Full Version : Reloading a loaded XML object

03-28-2003, 02:55 AM

I am doing a XML-based guestbook with ASP. I have the following codes in the 1st frame. ReadXML() is a prototype that will read the XML object and populate the fields of the guestbook.

var GuestBook = new XML;

GuestBook.onLoad=function(sucess) {
if (sucess) {

My problem is: when an entry is submitted, the ASP inserts the entry into the XML, I try to reload the XML object by going to the above frame. It is however, not re-loaded, even though I have the new XML command.

Am I doing it wrongly? Or is there a better way?

Help please!

Thanks in advance.

03-28-2003, 03:32 AM

I think you should show us that ReadXML() function as well... ;)

03-28-2003, 04:18 AM
Thanks CyanBlue for the reply,

I just found the answer in http://tupps.com/flash/faq/xml.html#4-G.

It was a cache issue..I did the following and it works fine now:

unique=new Date().getTime()

03-28-2003, 11:37 AM
Yup... That's where I was heading to... ;)

Use one liner...
GuestBook.load("GuestBook.xml?uniqueID=" + getTimer());


12-13-2005, 03:22 AM
as a slight improvement to this...
the following method is not only more reliable but it allows the user to accept cached xml between your xml modifications so it's more efficient too.

you can get the date and time that your xml file was last modified using some some asp/php in the page hosting the swf.

then pass it in to flash via the object tag filenames. eg:
"myMovie.swf?dtm=<%=dtm%>" <!-- that's an asp example -->

(remember to url encode it first though)

then in your flash code you just attach that variable to the xml request string instead of a random number.

(again, you'll need to url encode it first)

12-13-2005, 03:11 PM
The problem with that method is that the string size is limited to about 1k... So, it might be good if you have small data to transfer... ;)