I have a small big (well I hope it’s small, that I can’t see where I am goign wrong).
I have a check box and when the user selects that and then clicks a ok button then it should load some new XML into a textfield. The problem is it doesn’t seem to want to get past the actual function. I know with the trace statement that it knows it’s selected and the OK button has been clicked but it just won’t go to the loadXML function. Can anyone see something I’m not?
on (release){
if (check1_ch.selected == true) {
trace("Ticked");
function loadXML(loaded) {
trace("loading");
if (loaded) {
_root.Distractor1 = this.firstChild.childNodes[0].childNodes[5].childNodes[1].firstChild.nodeValue;
trace(_root.Distractor1);
_root.instruction_txt.text = _root.Distractor1;
} else {
trace("file not loaded");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("XML/Quiz.xml");
}
}
Thanks
Oh also it works outside of the IF statement just not in it!