Chaotic Horde

Flash Applications and Games Development

Today,  

Hi, I´m trying to do some random messages in the Kirupa XML news ticker, but it´s not working, someone can give some hand.

I put xmlData.load("noticiasFC.xml?"+Math.random()); but is not working.

Code:


function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
caption = [];
url = [];
total = xmlNode.childNodes.length;
for (i=0; i
caption[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
url[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;

}
first_item();

} else {

content = "file not loaded!";

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("noticiasFC.xml?"+Math.random());
//
function first_item() {

delay = 1000;
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;
//
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);
p++;
delete this.onEnterFrame;

}

};

}


Sorry about my English.


(Link)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
  • Furl
  • StumbleUpon

Posted in Flash Application and Games Development |

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.