Hi there…i have been following the news ticker with my own xml and it works great…the problem is that i do not like it how that when it fades out it just re-appears. Can someone take my AS and modify it so it will fade out then fade in the new item?
Any help would be great…i have tried a couple of methods but end up breaking it…
here is the AS
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
articleTitle = [];
articleContents = [];
articleDate = [];
articleCategory = [];
articleLink = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
articleTitle* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
articleContents* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
articleDate* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
articleCategory* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
articleLink* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
}
first_item();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("inventor.xml");
//
function first_item() {
delay = 3000;
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;
//
titleMC.title_txt._alpha = 100;
titleMC.title_txt.text = articleTitle[pos];
contentMC.content_txt._alpha = 100;
contentMC.content_txt.text = articleContents[pos];
dateMC.date_txt._alpha = 100;
dateMC.date_txt.text = articleDate[pos];
fadein();
titleMC.onRelease = function() {
getURL(articleLink[pos], "_self");
};
titleMC.onRollOver = function() {
this.title_txt.setTextFormat(over);
this.title_txt.setTextFormat(bolda);
};
titleMC.onRollOut = function() {
this.title_txt.setTextFormat(out);
};
timer();
}
function fadein() {
this.onEnterFrame = function() {
if (titleMC.title_txt._alpha < 100) {
titleMC.title_txt._alpha += 5;
contentMC.content_txt._alpha += 5;
dateMC.date_txt._alpha += 5;
} else {
display(p);
p++;
delete this.onEnterFrame;
}
};
}
function fadeout() {
this.onEnterFrame = function() {
if (titleMC.title_txt._alpha>=0) {
titleMC.title_txt._alpha -= 5;
contentMC.content_txt._alpha -= 5;
dateMC.date_txt._alpha -= 5;
} else {
display(p);
p++;
delete this.onEnterFrame;
}
};
}
any assistance would be fantastic
Rodent