Frame 2
function Favorite(question, answer) {
this.question = question;
this.answer = answer;
}
function makeArray(success) {
var i;
var j;
var mainTag;
var question;
var answer;
if (success) {
i = 0;
while (showXML.childNodes.length >= i) {
if ((this.childNodes[i].nodeValue == null) && (this.childNodes[i].nodeName == "FAVORITES")) {
mainTag = this.childNodes[i];
_root.totalfavorite = mainTag.childNodes.length;
trace(_root.totalfavorite);
}
i++;
}
i = 0;
while (mainTag.childNodes.length >= i) {
if (mainTag.childNodes[i].nodeName == "FAVORITE") {
category = mainTag.childNodes[i].attributes.category;
Set("_root.category" + (i + 1), category);
j = 0;
while (j < mainTag.childNodes[i].childNodes.length) {
if (mainTag.childNodes[i].childNodes[j].nodeName != null) {
if (mainTag.childNodes[i].childNodes[j].nodeName == "QUESTION") {
question = mainTag.childNodes[i].childNodes[j].firstChild.nodeValue;
Set("_root.question" + (i + 1), question);
trace((("question" + (i + 1)) + "=") + _root["question" + (i + 1)]);
} else if (mainTag.childNodes[i].childNodes[j].nodeName == "ANSWER") {
answer = mainTag.childNodes[i].childNodes[j].firstChild.nodeValue;
answer = answer.toUpperCase();
Set("_root.answer" + (i + 1), answer);
trace((("answer" + (i + 1)) + "=") + answer);
}
}
j++;
}
}
i++;
}
}
}
Object.version = getVersion().split(",");
Object.majorVersion = int(substring(Object.version[0], Object.version[0].length, 1));
Object.minorVersion = int(Object.version[2]);
if (Object.majorVersion == 5) {
XML.prototype.checkEmpty = function (text) {
var max = text.length;
var empty = true;
var i = 0;
while (i < max) {
if (32 < ord(substring(text, i + i, 1))) {
empty = false;
break;
}
i++;
}
return(empty);
};
XML.prototype.parseXML = function (str) {
this.firstChild.removeNode();
var treePtr = this;
var tags = new Array();
var textNode = null;
if (Object.minorVersion == 30) {
this.status = ASnative(300, 0) /* [XML.prototype.parseXML] - inner function */(str, tags);
} else {
this.status = ASnative(300, 0) /* [XML.prototype.parseXML] - inner function */(str, tags, false);
}
if (this.status == 0) {
var curr;
var i = 0;
var max = tags.length;
if (this.ignoreWhite) {
while (i < max) {
curr = tags[i];
if (curr.type == 1) {
if (curr.value == ("/" + treePtr.nodeName)) {
treePtr = treePtr.parentNode;
} else {
treePtr.appendChild(this.createElement(curr.value));
treePtr = treePtr.lastChild;
treePtr.attributes = curr.attrs;
if (curr.empty) {
treePtr = treePtr.parentNode;
}
}
} else if (curr.type == 3) {
if (!this.checkEmpty(curr.value)) {
treePtr.appendChild(this.createTextNode(curr.value));
}
} else if (curr.type == 6) {
treePtr.appendChild(this.createTextNode(curr.value));
} else if (curr.type == 4) {
this.xmlDecl = curr.value;
} else {
this.docTypeDecl = curr.value;
}
i++;
}
} else {
while (i < max) {
curr = tags[i];
if (curr.type == 1) {
if (curr.value == ("/" + treePtr.nodeName)) {
treePtr = treePtr.parentNode;
} else {
treePtr.appendChild(this.createElement(curr.value));
treePtr = treePtr.lastChild;
treePtr.attributes = curr.attrs;
if (curr.empty) {
treePtr = treePtr.parentNode;
}
}
} else if ((curr.type == 3) || (curr.type == 6)) {
treePtr.appendChild(this.createTextNode(curr.value));
} else if (curr.type == 4) {
this.xmlDecl = curr.value;
} else {
this.docTypeDecl = curr.value;
}
i++;
}
}
}
};
}
PathDelimiter = length(_url);
while ((0 < Number(PathDelimiter)) and ((substring(_url, PathDelimiter, 1)) ne "/")) {
PathDelimiter = PathDelimiter - 1;
}
Set("/:path", substring(_url, 1, PathDelimiter));
showXML = new XML();
showXML.ignoreWhite = true;
showXML.onLoad = makeArray;
showXML.load("favor_config.xml");
Frame 3
TextColor = new Array();
TextColor[0] = 16737792 /* 0xFF6600 */;
TextColor[1] = 16750848 /* 0xFF9900 */;
TextColor[2] = 6723840 /* 0x669900 */;
TextColor[3] = 6737151 /* 0x66CCFF */;
TextColor[4] = 26316;
TextColor[5] = 10040217 /* 0x993399 */;
TextColor[6] = 13369344 /* 0xCC0000 */;
Instance of Symbol 48 MovieClip in Frame 120
onClipEvent (load) {
index = 1;
}
onClipEvent (enterFrame) {
if (startTimer) {
if (((getTimer() - timer) / 1000) >= 7) {
play();
}
}
}
Frame 133
stop();
Symbol 3 Button
on (keyPress "Z") {
gotoAndPlay (87);
}
Symbol 9 MovieClip Frame 1
stop();
Symbol 9 MovieClip Frame 2
stop();
stopAllSounds();
Symbol 19 MovieClip Frame 15
stop();
Symbol 26 MovieClip Frame 92
_rotation = random(360);
Symbol 37 MovieClip Frame 1
stop();
Symbol 47 Button
on (release) {
play();
}
Symbol 48 MovieClip Frame 1
question.question = _root["question" + index];
title.gotoAndStop(_root["category" + index]);
startTimer = false;
Symbol 48 MovieClip Frame 13
answer.answer = _root["answer" + index];
i = random(7);
trace("i=" + i);
randomColor = _root.TextColor[this.i];
Answercolor = new Color(answer);
Answercolor.setRGB(randomColor);
trace("randomColor=" + randomColor);
Symbol 48 MovieClip Frame 26
startTimer = true;
timer = getTimer();
stop();
Symbol 48 MovieClip Frame 27
startTimer = false;
Symbol 48 MovieClip Frame 40
if (this.index < _root.totalfavorite) {
index = index + 1;
trace("index=" + index);
} else {
index = 1;
}
Symbol 52 Button
on (release) {
gotoAndStop (2);
_root.sound.gotoAndStop("soundoff");
}
Symbol 57 Button
on (release) {
gotoAndStop (1);
_root.sound.gotoAndStop("soundon");
}
Symbol 58 MovieClip Frame 1
stop();