fscommand("fullscreen", "true"); //set the projector at fullscreen on startup //set the point and catigory variable to 10, a number which points and catigorys do not exist //so as to know that a question has not been selected, by doing this at the begining we create a global variable that //can be used throughout the program. var points = 10; var catigory = 10; // var final is to determin if the final round is up yet. If it is set to 1, it means it is time for final round var final = 0; //var correct is to determin the final answers of the teams for the final round. default is false because they are not right yet var correct1 = false; var correct2 = false; var correct3 = false; var correct4 = false; var correct5 = false; var correct6 = false; jeopardy = new XML(); // create a new XML node in flash, right now this node in empty until the load comand //-------------------------------------------------------------------------------------------------------- //stripwhite function takes the xml node that was created and removes all // unwanted white spaces, returns, and characters XMLNode.prototype.stripwhite = function () { //-------------------------- //function whitetest tests for unwanted characters. Because in ASCII coding, all letter characters are above the number //32, we will check each value in our string to see if it is above 32. If it is above, our string has character that we want to keep // if it is all below, it is only whitespaces and junk characters that we want to throw away function whitetest (str) { var allwhite = true; //set a local variable to true. This can only be used in the function whitetest var strlength = str.length; //set a local variable to the length of our string to be tested for (var i = 0; i32) { // if the character is above that 32 we break and set our all white test to false //because it is not junk allwhite = false; break; } } return (allwhite); //return true or false, is it junk or not } //--------------------------------------------- //now we will actually go through our entire file to check for unwanted characters //this is a recursive function and very difficult to follow so do not be discouraged if you do not understand // in xml there are two types of nodes. A type 1 which means that it does not have a value associated with it but it does have childnodes. // this does not mean that it cannot have attributes. //The next type is type 3 which means it has a value associated with it but it does not have childnodes. It cannot have an attribute to it. //first we will check what type of node we are looking at, starting with the firstchild of jeopardy //Then we will look at the childnodes 0 -4 of this first child. //we will then call the attribute 'name' and use that value for our catigories _root.cat1.points = _root.jeopardy.firstChild.childNodes[0].attributes.name; _root.cat2.points = _root.jeopardy.firstChild.childNodes[1].attributes.name; _root.cat3.points = _root.jeopardy.firstChild.childNodes[2].attributes.name; _root.cat4.points = _root.jeopardy.firstChild.childNodes[3].attributes.name; _root.cat5.points = _root.jeopardy.firstChild.childNodes[4].attributes.name; //we will now set our points for each question //catigories will be denoted by i and questions will be denoted by j so our game board can be labled like the following // q ij - catigories // u 00 10 20 30 40 so 00 would denote the first question in the first catigory // e 01 11 21 31 41 and 44 would denote the fifth question in the fifth catigory // s 02 12 22 32 42 // t 03 13 23 33 43 // i 04 14 24 34 44 //with this for loop, we will go through first each catigory then each question in that catigory to set the point values for (i=0;i< 5;i++){ for (j=0;j<5;j++){ //_root["'" + i+j].points is what we labled each movie in our main timeline. For example, we called the first question in the first catigory _root.00.points //then we will look in the jeopardy file at the first child which is