function readXML(){ var myXML:XML = new XML(); myXML.ignoreWhite=true; myXML.load("xml/question_form.xml"); myXML.onLoad = function(success){ if (success){ _global.num= myXML.firstChild.childNodes.length; trace(_global.num); for(i=0;i<_global.num;i++){ _global.question[i] = myXML.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue; _global.choice1[i] = myXML.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue; _global.choice2[i] = myXML.firstChild.childNodes[i].childNodes[3].firstChild.nodeValue; _global.choice3[i] = myXML.firstChild.childNodes[i].childNodes[4].firstChild.nodeValue; _global.choice4[i] = myXML.firstChild.childNodes[i].childNodes[5].firstChild.nodeValue; _global.check_answer[i] = myXML.firstChild.childNodes[i].childNodes[6].firstChild.nodeValue; _global.tips[i] = myXML.firstChild.childNodes[i].childNodes[7].firstChild.nodeValue; } for(i=0;i<_global.num;i++){ trace(_global.random_question[i]); } } //if } //onload }//read xml