| Ultrashock Forums
• cache problems -flash, php, xml site |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
|
2008-11-10
#2 |
||
|
Last edited by djrez : 2008-11-10 at 16:13.
|
|
|
2008-11-11
#3 |
||
|
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. Code:
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: Code:
xmlOb.load("xml/menu_sandwiches.php");
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, tony |
|
|
2009-08-16
#4 |
||
|
This is a very late reply, but maybe some will find it useful. This first loads the XML data and then starts a timer (in this case 5 seconds) and then reloads the data. The code also places random data after the call to the php file and ensures it loads fresh XML data each time: Code:
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad=processXMLData;
myXML.load("file.php");
myRandom=Math.round(Math.random()*10000);
clearInterval(myTimer);
myTimer = setInterval(myXML, "load", 5000, "file.php?"+myRandom);
stop();
-Ryan |
|
|
2009-08-17
#5 |
||
|
Interesting. Thanks for this! I don't think i ever solved this and resorted to a frame based solution. I'll definitely check it out in the future.
|
|
17 Creative Assets
|
2009-08-17
#6 |
||
|
If you're using PHP to spit out the XML data then there is no need to use the nasty "random query string" hack, just set the following PHP headers to prevent the response from being cached: Code:
header( "Pragma: no-cache" ); header( "Cache-Control: no-cache" ); header( "Expires: Sat, 01 Jan 2000 00:00:00 GMT" );
|
|
|
2009-08-24
#7 |
||
|
Actually, yes, I AM using PHP to spit out XML data. Do you think your PHP header solution might solve my issue in this thread? Caching XML in loaded SWFs? I've been stuck on this one for awhile now. Thank you!! Ryan |
|
|
2009-08-24
#8 |
||
|
one thing to note, and it isn't usually a problem for most sites. But I came across it with some CMS's I was building. If you want it to work on https in IE you have to do this: Code:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> |
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|



7 comments
| 2733 views



17 Creative Assets
Linear Mode
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.