I was using the news ticker tutorial as a basis for a digital sign i was creating. This would allow users within our building to update messages on the signs throughout the building.
i created a db and asp pages as a backend for the users. I then have an asp page that creates the xml document.
When i load of the flash movie everything is fine and the messages display. When i use my backend admin pages to add messages the old information remains and the new information is not shown.
From what I have read and researched this has to do with the xml file being cached. I have tried the recommended work around using the randomly generated number using the date and time as well as the random number code (in the following examples) in the querystring but that still doesn’t seem to work. I have tried with the movie embeded in an html page or just loading the swf in the flash player. (They load all the proper text but never grab the new updates.)
here are the two different version of the code I have tried (both the same except for the file being called) This one calls an ASP page that displays as xml using the response.contenttype = text/xml.
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
caption = [];
url = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
caption* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
url* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
first_item();
} else {
content = “file not loaded!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("<A href=“http://localhost/test/signage/untitled.asp?ver="+Math.floor(Math.random">http://localhost/test/signage/untitled.asp?ver=”+Math.floor(Math.random() * 999));
//
function first_item() {
delay = 5000;
p = 0;
display§;
p++;
}
function timer() {
myInterval = setInterval(ticker, delay);
function ticker() {
clearInterval(myInterval);
if (p == total) {
p = 0;
}
fadeout();
}
}
function display(pos) {
over = new TextFormat();
over.underline = true;
//
out = new TextFormat();
out.underline = false;
//
newsMC.newsText._alpha = 100;
newsMC.newsText.text = caption[pos];
newsMC.onRelease = function() {
getURL(url[pos], “_self”);
};
newsMC.onRollOver = function() {
this.newsText.setTextFormat(over);
};
newsMC.onRollOut = function() {
this.newsText.setTextFormat(out);
};
timer();
}
function fadeout() {
this.onEnterFrame = function() {
if (newsMC.newsText._alpha>=0) {
newsMC.newsText._alpha -= 5;
} else {
display§;
p++;
delete this.onEnterFrame;
}
};
}
I have also tried using the actual XML file like this.
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
caption = [];
url = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
caption* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
url* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
first_item();
} else {
content = “file not loaded!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("<A href=“http://localhost/test/signage/untitled.xml?ver="+Math.floor(Math.random">http://localhost/test/signage/untitled.xml?ver=”+Math.floor(Math.random() * 999));
//
function first_item() {
delay = 5000;
p = 0;
display§;
p++;
}
function timer() {
myInterval = setInterval(ticker, delay);
function ticker() {
clearInterval(myInterval);
if (p == total) {
p = 0;
}
fadeout();
}
}
function display(pos) {
over = new TextFormat();
over.underline = true;
//
out = new TextFormat();
out.underline = false;
//
newsMC.newsText._alpha = 100;
newsMC.newsText.text = caption[pos];
newsMC.onRelease = function() {
getURL(url[pos], “_self”);
};
newsMC.onRollOver = function() {
this.newsText.setTextFormat(over);
};
newsMC.onRollOut = function() {
this.newsText.setTextFormat(out);
};
timer();
}
function fadeout() {
this.onEnterFrame = function() {
if (newsMC.newsText._alpha>=0) {
newsMC.newsText._alpha -= 5;
} else {
display§;
p++;
delete this.onEnterFrame;
}
};
}
I am at my wits end as i have been at this for about 5 hours and nothing seems to work. My guess it is something simple that I am overlooking. I am far from an ActionScript expert but can fake my way through most of it.
Does anyone have any suggestions?
Thanks. Dave.