First Frame has Different language btns and I’d like to load the XML file desired by hitting the buttons.
After hours of searching online I managed to find this code in a thread but I’m getting undefined file name.
Little new to XML if someone can see my error or has an alternative option for me would be greatly appreciated.
var myXML:XML = new XML;
myXML.load(xmlFile);
myXML.ignoreWhite = true;
loadXMLfunc.onLoad = function(ok:Boolean):Void
I took away the gotoAndPlay(2) command and put some text boxes on the first frame and still getting nothing, not even undefined. Hmm back to the drawing board on this one. Should I put everything in an array?
loadXMLfunc.onLoad = function(ok:Boolean):Void
this was what I had before. Regardless I’ve changed it back to
loadXMLfunc.onLoad = function(ok:Boolean):Void {
if (ok) {
menu_title.text = myXML.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
menu_game.text = myXML.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
menu_game2.text = myXML.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
menu_game3.text = myXML.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue ;
gotoAndPlay(2);
}
}
Still getting no results…hmm seem to think it’s back to the first question as this set up works fine if I call a file directly ie myXML.load(“english.xml”); as opposed to calling it from a button.
Either that or I need to rework the array of text to load. I’m not getting anything with the trace() but it’s not telling me undefined file or that it can’t find the file or anything like that either.
Thanks for help on this.
Thanks again for the help with this.
Managed to get it to work by
adding the gotoAndPlay(2); directly to the button
and then on frame2 adding onEnterFrame = function() { with the nodes I wanted to load where.
Cheers again for your time now I got to put this thing together!