import flash.display.MovieClip; //stop the current loop stop(); //set all the arrays we'll be using to store data var questions = new Array(); var questiontype = new Array(); var answers = new Array(); var images = new Array(); var answerimages = new Array(); var explainations = new Array(); //set the variables that we'll be using to keep track of data to zero var currentquestion = 0; var correctamount = 0; var amountofquestions = 0; //a loader is created for the XML file var ul = new URLLoader(); //a variable is created to hold the XML file var quizXML:XML; var curLanguage:String; function init($xmlPath, $curLanguage) { curLanguage = $curLanguage; start.addEventListener(MouseEvent.CLICK,function(evt:Event) { gotoAndStop('questions'); var wrapper:MovieClip = MovieClip(parent.parent.parent); if(wrapper != null) wrapper.trackPlay(curLanguage); }) //a listener is attached and the xml file is loaded ul.addEventListener(Event.COMPLETE,dataLoaded); ul.load(new URLRequest($xmlPath)); } //if it is succesfully loaded.. function dataLoaded(evt:Event) { quizXML = new XML(evt.target.data); //the amount of questions is gathered amountofquestions = quizXML.question.length(); //is the quiz random? //create a random sequence of numbers var randomsequence = new Array(); if (quizXML.@random == 'yes' || quizXML.@random == 'Yes') { //if the sequence isnt full yet while (randomsequence.length