Instance of Symbol 31 MovieClip in Frame 1
onClipEvent (load) {
xin_motion_val = "Toward";
xin_alphatype_val = "No";
xout_motion_val = "None";
xout_alphatype_val = "No";
perc_req_val = 100;
show_perc_val = "Yes";
slow_factor_val = 0.2;
init_action_val = "_root.stop();";
play_action_val = "_root.play();";
}
Frame 172
stop();
Frame 173
function getDivideNumber() {
matchNumber = random(divMax) + 1;
if ((divMax - (divMax / 2)) < matchNumber) {
matchNumber = random(divMax) + 1;
}
startNumber = 100;
if (0 >= NumbersAvailable) {
endGameFunction();
} else if (NumbersAvailable >= 5) {
var numbersOnlyArray = new Array();
var i = 0;
while (i < numbersLeftArray.length) {
numbersOnlyArray.push(_root[numbersLeftArray[i]].number);
i++;
}
numbersOnlyArray.Randomize();
startNumber = matchNumber;
var howManyNumbers = Math.ceil(Math.random() * 3);
var i = 0;
while (i < howManyNumbers) {
startNumber = startNumber * numbersOnlyArray[i];
i++;
}
display.Numbertext = matchNumber;
totalUser = startNumber;
numberSelectedArray = new Array();
numberArray = new Array();
display.bonusMC.startTimer();
} else if (NumbersAvailable < 5) {
if (checkIfPossible(matchNumber) == false) {
endGameFunction();
} else {
display.Numbertext = matchNumber;
totalUser = 1;
numberSelectedArray = new Array();
numberArray = new Array();
display.bonusMC.startTimer();
}
}
_root.counter = (("Division : " + startNumber) + " / ? = ") + matchNumber;
updateDivideCounter();
}
function checkDivide(myNumber, myArray) {
trace(mynumber);
var myInNumber = myNumber;
var myInArray = new Array();
myInArray.copy(myArray);
var subTotal = divMax;
var newArray = new Array();
var i = 0;
while (i < myInArray.length) {
if (myInArray[i] == myInNumber) {
return(true);
}
if (myInArray[i] < myInNumber) {
newArray.push(myInArray[i]);
subTotal = subTotal / myInArray[i];
}
i++;
}
if (subTotal == myInNumber) {
return(true);
}
if (myInNumber < subTotal) {
return(false);
}
var i = 0;
while (i < newArray.length) {
var newNum = (myInNumber - newArray[i]);
var newerArray = new Array();
newerArray = newArray.slice(i + 1);
what = checkDivide(newNum, newerArray);
if (what == true) {
return(true);
}
i++;
}
return(false);
}
function DivideMyNumber(myNumber, myName) {
var status = "none";
totalUser = totalUser / myNumber;
totalUser = roundOff2(totalUser);
if (totalUser == matchNumber) {
correctSoundObj.start();
thisScore = 0;
numberArray.push(myNumber);
numberSelectedArray.push(myName);
letterScore = numberSelectedArray.length * 5;
var i = 0;
while (i < numberSelectedArray.length) {
_root[numberSelectedArray[i]].gotoAndPlay("score");
_root[numberSelectedArray[i]].score = letterScore;
thisScore = thisScore + letterScore;
NumbersAvailable--;
var tempNum = numbersLeftArray.find(numberSelectedArray[i]);
numbersLeftArray.removeOne(tempNum);
i++;
}
runningScore = runningScore + thisScore;
_root.score = runningScore + bonusScore;
display.numberScoretext = _root.score;
status = "finish";
_root.gameMode = "wait";
} else if (totalUser < matchNumber) {
wrongSoundObj.start();
thisScore = 0;
var i = 0;
while (i < numberSelectedArray.length) {
_root[numberSelectedArray[i]].gotoAndPlay("off");
i++;
}
_root[myName].gotoAndStop("off");
totalUser = startNumber;
numberSelectedArray = new Array();
numberArray = new Array();
status = "reset";
} else {
numberSelectedArray.push(myName);
numberArray.push(myNumber);
status = "taken";
}
updateDivideCounter();
return(status);
}
function updateDivideCounter() {
if (0 < numberArray.length) {
_root.counterTracker = startNumber + " / ";
var i = 0;
while (i < (numberArray.length - 1)) {
_root.counterTracker = (_root.counterTracker + numberArray[i]) + " / ";
i++;
}
_root.counterTracker = ((_root.counterTracker + numberArray[i]) + " = ") + totalUser;
} else {
_root.counterTracker = " ";
}
}
function roundOff2(myNumber) {
myNumber = Math.floor(myNumber * 100);
return(myNumber / 100);
}
function getMultiplyNumber() {
var multNumberArray = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16, 20, 24, 27, 30, 32, 36, 40, 42);
startNumber = 1;
if (0 >= NumbersAvailable) {
endGameFunction();
} else if (NumbersAvailable >= 5) {
var numbersOnlyArray = new Array();
var i = 0;
while (i < numbersLeftArray.length) {
numbersOnlyArray.push(_root[numbersLeftArray[i]].number);
i++;
}
numbersOnlyArray.Randomize();
matchNumber = 1;
var howManyNumbers = Math.ceil(Math.random() * multMax);
var i = 0;
while (i < howManyNumbers) {
matchNumber = matchNumber * numbersOnlyArray[i];
i++;
}
display.Numbertext = matchNumber;
totalUser = 1;
numberSelectedArray = new Array();
numberArray = new Array();
display.bonusMC.startTimer();
} else if (NumbersAvailable < 5) {
matchNumber = Math.ceil(Math.random() * 20);
matchNumber = multNumberArray[matchNumber];
if (checkIfPossible(matchNumber) == false) {
endGameFunction();
} else {
display.Numbertext = matchNumber;
totalUser = 1;
numberSelectedArray = new Array();
numberArray = new Array();
display.bonusMC.startTimer();
}
}
_root.counter = "Multiplication : ? * ? = " + matchNumber;
updateMultCounter();
}
function checkMultiply(myNumber, myArray) {
var myInNumber = myNumber;
var myInArray = new Array();
myInArray.copy(myArray);
var subTotal = 1;
var newArray = new Array();
var i = 0;
while (i < myInArray.length) {
if (myInArray[i] == myInNumber) {
return(true);
}
if (myInArray[i] < myInNumber) {
newArray.push(myInArray[i]);
subTotal = subTotal * myInArray[i];
}
i++;
}
if (subTotal == myInNumber) {
return(true);
}
if (subTotal < myInNumber) {
return(false);
}
var i = 0;
while (i < newArray.length) {
var newNum = (myInNumber - newArray[i]);
var newerArray = new Array();
newerArray = newArray.slice(i + 1);
what = checkMultiply(newNum, newerArray);
if (what == true) {
return(true);
}
i++;
}
return(false);
}
function multiplyMyNumber(myNumber, myName) {
var status = "none";
totalUser = totalUser * myNumber;
if (totalUser == matchNumber) {
correctSoundObj.start();
thisScore = 0;
numberArray.push(myNumber);
numberSelectedArray.push(myName);
letterScore = numberSelectedArray.length * 5;
var i = 0;
while (i < numberSelectedArray.length) {
_root[numberSelectedArray[i]].gotoAndPlay("score");
_root[numberSelectedArray[i]].score = letterScore;
thisScore = thisScore + letterScore;
NumbersAvailable--;
var tempNum = numbersLeftArray.find(numberSelectedArray[i]);
numbersLeftArray.removeOne(tempNum);
i++;
}
runningScore = runningScore + thisScore;
_root.score = runningScore + bonusScore;
display.numberScoretext = _root.score;
status = "finish";
_root.gameMode = "wait";
} else if (matchNumber < totalUser) {
wrongSoundObj.start();
thisScore = 1;
var i = 0;
while (i < numberSelectedArray.length) {
_root[numberSelectedArray[i]].gotoAndPlay("off");
i++;
}
_root[myName].gotoAndStop("off");
totalUser = startNumber;
numberSelectedArray = new Array();
numberArray = new Array();
status = "reset";
} else {
trace("in corect place");
numberSelectedArray.push(myName);
numberArray.push(myNumber);
status = "taken";
}
updateMultCounter();
return(status);
}
function updateMultCounter() {
if (0 < numberArray.length) {
_root.counterTracker = " ";
var i = 0;
while (i < (numberArray.length - 1)) {
_root.counterTracker = (_root.counterTracker + numberArray[i]) + " * ";
i++;
}
_root.counterTracker = ((_root.counterTracker + numberArray[i]) + " = ") + totalUser;
} else {
_root.counterTracker = " ";
}
}
function getSubtractNumber() {
startNumber = subMax;
if (0 >= NumbersAvailable) {
endGameFunction();
}
matchNumber = random(subMax) + 1;
if ((subMax - (subMax / 4)) < matchNumber) {
matchNumber = random(subMax) + 1;
}
display.Numbertext = matchNumber;
totalUser = subMax;
numberSelectedArray = new Array();
numberArray = new Array();
display.bonusMC.startTimer();
if (NumbersAvailable < subMax) {
if (checkIfPossible(matchNumber) == false) {
endGameFunction();
}
}
_root.counter = (("Subtraction : " + startNumber) + " - ? = ") + matchNumber;
updateSubtractCounter();
}
function checkSubtraction(myNumber, myArray) {
var myInNumber = myNumber;
var myInArray = new Array();
myInArray.copy(myArray);
var subTotal = subMax;
var newArray = new Array();
var i = 0;
while (i < myInArray.length) {
if (myInArray[i] == myInNumber) {
return(true);
}
if (myInArray[i] < myInNumber) {
newArray.push(myInArray[i]);
subTotal = subTotal - myInArray[i];
}
i++;
}
if (subTotal == myInNumber) {
return(true);
}
if (myInNumber < subTotal) {
return(false);
}
var i = 0;
while (i < newArray.length) {
var newNum = (myInNumber - newArray[i]);
var newerArray = new Array();
newerArray = newArray.slice(i + 1);
what = checkSubtraction(newNum, newerArray);
if (what == true) {
return(true);
}
i++;
}
return(false);
}
function SubtractMyNumber(myNumber, myName) {
var status = "none";
totalUser = totalUser - myNumber;
if (totalUser == matchNumber) {
correctSoundObj.start();
thisScore = 0;
numberArray.push(myNumber);
numberSelectedArray.push(myName);
letterScore = numberSelectedArray.length * 5;
var i = 0;
while (i < numberSelectedArray.length) {
_root[numberSelectedArray[i]].gotoAndPlay("score");
_root[numberSelectedArray[i]].score = letterScore;
thisScore = thisScore + letterScore;
NumbersAvailable--;
var tempNum = numbersLeftArray.find(numberSelectedArray[i]);
numbersLeftArray.removeOne(tempNum);
i++;
}
runningScore = runningScore + thisScore;
_root.score = runningScore + bonusScore;
display.numberScoretext = _root.score;
status = "finish";
_root.gameMode = "wait";
} else if (totalUser < matchNumber) {
wrongSoundObj.start();
thisScore = 0;
var i = 0;
while (i < numberSelectedArray.length) {
_root[numberSelectedArray[i]].gotoAndPlay("off");
i++;
}
_root[myName].gotoAndStop("off");
totalUser = startNumber;
numberSelectedArray = new Array();
numberArray = new Array();
status = "reset";
} else {
numberSelectedArray.push(myName);
numberArray.push(myNumber);
status = "taken";
}
updateSubtractCounter();
return(status);
}
function updateSubtractCounter() {
if (0 < numberArray.length) {
_root.counterTracker = subMax + " - ";
var i = 0;
while (i < (numberArray.length - 1)) {
_root.counterTracker = (_root.counterTracker + numberArray[i]) + " - ";
i++;
}
_root.counterTracker = ((_root.counterTracker + numberArray[i]) + " = ") + totalUser;
} else {
_root.counterTracker = " ";
}
}
function getAddNumber() {
startNumber = 0;
if (0 >= NumbersAvailable) {
endGameFunction();
}
trace(addMax);
matchNumber = random(addMax) + 1;
if (matchNumber < 4) {
matchNumber = random(addMax) + 1;
}
display.numbertext = matchNumber;
totalUser = 0;
numberSelectedArray = new Array();
numberArray = new Array();
display.bonusMC.startTimer();
if (NumbersAvailable < addMax) {
if (checkIfPossible(matchNumber) == false) {
endGameFunction();
}
}
_root.counter = "Addition : ? + ? = " + matchNumber;
updateAddCounter();
}
function checkAddition(myNumber, myArray) {
var myInNumber = myNumber;
var myInArray = new Array();
myInArray.copy(myArray);
var addTotal = 0;
var newArray = new Array();
var i = 0;
while (i < myInArray.length) {
if (myInArray[i] == myInNumber) {
return(true);
}
if (myInArray[i] < myInNumber) {
newArray.push(myInArray[i]);
addTotal = addTotal + myInArray[i];
}
i++;
}
if (addTotal == myInNumber) {
return(true);
}
if (addTotal < myInNumber) {
return(false);
}
var i = 0;
while (i < newArray.length) {
var newNum = (myInNumber - newArray[i]);
var newerArray = new Array();
newerArray = newArray.slice(i + 1);
what = checkAddition(newNum, newerArray);
if (what == true) {
return(true);
}
i++;
}
return(false);
}
function AddMyNumber(myNumber, myName) {
var status = "none";
totalUser = totalUser + myNumber;
if (totalUser == matchNumber) {
correctSoundObj.start();
thisScore = 0;
numberArray.push(myNumber);
numberSelectedArray.push(myName);
letterScore = numberSelectedArray.length * 5;
var i = 0;
while (i < numberSelectedArray.length) {
_root[numberSelectedArray[i]].gotoAndPlay("score");
_root[numberSelectedArray[i]].score = letterScore;
thisScore = thisScore + letterScore;
NumbersAvailable--;
var tempNum = numbersLeftArray.find(numberSelectedArray[i]);
numbersLeftArray.removeOne(tempNum);
i++;
}
runningScore = runningScore + thisScore;
_root.score = runningScore + bonusScore;
display.numberScoretext = _root.score;
status = "finish";
_root.gameMode = "wait";
} else if (matchNumber < totalUser) {
wrongSoundObj.start();
thisScore = 0;
var i = 0;
while (i < numberSelectedArray.length) {
_root[numberSelectedArray[i]].gotoAndPlay("off");
i++;
}
_root[myName].gotoAndStop("off");
totalUser = startNumber;
numberSelectedArray = new Array();
numberArray = new Array();
status = "reset";
} else {
numberSelectedArray.push(myName);
numberArray.push(myNumber);
status = "taken";
}
updateAddCounter();
return(status);
}
function updateAddCounter() {
if (0 < numberArray.length) {
_root.counterTracker = " ";
var i = 0;
while (i < (numberArray.length - 1)) {
_root.counterTracker = (_root.counterTracker + numberArray[i]) + " + ";
i++;
}
_root.counterTracker = ((_root.counterTracker + numberArray[i]) + " = ") + totalUser;
} else {
_root.counterTracker = " ";
}
}
function _copy(a) {
var j = 0;
while (j < a.length) {
this[j] = a[j];
j++;
}
}
function _find_in_Array(value) {
var z = 0;
while (z < this.length) {
if (this[z] == value) {
return(z);
}
z++;
}
return(-1);
}
function _Remove_element(whichOne) {
var newArray = new Array(this.length - 1);
var j = 0;
var i = 0;
while (i < this.length) {
if (i != whichOne) {
newArray[j] = this[i];
j++;
}
i++;
}
this.pop();
this.copy(newArray);
}
Array.prototype.Randomize = function () {
var newArray = new Array(this.length);
newArray.copy(this);
var i = 0;
while (i < this.length) {
var myNumber = random(newArray.length);
this[i] = newArray[myNumber];
newArray.splice(myNumber, 1);
i++;
}
};
Array.prototype.copy = _copy;
Array.prototype.Find = _find_in_Array;
Array.prototype.RemoveOne = _Remove_element;
function placeNumbers() {
NumbersAvailable = 0;
var Level = 10;
var xPos = _root.XPosition;
var ystart = _root.YPosition;
numbersLeftArray = new Array();
var i = 0;
while (i < _root.numberOfColumns) {
yPos = yStart;
var j = 0;
while (j < _root.numberOfRows) {
attachMovie("number", "number" + level, level);
_root["number" + level]._x = xPos;
_root["number" + level]._y = yPos;
_root["number" + level]._width = boxWidth;
_root["number" + level]._height = boxHeight;
_root["number" + level].number = random(9) + 1;
yPos = yPos + (boxHeight + padding);
numbersLeftArray.push("number" + level);
level++;
NumbersAvailable++;
j++;
}
xPos = xPos + (boxWidth + padding);
i++;
}
}
function checkIfPossible(checkNumber) {
var numbersOnlyArray = new Array();
var i = 0;
while (i < numbersLeftArray.length) {
numbersOnlyArray.push(_root[numbersLeftArray[i]].number);
i++;
}
if (mathType == "Add") {
return(checkAddition(checkNumber, numbersOnlyArray));
}
if (mathType == "Subtract") {
return(checkSubtraction(checkNumber, numbersOnlyArray));
}
if (mathType == "Multiply") {
return(checkMultiply(checkNumber, numbersOnlyArray));
}
return(checkDivide(checkNumber, numbersOnlyArray));
}
function removeMyNumber(mynumber, myName) {
var i = 0;
while (i < numberSelectedArray.length) {
if (numberSelectedArray[i] == myName) {
numberSelectedArray.RemoveOne(i);
}
i++;
}
var i = 0;
while (i < numberArray.length) {
if (numberArray[i] == mynumber) {
numberArray.RemoveOne(i);
}
i++;
}
if (mathType == "Add") {
totalUser = totalUser - myNumber;
updateAddCounter();
} else if (mathType == "Subtract") {
totalUser = totalUser + myNumber;
updateSubtractCounter();
} else if (mathType == "Multiply") {
totalUser = totalUser / myNumber;
updateMultCounter();
} else {
totalUser = totalUser * myNumber;
if ((startNumber - totalUser) < 1) {
totalUser = startNumber;
}
updateDivideCounter();
}
}
function endGameFunction() {
var Level = 10;
var i = 0;
while (i < _root.numberOfColumns) {
var j = 0;
while (j < _root.numberOfRows) {
_root["number" + level].gotoAndPlay("final");
level++;
j++;
}
i++;
}
gameMode = "finish";
}
function fixTrueFalse(stringValue) {
if (stringValue == "true") {
return(true);
}
if (stringValue == "false") {
return(false);
}
}
function DoMyNumber(myNumber, myName) {
if (mathType == "Add") {
return(AddMyNumber(myNumber, myName));
}
if (mathType == "Subtract") {
trace("sub");
return(SubtractMyNumber(myNumber, myName));
}
if (mathType == "Multiply") {
return(multiplyMyNumber(myNumber, myName));
}
return(DivideMyNumber(myNumber, myName));
}
function getNumber() {
if (mathType == "Add") {
getAddNumber();
} else if (mathType == "Subtract") {
getSubtractNumber();
} else if (mathType == "Multiply") {
getMultiplyNumber();
} else if (mathType == "Divide") {
getDivideNumber();
} else {
mathType = "Add";
getAddNumber();
}
}
Math.trans = 0.0174532925199433 /* Math.PI/180 */;
currentscore = 0;
score = currentscore;
checkTime = getTimer() + delay;
Instance of Symbol 129 MovieClip in Frame 173
onClipEvent (load) {
game_time_val = 200;
math_type_val = "Multiply";
number_rows_val = 10;
number_columns_val = 10;
placement_x_val = 70;
placement_y_val = 50;
box_width_val = 30;
box_height_val = 30;
padding_val = 0;
correct_sound_val = "correct";
wrong_sound_val = "wrong";
add_max_val = 40;
sub_max_val = 50;
mult_max_val = 2;
div_max_val = 30;
show_matched_val = "false";
button_animation_val = "false";
object_base_name_val = "Object";
button_base_name_val = "Button";
object_sound_base_name_val = "ObjectSound";
available_pieces_val = 20;
file_name_val = "Quiz.txt";
question_time_val = 0;
questions_per_quiz_val = 10;
waiting_sound_val = "timesound";
expired_sound_val = "timeup";
one_chance_val = "true";
show_correct_val = "true";
correct_time_val = 5;
show_totalQuiz_val = "false";
answers_per_question_val = 3;
TextField15 = "XCH";
readTextFile = "true";
TextFileName = "quiz.txt";
gameTime = 0;
questionTime = 0;
QuestionsperQuiz = 15;
numberOfAnswers = 3;
correctSound = "correct";
wrongSound = "wrong";
timeSound = "timeSound";
timeEndSound = "timeUp";
numberOfQuestions = 5;
question1 = "Which area of the brain is responsible for solving problems and planning for the future?";
answer1_1 = "frontal lobe ";
answer1_2 = "sensory cortex";
answer1_3 = "amygdala";
question2 = "Which area of the brain helps us understand the meaning of words, for example while in a conversation?";
answer2_1 = "wernicke's area ";
answer2_2 = "hippocampus";
answer2_3 = "frontal lobe";
question3 = "Which area of the brain is responsible for moving arms and legs, and other muscles?";
answer3_1 = "motor cortex ";
answer3_2 = "broca's area";
answer3_3 = "prefrontal cortex";
question4 = "Which area of the brain are very intense emotions such as fear and anger located?";
answer4_1 = "amygdala";
answer4_2 = "sensory cortex";
answer4_3 = "hippocampus";
question5 = "Which two main areas of the brain are involved in language skills?";
answer5_1 = "the Wernicke's and Broca's area ";
answer5_2 = "the Hippocampus and Amygdala";
answer5_3 = "the Sensory and Motor Cortex";
}
Frame 178
currentscore = 0;
score = currentscore;
gameMode = "play";
placeNumbers();
getNumber();
Instance of Symbol 141 MovieClip "display" in Frame 178
onClipEvent (enterFrame) {
if (_root.score != this.numberScoretext) {
numberScoretext = _root.score;
}
}
Instance of Symbol 143 MovieClip "delayer" in Frame 178
onClipEvent (load) {
startTime = 0;
delayTime = 2;
}
onClipEvent (enterFrame) {
if (_root.gameMode == "getNumber") {
if (startTime == 0) {
startTime = getTimer();
} else {
timeLeft = int(delayTime - ((getTimer() - startTime) / 1000));
if (0 >= timeLeft) {
_root.gameMode = "play";
startTime = 0;
_root.getNumber();
}
}
}
if (_root.gameMode == "finish") {
if (startTime == 0) {
startTime = getTimer();
} else {
timeLeft = int(delayTime - ((getTimer() - startTime) / 1000));
if (0 >= timeLeft) {
_root.play();
}
}
}
}
Instance of Symbol 147 MovieClip "timer" in Frame 178
onClipEvent (load) {
if (0 < _root.gameTime) {
_visible = true;
startTime = getTimer();
useTimer = true;
} else {
_visible = false;
useTimer = false;
}
}
onClipEvent (enterFrame) {
if ((_root.gameMode == "play") && (useTimer == true)) {
timeLeft = int(_root.gameTime - ((getTimer() - startTime) / 1000));
if (0 >= timeLeft) {
_root.endGameFunction();
}
}
}
Frame 183
stop();
Frame 188
stop();
Frame 193
timer.startTime = getTimer();
gotoAndStop (178);
Symbol 6 Button
on (release) {
var status = _root.DoMyNumber(number, _name);
if (status == "finish") {
gotoAndPlay (10);
} else if (status == "taken") {
gotoAndStop (5);
} else {
gotoAndStop (1);
}
}
Symbol 12 Button
on (release) {
_root.removeMyNumber(number, _name);
gotoAndStop (1);
}
Symbol 15 MovieClip [number] Frame 1
stop();
Symbol 15 MovieClip [number] Frame 5
stop();
Symbol 15 MovieClip [number] Frame 20
if (_root.gameMode == "wait") {
_root.gameMode = "getNumber";
}
this.removeMovieClip();
stop();
Symbol 15 MovieClip [number] Frame 21
_root.score = _root.score - 10;
Symbol 15 MovieClip [number] Frame 35
this.removeMovieClip();
stop();
Symbol 31 MovieClip Frame 1
stop();
Instance of Symbol 30 MovieClip "swfloader" in Symbol 31 MovieClip Frame 1
onClipEvent (load) {
function strip_spaces(str) {
var _str = new String("");
var j = 0;
while (j < str.length) {
if ((str.charAt(j) != " ") && (str.charAt(j) != ";")) {
_str = _str + str.charAt(j);
}
j++;
}
return(_str);
}
function simple_script(action, timeline) {
action = strip_spaces(action);
if ((0 < action.length) && ((action.indexOf(")") != -1) && (action.indexOf("(") != -1))) {
var sections = action.split(".");
var timeline_action = sections.pop();
var first_paren = timeline_action.indexOf("(");
var second_paren = timeline_action.indexOf(")");
var timeline_function = timeline_action.substr(0, first_paren);
var function_parameter = timeline_action.substr(first_paren + 1, second_paren - (first_paren + 1));
var timeline_reference = timeline;
var j = 0;
while (j < sections.length) {
timeline_reference = timeline_reference[sections[j]];
j++;
}
if (function_parameter.indexOf("\"") != -1) {
function_parameter = function_parameter.substr(1, function_parameter.length - 2);
}
timeline_reference[timeline_function](function_parameter);
}
}
function execute_action() {
unloaded = true;
_parent._visible = false;
simple_script(_parent.play_action_val, _parent);
}
_parent.anim.gotoAndStop(1);
simple_script(_parent.init_action_val, _parent);
var done = false;
var unloaded = false;
var orig_x = _parent._x;
var orig_y = _parent._y;
var dist_x = (_parent._x + ((_parent._width * 2) / 3));
var dist_y = (_parent._y + ((_parent._height * 2) / 3));
var orig_a = _parent._alpha;
var accel_jump = 0.75;
var slow_factor = _parent.slow_factor_val;
var speed_factor = (1 + (slow_factor / (1 - slow_factor)));
var ready = false;
var perc_fadeout = 0;
_parent.perc._x = _parent.anim._x - (_parent.perc._width / 2);
_parent.perc._y = _parent.anim._y - (_parent.perc._height / 2);
if (slow_factor < 1) {
var _local1 = "Up";
switch (_parent.xin_motion_val) {
case _local1 :
_parent._y = orig_y + (dist_y * 2);
break;
case "Down" :
_parent._y = orig_y - (dist_y * 2);
break;
case "Left" :
_parent._x = orig_x + (dist_x * 2);
break;
case "Right" :
_parent._x = orig_x - (dist_x * 2);
break;
case "Toward" :
_parent._xscale = (_parent._yscale = 1);
break;
case "None" :
_parent._alpha = 0;
}
} else {
ready = true;
}
}
onClipEvent (enterFrame) {
if (unloaded) {
return(undefined);
}
if (!ready) {
var _local1 = "Toward";
switch (_parent.xin_motion_val) {
case _local1 :
_parent._xscale = _parent._xscale + ((100 - _parent._xscale) * slow_factor);
_parent._yscale = _parent._xscale;
if (_parent.xin_alphatype_val == "Yes") {
_parent._alpha = Math.round((orig_a / 100) * Math.max(0, Math.min(_parent._xscale, 100)));
}
if (Math.abs(100 - _parent._xscale) < 0.5) {
_parent._xscale = (_parent._yscale = 100);
_parent._alpha = orig_a;
ready = true;
}
break;
default :
_parent._x = _parent._x + ((orig_x - _parent._x) * slow_factor);
_parent._y = _parent._y + ((orig_y - _parent._y) * slow_factor);
if (_parent.xin_alphatype_val == "Yes") {
if (_parent.xin_motion_val == "None") {
_parent._alpha = _parent._alpha + ((orig_a - _parent._alpha) * slow_factor);
} else if (Math.abs(orig_y - _parent._y) < Math.abs(orig_x - _parent._x)) {
_parent._alpha = 100 - Math.round(((orig_a / 100) * (Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x)) * 100);
} else {
_parent._alpha = 100 - Math.round(((orig_a / 100) * (Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y)) * 100);
}
}
if (!(((_parent.xin_motion_val == "None") && (1 >= Math.abs(_parent._alpha - orig_a))) || (((_parent.xin_motion_val != "None") && (Math.abs(_parent._y - orig_y) < 0.5)) && (Math.abs(_parent._x - orig_x) < 0.5)))) {
break;
}
_parent._x = orig_x;
_parent._y = orig_y;
_parent._alpha = orig_a;
ready = true;
}
} else if (!done) {
var rl = _root.getBytesLoaded();
var rt = (_root.getBytesTotal() * (_parent.perc_req_val / 100));
if ((10 < rl) && (10 < rt)) {
rl = Math.min(rl, rt);
var new_frame = (_parent.anim._currentframe + Math.ceil(((_parent.anim._totalframes * (rl / rt)) - _parent.anim._currentframe) / 4));
new_frame = Math.max(1, new_frame);
if (_parent.show_perc_val == "Yes") {
_parent.perc.text = Math.round(((new_frame - 1) / (_parent.anim._totalframes - 1)) * 100) + " %";
}
if (new_frame != _parent.anim._currentframe) {
_parent.anim.gotoAndStop(new_frame);
}
if ((_parent.anim._totalframes == _parent.anim._currentframe) && (rl >= rt)) {
done = true;
}
}
} else if (slow_factor < 1) {
var _local1 = "Down";
switch (_parent.xout_motion_val) {
case _local1 :
if (orig_y >= _parent._y) {
_parent._y = orig_y + accel_jump;
}
_parent._y = orig_y + (Math.abs(_parent._y - orig_y) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y) * 100);
if ((orig_y + (dist_y * 2)) < _parent._y) {
execute_action();
}
break;
case "Up" :
if (_parent._y >= orig_y) {
_parent._y = orig_y - accel_jump;
}
_parent._y = orig_y - (Math.abs(_parent._y - orig_y) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_y, Math.abs(_parent._y - orig_y)) / dist_y) * 100);
if (_parent._y < (orig_y - (dist_y * 2))) {
execute_action();
}
break;
case "Right" :
if (orig_x >= _parent._x) {
_parent._x = orig_x + accel_jump;
}
_parent._x = orig_x + (Math.abs(_parent._x - orig_x) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x) * 100);
if ((orig_x + (dist_x * 2)) < _parent._x) {
execute_action();
}
break;
case "Left" :
if (_parent._x >= orig_x) {
_parent._x = orig_x - accel_jump;
}
_parent._x = orig_x - (Math.abs(_parent._x - orig_x) * speed_factor);
perc_fadeout = Math.round((Math.min(dist_x, Math.abs(_parent._x - orig_x)) / dist_x) * 100);
if (_parent._x < (orig_x - (dist_x * 2))) {
execute_action();
}
break;
case "Away" :
if ((_parent._xscale >= 100) || (_parent._yscale >= 100)) {
_parent._xscale = (_parent._yscale = 100 - accel_jump);
}
_parent._xscale = (_parent._yscale = Math.max(0.5, 100 - ((100 - _parent._yscale) * speed_factor)));
perc_fadeout = 100 - Math.round(Math.max(0, Math.min(_parent._xscale, 100)));
if (_parent._xscale < 1) {
execute_action();
}
break;
default :
perc_fadeout = perc_fadeout + ((100 - perc_fadeout) * slow_factor);
if (1 < Math.abs(perc_fadeout - 100)) {
break;
}
execute_action();
}
_local1 = "Yes";
if (!((_parent.xout_alphatype_val) === (_local1))) {
} else {
_parent._alpha = (orig_a / 100) * (100 - perc_fadeout);
}
} else {
execute_action();
}
}
Symbol 120 Button
on (release) {
_root.play();
}
Instance of Symbol 128 MovieClip in Symbol 129 MovieClip Frame 1
onClipEvent (load) {
function execute_action() {
unloaded = true;
_parent._visible = false;
simple_script(_parent.play_action_val, _parent);
}
_root.gameTime = _parent.game_time_val;
_root.mathType = _parent.math_type_val;
_root.numberOfRows = _parent.number_rows_val;
_root.numberOfColumns = _parent.number_columns_val;
_root.XPosition = _parent.placement_x_val;
_root.YPosition = _parent.placement_y_val;
_root.boxWidth = _parent.box_width_val;
_root.boxHeight = _parent.box_height_val;
_root.padding = _parent.padding_val;
_root.addMax = _parent.add_max_val;
_root.subMax = _parent.sub_max_val;
_root.multMax = _parent.mult_max_val;
_root.divMax = _parent.div_max_val;
_root.correctSound = _parent.correct_sound_val;
_root.correctSoundObj = new Sound();
_root.correctSoundObj.attachSound(_root.correctSound);
_root.wrongSound = _parent.wrong_sound_val;
_root.wrongSoundObj = new Sound();
_root.wrongSoundObj.attachSound(_root.wrongSound);
_parent.anim.gotoAndStop(1);
simple_script(_parent.init_action_val, _parent);
var done = false;
var unloaded = false;
var ready = false;
}
onClipEvent (data) {
var changeQuestions = true;
var numberOfquestions = 1;
while (changeQuestions == true) {
if (0 < eval ("question" + numberOfquestions).length) {
_root["question" + numberOfquestions] = this["question" + numberOfquestions];
var i = 1;
while (_root.availableAnswers >= i) {
_root[(("answer" + numberOfquestions) + "_") + i] = this[(("answer" + numberOfquestions) + "_") + i];
i++;
}
numberOfquestions++;
} else {
changeQuestions = false;
}
}
_root.play();
}
onClipEvent (enterFrame) {
if (unloaded) {
return(undefined);
}
if (!ready) {
}
}
Instance of Symbol 136 MovieClip "bonusMC" in Symbol 141 MovieClip Frame 1
onClipEvent (load) {
function starttimer() {
bonusTimeLeft = BonusTime;
startTime = getTimer() / 1000;
_root.bonusScore = bonusTimeLeft;
}
BonusTime = 10;
startTimer();
}
onClipEvent (enterFrame) {
if (_root.gameMode == "play") {
var newTime = ((getTimer() / 1000) - startTime);
bonusTimeLeft = int(BonusTime - newTime);
_root.bonusScore = bonusTimeLeft;
if (bonusTimeLeft < 0) {
bonusTimeLeft = 0;
}
}
}
Symbol 143 MovieClip Frame 1
if (checkingWord == true) {
if (_root.wordscore != -1) {
_root.game.check_valid_word();
stop();
}
} else {
stop();
}
Symbol 143 MovieClip Frame 10
if (_root.testing == true) {
_root.wordScore = 10;
}
gotoAndPlay (1);
Symbol 159 Button
on (release) {
timer.startTime = getTimer();
gotoAndStop (178);
}