Hey everyone, I’m using AS2 in Flash CS4. I have a web site that needs to show either Japanese or English text, depending on which option the user selects. My code works well, but when I try to load the text boxes into a scrollpane on the news page, the text doesn’t show. Is there any solution to this? I’m new to flash, so my code is very simple.
function loadXML(loaded) {
if (loaded) {
_root.head = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.stuff = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
header1.text = _root.head;
content1.text = _root.stuff;
} else {
trace("file not loaded!");
}
if (loaded) {
_root.head = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
_root.stuff = this.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
header2.text = _root.head;
content2.text = _root.stuff;
} else {
trace("file not loaded!");
}
if (loaded) {
_root.head = this.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue;
_root.stuff = this.firstChild.childNodes[2].childNodes[1].firstChild.nodeValue;
header3.text = _root.head;
content3.text = _root.stuff;
} else {
trace("file not loaded!");
}
if (loaded) {
_root.head = this.firstChild.childNodes[3].childNodes[0].firstChild.nodeValue;
_root.stuff = this.firstChild.childNodes[3].childNodes[1].firstChild.nodeValue;
header4.text = _root.head;
content4.text = _root.stuff;
} else {
trace("file not loaded!");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
if (langVar == "en") {
xmlData.load("news.xml");
} else if (langVar == "jp") {
xmlData.load("JPnews.xml");
} else {
xmlData.load("news.xml");
}
Any help is much appreciated. :hugegrin: