PDA

View Full Version : external swf not loading their xml - cache?


djrez
11-11-2008, 01:57 AM
I have a swf named base.swf that contains two buttons. Each button loads an external swf. Each external swf loads data from an xmlfile.php.

If I press button 1, it loads movie1.swf and the movie1xml.php data just fine.
Then, when I press button2, it loads movie2.swf but again loads the movie1xml.php data.

If I clear the cache and:
Press button 2 first, it loads movie2.swf and the movie2xml.php data just fine.
Then, when I press button1, it loads movie1.swf but again loads the movie2xml.php data.

So for some reason, this shows that everything seems to be setup ok, but the right data never loads. In the broswer, if i go straight to the domain.com/movie2.swf or domain.com/movie1.swf, everything always loads fine. The problem only occurs when using the base.swf to load the external movies.


The only other thing that i can think of to mention is that each movies xmlfile.php is defined in an external .as file when published. That seems irrelevant.

I'd really apprectiate any ideas. Please.

djrez
11-12-2008, 05:06 PM
I found some information that I thought would solve this problem in the last post of the thread here:
http://forum.tufat.com/showthread.php?t=37258

Each one of my loaded swfs have a main.as file that looks to the root for an undefined xml file as well. _lockroot is also already in these files.

defaultSettings();
settings = new Object();// this object will read the general settings from the xml and it will be further
// used in the classes
news = this;
news["bg"]._visible = false;
var xmlOb:XML = new XML();
xmlOb.ignoreWhite = true;
xmlOb.onLoad = function() {
cont(xmlOb);
};

xmlOb.load(_root.xmlFile == undefined ? "xml/menu_sandwiches.php" : _root.xmlFile);

}

So I changed the load to:
xmlOb.load("xml/menu_sandwiches.php");


To try and avoid the undefined check mentioned in the thread I linked to above.
And also tried to work in the _root.xmlFile without success. What is the correct way to write this code to avoid the problem that username: symphy says he resolved in the forum I linked to above? I am getting the exact same results still.

thanks

djrez
11-13-2008, 03:50 PM
I wanted to note that when changing my "xml" files from php files to static xml files and testing locally, the same problem occurs. In other words, locally, if I run base.swf directly and not in the browser, the problem still happens. This is a good clue that the problem isn't a cache or php situation (im probably in the wrong forum section) and a random number on the end of any file names won't help.

If anyone can help with this it would be great. I've looked everywhere and only found random number suggestions and _lockroot suggestions. _lockroot is in each external swf main.as. It must be the _root.xmlFile problem above?

Anyone know how to write:

xmlOb.load(_root.xmlFile == undefined ? "xml/menu_sandwiches.php" : _root.xmlFile)


;


properly so the undefined is not checked. Or have any other ideas?

thank you for your time. I've learned a lot through this but it's still not solved.