Hello,
I’m trying to use the kirupa newsticker. I have it configured to load from an XML doc. Works great.
PROBLEM: I need to be able to run it using loadvars() from a php script instead of XML because my host (godaddy - never again) will not provide a safe environment that will allow me to use fopen, fwrite, etc. to create the XML doc using php. (I was going to write a script that would output the necessary xml for the newsticker to run so it could be managed from the Db management interface we are using)
Can anyone instruct me as to how to modify the newsticker to do this? I don’t know AS well enough to do it!
Here is the XML Version:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
title_arr = [];
day_arr = [];
date_arr = [];
blurb_arr = [];
pic_arr = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
title_arr* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
day_arr* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
date_arr* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
blurb_arr* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
pic_arr* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
}
first_item();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("<A href="http://www.jeffcenter.org/flash.xml?blarg="+new">http://www.jeffcenter.org/flash.xml?blarg="+new Date().getTime());
//
function first_item() {
delay = 3500;
p = 0;
display(p);
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; */
//
jcflash_mc.blurbTextMC.blurbText._alpha = 100;
jcflash_mc.titleTextMC.titleText._alpha = 100;
jcflash_mc.dateTextMC.dateText._alpha = 100;
jcflash_mc.dayTextMC.dayText._alpha = 100;
jcflash_mc.evtPic._alpha = 100;
//
jcflash_mc.blurbTextMC.blurbText.text = blurb_arr[pos];
jcflash_mc.titleTextMC.titleText.text = title_arr[pos];
jcflash_mc.dateTextMC.dateText.text = date_arr[pos];
jcflash_mc.dayTextMC.dayText.text = day_arr[pos];
jcflash_mc.evtPic.loadMovie(pic_arr[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 (jcflash_mc.blurbTextMC.blurbText._alpha>=0) {
jcflash_mc.blurbTextMC.blurbText._alpha -= 5;
} else {
display(p);
p++;
delete this.onEnterFrame;
}
if (jcflash_mc.titleTextMC.titleText._alpha>=0) {
jcflash_mc.titleTextMC.titleText._alpha -= 5;
} else {
display(p);
p++;
delete this.onEnterFrame;
}
if (jcflash_mc.dateTextMC.dateText._alpha>=0) {
jcflash_mc.dateTextMC.dateText._alpha -= 5;
} else {
display(p);
p++;
delete this.onEnterFrame;
}
if (jcflash_mc.dayTextMC.dayText._alpha>=0) {
jcflash_mc.dayTextMC.dayText._alpha -= 5;
} else {
display(p);
p++;
delete this.onEnterFrame;
}
if (jcflash_mc.evtPic._alpha>=0) {
jcflash_mc.evtPic._alpha -= 5;
} else {
display(p);
p++;
delete this.onEnterFrame;
}
};
}