Hi all,
Was wondering if someone could steer me into the right direction or shed a bit of light on my problem.
Current situation
At the moment i am using the following code to display text from an external XML file
function loadXML(loaded) {
if (loaded) {
_root.textfields1 = this.firstChild.childNodes[0].firstChild.nodeValue;
_root.textfields2 = this.firstChild.childNodes[1].firstChild.nodeValue;
_root.textfields3 = this.firstChild.childNodes[2].firstChild.nodeValue;
_root.textfields4 = this.firstChild.childNodes[3].firstChild.nodeValue;
_root.textfields5 = this.firstChild.childNodes[4].firstChild.nodeValue;
_root.textfields6 = this.firstChild.childNodes[5].firstChild.nodeValue;
_root.textfields7 = this.firstChild.childNodes[6].firstChild.nodeValue;
_root.textfields8 = this.firstChild.childNodes[7].firstChild.nodeValue;
block01.text01.text = _root.textfields1;
block02.text02.text = _root.textfields2;
block03.text03.text = _root.textfields3;
block04.text04.text = _root.textfields4;
block05.text05.text = _root.textfields5;
block06.text06.text = _root.textfields6;
block07.text07.text = _root.textfields7;
block08.text08.text = _root.textfields8;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("/flash/site_eng.xml");
var format:TextFormat = new TextFormat();
format.letterSpacing = -1;
block01.text01.setNewTextFormat(format);
block02.text02.setNewTextFormat(format);
block03.text03.setNewTextFormat(format);
block04.text04.setNewTextFormat(format);
block05.text05.setNewTextFormat(format);
block06.text06.setNewTextFormat(format);
block07.text07.setNewTextFormat(format);
block08.text08.setNewTextFormat(format);
The “site_eng.xml” means that it loads in the english version of the XML file.
The problem is that i need to make it dynamic so that it can look at a different XML file in a different map - this is because i need to direct it to 6 different language XML files
Would it be possible to change the code so that it looks at an URL that ends with /movietexts ?
For example
http://www.samplewebsite.net/movietexts
http://www.samplewebsite/uk/movietexts
http://www.samplewebsite/nl/movietexts
http://www.samplewebsite/XX/movietexts
Would this be possible or would a different approach be better?
Thank you in advance!
John