Hi
I current have a movie which scrolls through xml data but I would like to apply css styling to the fields. I looked at css tutorials but I’m having trouble adapting it for my script.
Here’s the code I have so far.
//init TextArea component
actText.html = true;
actText.wordWrap = true;
actText.multiline = true;
actText.label.condenseWhite=true;
//load css
gigStyle = new TextField.StyleSheet();
gigStyle.load("gigs.css");
actText.styleSheet = gigStyle;
function loadXML(loaded) {
if(loaded) {
xmlNode = this.firstChild;
date = [];
act1 = [];
act2 = [];
act3 = [];
act4 = [];
act5 = [];
act6 = [];
act7 = [];
act8 = [];
act9 = [];
act10 = [];
total = xmlNode.childNodes.length;
for(i=0;i<total;i++) {
date* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
act1* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
if (xmlNode.childNodes*.childNodes[2].firstChild.nodeValue != undefined) {
act2* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
} else {
act2* = " ";
}
if (xmlNode.childNodes*.childNodes[3].firstChild.nodeValue != undefined) {
act3* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
} else {
act3* = " ";
} if (xmlNode.childNodes*.childNodes[4].firstChild.nodeValue != undefined) {
act4* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
} else {
act4* = " ";
}
if (xmlNode.childNodes*.childNodes[5].firstChild.nodeValue != undefined) {
act5* = xmlNode.childNodes*.childNodes[5].firstChild.nodeValue;
} else {
act5* = " ";
}
if (xmlNode.childNodes*.childNodes[6].firstChild.nodeValue != undefined) {
act6* = xmlNode.childNodes*.childNodes[6].firstChild.nodeValue;
} else {
act6* = " ";
}
if (xmlNode.childNodes*.childNodes[7].firstChild.nodeValue != undefined) {
act7* = xmlNode.childNodes*.childNodes[7].firstChild.nodeValue;
} else {
act7* = " ";
}
if (xmlNode.childNodes*.childNodes[8].firstChild.nodeValue != undefined) {
act8* = xmlNode.childNodes*.childNodes[8].firstChild.nodeValue;
} else {
act8* = " ";
}
if (xmlNode.childNodes*.childNodes[9].firstChild.nodeValue != undefined) {
act9* = xmlNode.childNodes*.childNodes[9].firstChild.nodeValue;
} else {
act9* = " ";
}
if (xmlNode.childNodes*.childNodes[10].firstChild.nodeValue != undefined) {
act10* = xmlNode.childNodes*.childNodes[10].firstChild.nodeValue;
} else {
act10* = " ";
}
}
first_item();
} else {
content = "file not loaded!";
}
}
gigData = new XML();
gigData.ignoreWhite = true;
gigData.onLoad = loadXML;
gigData.load("gigs.php");
function first_item() {
delay = 12000;
p = 0;
display(p);
p++;
}
function timer() {
myInterval = setInterval(ticker,delay);
function ticker() {
clearInterval(myInterval);
if(p == total) {
p = 0;
}
fadeout();
}
}
function display(pos) {
newsMC.newsText._alpha = 100;
newsMC.newsText.text = date[pos];
act1MC.actText.text = act1[pos];
act2MC.actText.text = act2[pos];
act3MC.actText.text = act3[pos];
act4MC.actText.text = act4[pos];
act5MC.actText.text = act5[pos];
act6MC.actText.text = act6[pos];
act7MC.actText.text = act7[pos];
act8MC.actText.text = act8[pos];
act9MC.actText.text = act9[pos];
act10MC.actText.text = act10[pos];
timer();
}
function fadeout() {
this.onEnterFrame = function() {
display(p);
p++;
delete this.onEnterFrame;
}
}
Any help on this would be greatly appreciated.