Frame 2
stop();
Instance of Symbol 183 MovieClip "instructions" in Frame 2
onClipEvent (load) {
this._visible = false;
}
Frame 3
stop();
Instance of Symbol 278 MovieClip in Frame 3
//component parameters
onClipEvent (initialize) {
mode_val = "No Quiz";
num_points_next_level_val = 1500;
quiz_data_val = "quiz.txt";
square_width_val = 28;
square_height_val = 28;
grid_dim_x_val = 10;
grid_dim_y_val = 20;
upper_left_x_val = 190;
upper_left_y_val = -15;
initial_delay_val = 20;
minimum_delay_val = 4;
delta_delay_val = 1;
num_point_pieces_val = 7;
point_scores_val = [];
point_scores_val[0] = 50;
point_scores_val[1] = 100;
point_scores_val[2] = 250;
point_scores_val[3] = 500;
point_piece_probability_val = 2;
backgrounds_val = [];
backgrounds_val[0] = "background.swf";
songs_val = [];
songs_val[0] = "song0.swf";
songs_val[1] = "song1.swf";
songs_val[2] = "song2.swf";
songs_val[3] = "song3.swf";
songs_val[4] = "song4.swf";
songs_val[5] = "song5.swf";
songs_val[6] = "song6.swf";
block_animation_val = "None";
point_scores_1_load_type = "Load URL";
point_scores_1_load_target = "_self";
point_scores_1_load_url = "http://";
point_scores_2_load_type = "Load URL";
point_scores_2_load_target = "_self";
point_scores_2_load_url = "http://";
point_scores_3_load_type = "Load URL";
point_scores_3_load_target = "_self";
point_scores_3_load_url = "http://";
point_scores_4_load_type = "Load URL";
point_scores_4_load_target = "_self";
point_scores_4_load_url = "http://";
backgrounds_1_load_type = "Load URL";
backgrounds_1_load_target = "_self";
backgrounds_1_load_url = "http://";
backgrounds_2_load_type = "Load URL";
backgrounds_2_load_target = "_self";
backgrounds_2_load_url = "http://";
backgrounds_3_load_type = "Load URL";
backgrounds_3_load_target = "_self";
backgrounds_3_load_url = "http://";
songs_1_load_type = "Load URL";
songs_1_load_target = "_self";
songs_1_load_url = "http://";
songs_2_load_type = "Load URL";
songs_2_load_target = "_self";
songs_2_load_url = "http://";
songs_3_load_type = "Load URL";
songs_3_load_target = "_self";
songs_3_load_url = "http://";
backgrounds_4_val = "";
backgrounds_4_load_type = "Load URL";
backgrounds_4_load_target = "_self";
backgrounds_4_load_url = "http://";
backgrounds_5_val = "";
backgrounds_5_load_type = "Load URL";
backgrounds_5_load_target = "_self";
backgrounds_5_load_url = "http://";
backgrounds_6_val = "";
backgrounds_6_load_type = "Load URL";
backgrounds_6_load_target = "_self";
backgrounds_6_load_url = "http://";
backgrounds_7_val = "";
backgrounds_7_load_type = "Load URL";
backgrounds_7_load_target = "_self";
backgrounds_7_load_url = "http://";
backgrounds_8_val = "";
backgrounds_8_load_type = "Load URL";
backgrounds_8_load_target = "_self";
backgrounds_8_load_url = "http://";
backgrounds_9_val = "";
backgrounds_9_load_type = "Load URL";
backgrounds_9_load_target = "_self";
backgrounds_9_load_url = "http://";
backgrounds_10_val = "";
backgrounds_10_load_type = "Load URL";
backgrounds_10_load_target = "_self";
backgrounds_10_load_url = "http://";
backgrounds_11_val = "";
backgrounds_11_load_type = "Load URL";
backgrounds_11_load_target = "_self";
backgrounds_11_load_url = "http://";
backgrounds_12_val = "";
backgrounds_12_load_type = "Load URL";
backgrounds_12_load_target = "_self";
backgrounds_12_load_url = "http://";
backgrounds_13_val = "";
backgrounds_13_load_type = "Load URL";
backgrounds_13_load_target = "_self";
backgrounds_13_load_url = "http://";
backgrounds_14_val = "";
backgrounds_14_load_type = "Load URL";
backgrounds_14_load_target = "_self";
backgrounds_14_load_url = "http://";
backgrounds_15_val = "";
backgrounds_15_load_type = "Load URL";
backgrounds_15_load_target = "_self";
backgrounds_15_load_url = "http://";
backgrounds_16_val = "";
backgrounds_16_load_type = "Load URL";
backgrounds_16_load_target = "_self";
backgrounds_16_load_url = "http://";
songs_4_val = "";
songs_4_load_type = "Load URL";
songs_4_load_target = "_self";
songs_4_load_url = "http://";
songs_5_val = "";
songs_5_load_type = "Load URL";
songs_5_load_target = "_self";
songs_5_load_url = "http://";
songs_6_val = "";
songs_6_load_type = "Load URL";
songs_6_load_target = "_self";
songs_6_load_url = "http://";
songs_7_val = "";
songs_7_load_type = "Load URL";
songs_7_load_target = "_self";
songs_7_load_url = "http://";
}
Frame 4
stop();
Instance of Symbol 360 MovieClip in Frame 4
//component parameters
onClipEvent (initialize) {
scr = "_root.score";
}
Frame 5
_root.gotoAndStop("Starting Screen");
Symbol 14 MovieClip [explode_cloud] Frame 1
this.gotoAndPlay(Math.randi(1, 6));
Symbol 14 MovieClip [explode_cloud] Frame 15
this.removeMovieClip();
Symbol 24 MovieClip [quiz_smart_clip] Frame 1
MovieClip.prototype.set_color_hex = function (hex) {
new Color(this).setRGB(hex);
};
String.prototype.search_and_replace = function (str1, str2) {
var index = 0;
var before;
var after;
var final = new String(this);
while (((index = final.indexOf(str1))) != -1) {
var len = final.length;
before = final.substr(0, index);
after = final.substr(index + str1.length, final_length);
final = before.concat(str2, after);
}
return(final);
};
this._x = 0;
this._y = 0;
Quiz = function () {
this.depth = 0;
this.mode = undefined;
this.fade_animation_oldframe = undefined;
this.fade_animation_currentframe = undefined;
this.choices_states = new Array();
this.num_wrong_guesses = 0;
this.last_guess = undefined;
this.initialize();
};
Quiz.prototype.question_text = question_text;
Quiz.prototype.choices = choices;
Quiz.prototype.correct_index = Number(correct_index);
Quiz.prototype.quiz_button_linkage = quiz_button_linkage;
Quiz.prototype.correct_linkage = correct_linkage;
Quiz.prototype.incorrect_linkage = incorrect_linkage;
Quiz.prototype.message_x = message_x;
Quiz.prototype.message_y = message_y;
Quiz.prototype.fade_in_out_animation = fade_in_out_animation;
Quiz.prototype.question_font = question_font;
Quiz.prototype.question_color = parseInt(question_color);
Quiz.prototype.question_size = parseInt(question_size);
Quiz.prototype.words_per_line = parseInt(words_per_line);
Quiz.prototype.question_y = parseInt(question_y);
Quiz.prototype.answer_font = answer_font;
Quiz.prototype.answer_color = parseInt(answer_color);
Quiz.prototype.answer_size = parseInt(answer_size);
Quiz.prototype.first_button_x = parseInt(first_button_x);
Quiz.prototype.first_button_y = parseInt(first_button_y);
Quiz.prototype.button_spacing = parseInt(button_spacing);
Quiz.prototype.screen_width = parseInt(screen_width);
Quiz.prototype.screen_height = parseInt(screen_height);
Quiz.prototype.quiz_callback = quiz_callback;
Quiz.prototype.close_button = close_button;
Quiz.prototype.close_x = Number(close_x);
Quiz.prototype.close_y = Number(close_y);
Quiz.prototype.closing_statement = closing_statement;
Quiz.prototype.guess_type = guess_type;
Quiz.prototype.timeline = this;
delete question_text;
delete choices;
delete correct_index;
delete quiz_button_linkage;
delete correct_linkage;
delete incorrect_linkage;
delete message_x;
delete message_y;
delete fade_in_out_animation;
delete question_font;
delete question_color;
delete question_size;
delete words_per_line;
delete question_y;
delete answer_font;
delete answer_color;
delete answer_size;
delete first_button_x;
delete first_button_y;
delete button_spacing;
delete screen_width;
delete screen_height;
delete close_button;
delete close_x;
delete close_y;
delete closing_statement;
Quiz.prototype.initialize = function () {
this.timeline.attachMovie(this.fade_in_out_animation, "fade_animation", this.depth++);
this.timeline.fade_animation.play();
this.timeline.fade_animation._x = this.screen_width / 2;
this.timeline.fade_animation._y = this.screen_height / 2;
this.mode = "introduction";
};
Quiz.prototype.action = function () {
this.fade_animation_oldframe = this.fade_animation_currentframe;
this.fade_animation_currentframe = this.timeline.fade_animation._currentframe;
if (this.mode == "introduction") {
if (this.fade_animation_oldframe == this.fade_animation_currentframe) {
this.create_quiz_form();
this.mode = "waiting for user input";
}
} else if (this.mode == "correct answer") {
if (this.timeline.correct_animation._currentframe == this.timeline.correct_animation._totalframes) {
this.timeline.correct_animation.removeMovieClip();
this.timeline.attachMovie(this.close_button, "close_button", 200000);
this.timeline.close_button._x = this.close_x;
this.timeline.close_button._y = this.close_y;
this.mode = "waiting for user to close";
var text_array = this.closing_statement.split(" ");
var i = (this.words_per_line - 1);
while (i < text_array.length) {
text_array[i] = text_array[i] + newline;
i = i + this.words_per_line;
}
var qtext = text_array.toString();
qtext = qtext.search_and_replace(",", " ");
this.timeline.attachMovie("quiz_main_textfield", "closing_statement", 20001);
this.timeline.closing_statement.field = qtext;
this.timeline.closing_statement._x = this.screen_width / 2;
this.timeline.closing_statement._y = this.question_y;
this.timeline.quiz_question.removeMovieClip();
}
} else if (this.mode == "incorrect answer") {
if (this.timeline.incorrect_animation._currentframe == this.timeline.incorrect_animation._totalframes) {
this.timeline.incorrect_animation.removeMovieClip();
this.timeline["button" + this.last_guess].removeMovieClip();
this.timeline["choice_textfield" + this.last_guess].removeMovieClip();
this.mode = "waiting for user input";
if (this.guess_type == "One Guess") {
this.mode = "correct answer";
}
}
} else if (this.mode == "waiting for user input") {
} else if (this.mode == "closing") {
if (this.timeline.fade_animation._currentframe == this.timeline.fade_animation._totalframes) {
this.timeline._parent.game[this.quiz_callback](this.num_wrong_guesses);
this.timeline.removeMovieClip();
}
} else if (this.mode == "waiting for user to close") {
}
};
Quiz.prototype.create_quiz_form = function () {
var _mc;
this.timeline.attachMovie("quiz_main_textfield", "quiz_question", this.depth++);
this.timeline.quiz_question._x = this.screen_width / 2;
this.timeline.quiz_question._y = this.question_y;
var text_array = this.question_text.split(" ");
var i = (this.words_per_line - 1);
while (i < text_array.length) {
text_array[i] = text_array[i] + newline;
i = i + this.words_per_line;
}
var qtext = text_array.toString();
qtext = qtext.search_and_replace(",", " ");
this.timeline.quiz_question.field = qtext;
var j = 0;
while (j < this.choices.length) {
this.timeline.attachMovie(this.quiz_button_linkage, "button" + j, this.depth++);
_mc = this.timeline["button" + j];
_mc._x = this.first_button_x;
_mc._y = this.first_button_y + (j * this.button_spacing);
this.timeline.attachMovie("quiz_answer_textfield", "choice_textfield" + j, this.depth++);
_mc = this.timeline["choice_textfield" + j];
_mc._x = ((this.first_button_x + (_mc._width / 2)) + (this.timeline["button" + j]._width / 2)) + 10;
_mc._y = (this.first_button_y + (j * this.button_spacing)) - (this.timeline["button" + j]._height / 2);
_mc.field = this.choices[j];
this.choices_states[j] = true;
j++;
}
};
Quiz.prototype.on_click = function () {
if (this.mode == "waiting for user input") {
var j = 0;
while (j < this.choices.length) {
if (this.timeline["button" + j].hitTest(_root._xmouse, _root._ymouse, true) && (!choices_states[j])) {
this.evaluate_choice(j);
}
j++;
}
} else if (this.mode == "waiting for user to close") {
if (this.timeline.close_button.hitTest(_root._xmouse, _root._ymouse, true)) {
this.timeline.fade_animation.play();
for (var j in this.timeline) {
if (this.timeline[j]._name != "fade_animation") {
this.timeline[j].removeMovieClip();
}
}
this.mode = "closing";
}
}
};
Quiz.prototype.evaluate_choice = function (index) {
var _mc;
this.last_guess = index;
if (index == this.correct_index) {
this.timeline.attachMovie(this.correct_linkage, "correct_animation", this.depth++);
_mc = this.timeline.correct_animation;
_mc.play();
_mc._x = this.message_x;
_mc._y = this.message_y;
var j = 0;
while (j < this.choices.length) {
if (j != index) {
this.timeline["button" + j].removeMovieClip();
this.timeline["choice_textfield" + j].removeMovieClip();
}
j++;
}
this.mode = "correct answer";
} else {
this.timeline.attachMovie(this.incorrect_linkage, "incorrect_animation", this.depth++);
_mc = this.timeline.incorrect_animation;
_mc.play();
_mc._x = this.message_x;
_mc._y = this.message_y;
this.num_wrong_guesses++;
this.mode = "incorrect answer";
}
};
quiz_sm = new Quiz();
Instance of Symbol 23 MovieClip "controller" in Symbol 24 MovieClip [quiz_smart_clip] Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (mouseDown) {
with (_parent) {
quiz_sm.on_click();
}
}
onClipEvent (enterFrame) {
with (_parent) {
quiz_sm.action();
}
}
Symbol 29 MovieClip [fade_animation] Frame 10
stop();
Symbol 43 MovieClip [losing_prompt] Frame 10
stop();
Symbol 43 MovieClip [losing_prompt] Frame 20
this.removeMovieClip();
Symbol 47 MovieClip [winning_prompt] Frame 10
stop();
Symbol 47 MovieClip [winning_prompt] Frame 20
this.removeMovieClip();
Symbol 54 MovieClip Frame 1
this.gotoAndStop(Math.randi(1, 4));
Symbol 69 MovieClip [blocks] Frame 1
stop();
Symbol 70 MovieClip [main_blocks] Frame 1
stop();
animation_done = function () {
this.gotoAndStop(1);
_parent._parent.game.shift_pieces_down();
};
Symbol 70 MovieClip [main_blocks] Frame 15
animation_done();
Symbol 70 MovieClip [main_blocks] Frame 31
animation_done();
Symbol 70 MovieClip [main_blocks] Frame 33
animation_done();
Symbol 77 MovieClip Frame 1
Stage.scaleMode = "noScale";
fscommand ("trapallkeys", true);
Stage.showMenu = false;
this.uu = _root._url;
var a = _root._url.split("/");
var i = 0;
while (i < a.length) {
if (a[i] == "files") {
_root.gid = a[i + 1];
}
i++;
}
if ((a[2] == "www.netstupidity.com") || (a[2] == "netstupidity.com")) {
_root.ligin = 1;
}
_root.__url = "http://www.netstupidity.com/games/hof/";
_root.loadVariables((_root.__url + "hof_bsc.php?id=") + _root.gid);
_root.prc = 0;
this.onEnterFrame = function () {
var ld = _root.getBytesLoaded();
var tt = _root.getBytesTotal();
var pr = ((100 * ld) / tt);
this.pasek._xscale = pr;
var b = Math.round(pr / 20);
if (pr >= 100) {
this.onEnterFrame = null;
this._parent.play();
}
};
Symbol 91 MovieClip Frame 140
stop();
Symbol 130 MovieClip Frame 1
this.t = getTimer();
this.tm = 0;
this.onEnterFrame = function () {
if (_root._framesloaded < 2) {
this.t = getTimer();
return(undefined);
}
this.tm = this.tm + (getTimer() - this.t);
var tt = Math.round(this.tm / 33);
if (tt < 1) {
this.stop();
} else {
this.t = getTimer();
if (tt >= 145) {
this.onEnterFrame = null;
this.gotoAndStop(145);
_root.play();
} else {
this.gotoAndStop(tt);
}
}
};
stop();
Symbol 133 MovieClip Frame 1
_root.stop();
stop();
Symbol 133 MovieClip Frame 2
stop();
Symbol 139 Button
on (press) {
this.instructions._visible = true;
this.instructions.gotoAndPlay(1);
}
Symbol 142 Button
on (press) {
play();
}
Symbol 180 Button
on (press) {
this._visible = false;
}
Symbol 183 MovieClip Frame 42
stop();
Symbol 187 MovieClip Frame 1
this._visible = _root.ligin == undefined;
this.onPress = function () {
getURL ("http://www.netstupidity.com");
};
Symbol 206 MovieClip Frame 1
stop();
Symbol 218 Button
on (press) {
this.gotoAndStop(2);
var j = 0;
while (j < _parent.game.songs.length) {
this["_level" + (5000 + j)].stop();
j++;
}
}
Symbol 221 Button
on (press) {
this.gotoAndStop(1);
var j = 0;
while (j < _parent.game.songs.length) {
if (this["_level" + (5000 + j)]._currentframe != 1) {
this["_level" + (5000 + j)].play();
}
j++;
}
}
Symbol 222 MovieClip Frame 1
stop();
Symbol 229 Button
on (press) {
_parent._parent.game.evaluate_answer(this);
}
Symbol 254 MovieClip Frame 1
stop();
Symbol 254 MovieClip Frame 14
stop();
Symbol 254 MovieClip Frame 48
_parent.game.answer_prompt_done();
Symbol 254 MovieClip Frame 83
_parent.game.answer_prompt_done();
Symbol 277 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 1
Object.prototype.BLANK = 0;
Object.prototype.REGULAR_BLOCK = 1;
Object.prototype.NUM_PIECE_TYPES = 9;
Object.prototype.PIECE1 = 2;
Object.prototype.PIECE2 = 3;
Object.prototype.PIECE3 = 4;
Object.prototype.PIECE4 = 5;
Object.prototype.PIECE5 = 6;
Object.prototype.PIECE6 = 7;
Object.prototype.PIECE7 = 8;
Object.prototype.PIECE8 = 9;
Object.prototype.PIECE9 = 10;
Key.A = 65;
Key.B = 66;
Key.C = 67;
Key.D = 68;
Key.E = 69;
Key.F = 70;
Key.G = 71;
Key.H = 72;
Key.I = 73;
Key.J = 74;
Key.K = 75;
Key.L = 76;
Key.M = 77;
Key.N = 78;
Key.O = 79;
Key.P = 80;
Key.Q = 81;
Key.R = 82;
Key.S = 83;
Key.T = 84;
Key.U = 85;
Key.V = 86;
Key.W = 87;
Key.X = 88;
Key.Y = 89;
Key.Z = 90;
Key.ZERO = 48;
Key.ONE = 49;
Key.TWO = 50;
Key.THREE = 51;
Key.FOUR = 52;
Key.FIVE = 53;
Key.SIX = 54;
Key.SEVEN = 55;
Key.EIGHT = 56;
Key.NINE = 57;
Key.NUMPAD_ZERO = 96;
Key.NUMPAD_ONE = 97;
Key.NUMPAD_TWO = 98;
Key.NUMPAD_THREE = 99;
Key.NUMPAD_FOUR = 100;
Key.NUMPAD_FIVE = 101;
Key.NUMPAD_SIX = 102;
Key.NUMPAD_SEVEN = 103;
Key.NUMPAD_EIGHT = 104;
Key.NUMPAD_NINE = 105;
Key.MULTIPLY = 106;
Key.ADD = 107;
Key.SUBTRACT = 109;
Key.DECIMAL = 110;
Key.DIVIDE = 111;
Key.F1 = 112;
Key.F2 = 113;
Key.F3 = 114;
Key.F4 = 115;
Key.F5 = 116;
Key.F6 = 117;
Key.F7 = 118;
Key.F8 = 119;
Key.F9 = 120;
Key.F10 = 121;
Key.F11 = 122;
Key.F12 = 123;
Key.CLEAR = 12;
Key.PAGEUP = 33;
Key.PAGEDOWN = 34;
Key.HELP = 47;
Key.NUMLOCK = 144;
Key.SEMICOLON = 186;
Key.EQUAL = 187;
Key.MINUS = 189;
Key.SLASH = 191;
Key.GRAVE = 192;
Key.OPENBRACKET = 219;
Key.BACKSLASH = 220;
Key.CLOSEBRACKET = 221;
Key.QUOTE = 222;
Array.prototype.swap = function (e1, e2) {
var temp = this[e1];
this[e1] = this[e2];
this[e2] = temp;
};
Array.prototype.shuffle = function () {
var j = 0;
while (j < this.length) {
this.swap(Math.randi(0, this.length), Math.randi(0, this.length));
j++;
}
};
Array.prototype.return_maximum = function (prop) {
var index_max = undefined;
var j = 0;
while (j < this.length) {
if (prop == undefined) {
if ((this[j] > this[index_max]) || (index_max == undefined)) {
index_max = j;
}
} else if ((this[j][prop] > this[index_max][prop]) || (index_max == undefined)) {
index_max = j;
}
j++;
}
return(index_max);
};
Array.prototype.return_minimum = function (prop) {
var index_min = undefined;
var j = 0;
while (j < this.length) {
if (prop == undefined) {
if ((this[j] < this[index_min]) || (index_min == undefined)) {
index_min = j;
}
} else if ((this[j][prop] < this[index_min][prop]) || (index_min == undefined)) {
index_min = j;
}
j++;
}
return(index_min);
};
Math.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + a);
};
Math.randa = function () {
return(arguments[Math.randi(0, arguments.length)]);
};
Math.standard_angle = function (angle) {
if (angle >= 0) {
return(angle % 360);
}
return((angle % 360) + 360);
};
Math.isEven = function (x) {
return((x % 2) == 0);
};
Object.prototype.QuizClass = function (num_questions, num_choices) {
this.num_questions = Number(num_questions);
this.num_choices = Number(num_choices);
this.questions = new Array();
};
Object.prototype.QuestionClass = function (question_text, closing_statement, answer, choices) {
this.question_text = question_text;
this.choices = choices;
this.answer = answer;
this.closing_statement = closing_statement;
};
Object.prototype.Matrix = function (m, n, fill) {
this.m = m;
this.n = n;
this.elements = new Array();
this.initialize(fill);
};
Matrix.prototype.toString = function () {
var _str = "";
var j = 0;
while (j < this.m) {
_str = _str + "[ ";
var k = 0;
while (k < this.n) {
_str = _str + ((" " + new String(this.elements[j][k])) + " ");
k++;
}
_str = _str + " ]\n";
j++;
}
return(_str);
};
Matrix.prototype.initialize = function (fill) {
this.elements = new Array();
var j = 0;
while (j < this.m) {
this.elements[j] = new Array();
var k = 0;
while (k < this.n) {
this.elements[j][k] = Number(fill);
k++;
}
j++;
}
};
Matrix.prototype.set_row_elements = function (j) {
var k = 0;
while (k < this.n) {
this.elements[j][k] = arguments[k + 1];
k++;
}
};
Matrix.prototype.set_column_elements = function (k) {
var j = 0;
while (j < this.m) {
this.elements[j][k] = arguments[j + 1];
j++;
}
};
Matrix.prototype.return_transpose = function () {
var transpose = new Matrix(this.n, this.m);
var j = 0;
while (j < this.m) {
var k = 0;
while (k < this.n) {
transpose.elements[k][j] = this.elements[j][k];
k++;
}
j++;
}
return(transpose);
};
Matrix.prototype.swap_rows = function (j, k) {
var i = 0;
while (i < this.n) {
var temp = this.elements[j][i];
this.elements[j][i] = this.elements[k][i];
this.elements[k][i] = temp;
i++;
}
};
Matrix.prototype.swap_columns = function (j, k) {
var i = 0;
while (i < this.m) {
var temp = this.elements[i][j];
this.elements[i][j] = this.elements[i][k];
this.elements[i][k] = temp;
i++;
}
};
Matrix.prototype.reflect_rows = function () {
var center = Math.floor(this.m / 2);
var j = 0;
while (j < center) {
this.swap_rows(j, (this.m - j) - 1);
j++;
}
};
Matrix.prototype.reflect_columns = function () {
var center = Math.floor(this.n / 2);
var j = 0;
while (j < center) {
this.swap_columns(j, (this.n - j) - 1);
j++;
}
};
Object.prototype.Indices = function (j, k) {
this.j = j;
this.k = k;
};
Indices.prototype.toString = function () {
return(((("( " + this.j) + " , ") + this.k) + " )");
};
Object.prototype.Piece = function (piece_type, start_j, start_k) {
this.piece_type = piece_type;
this.grid = new Matrix();
this.position = new Indices(start_j, start_k);
this.full_rotation = 0;
this.rotation = 0;
this.initialize();
};
Piece.prototype.num_point_pieces = Number(num_point_pieces_val);
Piece.prototype.point_piece_probability = Number(point_piece_probability_val);
Piece.prototype.return_num_rows = function () {
return(this.grid.m);
};
Piece.prototype.return_num_columns = function () {
return(this.grid.n);
};
Piece.prototype.initialize = function () {
this.b1 = REGULAR_BLOCK;
this.b2 = REGULAR_BLOCK;
this.b3 = REGULAR_BLOCK;
this.b4 = REGULAR_BLOCK;
this.b5 = REGULAR_BLOCK;
this.b6 = REGULAR_BLOCK;
this.b7 = REGULAR_BLOCK;
this.b8 = REGULAR_BLOCK;
var already_done = false;
if (Math.randi(0, this.point_piece_probability) == 0) {
this["b" + Math.randi(1, this.num_point_pieces + 1)] = Math.randi(2, this.num_point_pieces + 2);
already_done = true;
}
if ((Math.random() < 0.75) && (already_done == false)) {
this["b" + Math.randi(1, this.num_point_pieces + 1)] = Math.randi(6, 9);
}
if (this.piece_type == PIECE1) {
this.grid = new Matrix(3, 2);
this.grid.set_row_elements(0, BLANK, this.b1);
this.grid.set_row_elements(1, BLANK, this.b2);
this.grid.set_row_elements(2, this.b3, this.b4);
} else if (this.piece_type == PIECE2) {
this.grid = new Matrix(4, 1);
this.grid.set_row_elements(0, this.b1);
this.grid.set_row_elements(1, this.b2);
this.grid.set_row_elements(2, this.b3);
this.grid.set_row_elements(3, this.b4);
} else if (this.piece_type == PIECE3) {
this.grid = new Matrix(3, 2);
this.grid.set_row_elements(0, this.b1, BLANK);
this.grid.set_row_elements(1, this.b2, this.b3);
this.grid.set_row_elements(2, BLANK, this.b4);
} else if (this.piece_type == PIECE4) {
this.grid = new Matrix(3, 2);
this.grid.set_row_elements(0, this.b1, BLANK);
this.grid.set_row_elements(1, this.b2, BLANK);
this.grid.set_row_elements(2, this.b3, this.b4);
} else if (this.piece_type == PIECE5) {
this.grid = new Matrix(3, 2);
this.grid.set_row_elements(0, BLANK, this.b1);
this.grid.set_row_elements(1, this.b2, this.b3);
this.grid.set_row_elements(2, this.b4, BLANK);
} else if (this.piece_type == PIECE6) {
this.grid = new Matrix(2, 2);
this.grid.set_row_elements(0, this.b1, this.b2);
this.grid.set_row_elements(1, this.b3, this.b4);
} else if (this.piece_type == PIECE7) {
this.grid = new Matrix(3, 2);
this.grid.set_row_elements(0, this.b1, BLANK);
this.grid.set_row_elements(1, this.b2, this.b3);
this.grid.set_row_elements(2, this.b4, BLANK);
} else if (this.piece_type == PIECE8) {
this.grid = new Matrix(3, 2);
this.grid.set_row_elements(0, this.b1, this.b2);
this.grid.set_row_elements(1, this.b3, BLANK);
this.grid.set_row_elements(2, this.b4, this.b5);
} else if (this.piece_type == PIECE9) {
this.grid = new Matrix(3, 3);
this.grid.set_row_elements(0, BLANK, this.b1, BLANK);
this.grid.set_row_elements(1, this.b2, this.b3, this.b4);
this.grid.set_row_elements(2, BLANK, this.b5, BLANK);
}
};
Piece.prototype.rotate_counterclockwise = function () {
this.full_rotation = this.full_rotation + 90;
this.rotation = Math.standard_angle(this.full_rotation);
this.grid = this.grid.return_transpose();
this.grid.reflect_rows();
if (this.piece_type == PIECE2) {
if (this.rotation == 0) {
this.move_right();
this.move_up();
} else if (this.rotation == 90) {
this.move_down();
this.move_left();
} else if (this.rotation == 180) {
this.move_right();
this.move_up();
} else if (this.rotation == 270) {
this.move_down();
this.move_left();
}
}
};
Piece.prototype.rotate_clockwise = function () {
this.full_rotation = this.full_rotation - 90;
this.rotation = Math.standard_angle(this.full_rotation);
this.grid = this.grid.return_transpose();
this.grid.reflect_columns();
if (this.piece_type == PIECE2) {
if (this.rotation == 0) {
this.move_right();
this.move_up();
} else if (this.rotation == 90) {
this.move_down();
this.move_left();
} else if (this.rotation == 180) {
this.move_right();
this.move_up();
} else if (this.rotation == 270) {
this.move_down();
this.move_left();
}
}
};
Piece.prototype.move_left = function () {
this.position.k--;
};
Piece.prototype.move_right = function () {
this.position.k++;
};
Piece.prototype.move_down = function () {
this.position.j++;
};
Piece.prototype.move_up = function () {
this.position.j--;
};
_root._quality = "MEDIUM";
this._x = 0;
this._y = 0;
Object.prototype.Tetris = function () {
this.depth = 0;
this.grid = new Matrix(this.grid_dim_y, this.grid_dim_x);
this.current_frame = 0;
this.score = 0;
this.level = 0;
this.num_bombs = 0;
this.next_piece = Math.randi(1, (NUM_PIECE_TYPES + 1) - 2);
if (Math.random() < 0.2) {
this.next_piece = this.next_piece + Math.randi(1, 3);
}
this.paused = false;
this.current_delay = this.initial_delay;
this.initialize();
};
for (var j in this) {
if (j != "Tetris") {
var real_name = j.substr(0, j.length - 4);
Tetris.prototype[real_name] = this[j];
if (typeof(this[j]) == Number) {
Tetris.prototype[real_name] = Number(Tetris.prototype[real_name]);
}
delete this[j];
}
}
Tetris.prototype.timeline = this;
Tetris.prototype.initialize = function () {
this.depth = 0;
this.grid = new Matrix(this.grid_dim_y, this.grid_dim_x);
this.current_frame = 0;
this.score = (this.timeline.score_board.score_display = 0);
this.level = (this.timeline.level_display.level = 0);
this.next_piece = Math.randi(1, NUM_PIECE_TYPES + 1);
this.paused = false;
this.current_delay = this.initial_delay;
this.timeline.audio_control._visible = this.songs.length != 0;
this.create_playing_area();
this.initialize_grid();
this.create_falling_piece();
this.load_background();
if (this.mode == "With Quiz") {
this.timeline.controller.loadVariables(this.quiz_data);
}
};
Tetris.prototype.create_playing_area = function () {
this.timeline.background_pictures.removeMovieClip();
this.timeline.attachMovie("empty_mc", "background_pictures", this.depth++);
this.timeline.game_piece_holder.removeMovieClip();
this.timeline.attachMovie("empty_mc", "game_piece_holder", this.depth++);
this.timeline.background_pictures._x = (this.timeline.game_piece_holder._x = this.upper_left_x);
this.timeline.background_pictures._y = (this.timeline.game_piece_holder._y = this.upper_left_y);
};
Tetris.prototype.initialize_grid = function () {
var _mc = undefined;
var j = 0;
while (j < this.grid_dim_y) {
var k = 0;
while (k < this.grid_dim_x) {
this.grid.elements[j][k] = BLANK;
this.timeline.game_piece_holder[(("block_" + j) + "_") + k].removeMovieClip();
this.timeline.game_piece_holder.attachMovie("main_blocks", (("block_" + j) + "_") + k, this.depth++);
_mc = this.timeline.game_piece_holder[(("block_" + j) + "_") + k];
_mc._x = k * this.square_width;
_mc._y = j * this.square_height;
_mc._width = this.square_width;
_mc._height = this.square_height;
_mc.j = j;
_mc.k = k;
_mc._visible = false;
k++;
}
j++;
}
};
Tetris.prototype.create_falling_piece = function () {
var piece_type = this["PIECE" + this.next_piece];
this.falling_piece = new Piece(piece_type, 0, Math.floor(this.grid_dim_x / 2) - 1);
this.next_piece = Math.randi(1, NUM_PIECE_TYPES + 1);
this.timeline.next_piece_window.gotoAndStop(this.next_piece);
};
Tetris.prototype.action = function () {
this.move_falling_piece();
this.manage_songs();
this.current_frame++;
this.timeline.score_board.score_display = this.score;
this.timeline.num_bombs = this.num_bombs;
};
Tetris.prototype.move_falling_piece = function () {
if ((this.current_frame % this.current_delay) == 0) {
this.animate_falling_piece("move_down");
}
};
Tetris.prototype.remove_falling_piece_imprint = function () {
var start_j = this.falling_piece.position.j;
var start_k = this.falling_piece.position.k;
var rows = this.falling_piece.return_num_rows();
var columns = this.falling_piece.return_num_columns();
var j = start_j;
while (j < (start_j + rows)) {
var k = start_k;
while (k < (start_k + columns)) {
var _j = (j - start_j);
var _k = (k - start_k);
if (this.falling_piece.grid.elements[_j][_k] != BLANK) {
this.grid.elements[j][k] = BLANK;
}
k++;
}
j++;
}
};
Tetris.prototype.create_falling_piece_imprint = function () {
var start_j = this.falling_piece.position.j;
var start_k = this.falling_piece.position.k;
var rows = this.falling_piece.return_num_rows();
var columns = this.falling_piece.return_num_columns();
var j = start_j;
while (j < (start_j + rows)) {
var k = start_k;
while (k < (start_k + columns)) {
var _j = (j - start_j);
var _k = (k - start_k);
if (this.falling_piece.grid.elements[_j][_k] != BLANK) {
this.grid.elements[j][k] = this.falling_piece.grid.elements[_j][_k];
}
k++;
}
j++;
}
};
Tetris.prototype.render_grid = function () {
var _mc = undefined;
var j = 0;
while (j < this.grid_dim_y) {
var k = 0;
while (k < this.grid_dim_x) {
_mc = this.timeline.game_piece_holder[(("block_" + j) + "_") + k];
_mc._visible = this.grid.elements[j][k] != BLANK;
_mc.block.gotoAndStop(this.grid.elements[j][k]);
k++;
}
j++;
}
};
Tetris.prototype.animate_falling_piece = function (method) {
var start = getTimer();
if (this.paused) {
return(undefined);
}
this.remove_falling_piece_imprint();
this.falling_piece[method]();
var penetration = this.contradicting_pieces();
if (penetration.bool) {
if (method == "move_down") {
this.falling_piece.move_up();
this.create_falling_piece_imprint();
var pos = this.check_type_explosion(this.falling_piece, 6);
if (pos != -1) {
this.grid.elements[pos.j][pos.k] = BLANK;
this.grid.elements[pos.j + 1][pos.k] = BLANK;
this.grid.elements[pos.j - 1][pos.k] = BLANK;
this.grid.elements[pos.j][pos.k + 1] = BLANK;
this.grid.elements[pos.j][pos.k - 1] = BLANK;
this.grid.elements[pos.j + 1][pos.k + 1] = BLANK;
this.grid.elements[pos.j - 1][pos.k + 1] = BLANK;
this.grid.elements[pos.j + 1][pos.k - 1] = BLANK;
this.grid.elements[pos.j - 1][pos.k - 1] = BLANK;
this.play_explode_cloud(pos.j, pos.k);
this.play_explode_cloud(pos.j + 1, pos.k);
this.play_explode_cloud(pos.j - 1, pos.k);
this.play_explode_cloud(pos.j, pos.k + 1);
this.play_explode_cloud(pos.j, pos.k - 1);
this.play_explode_cloud(pos.j + 1, pos.k + 1);
this.play_explode_cloud(pos.j - 1, pos.k + 1);
this.play_explode_cloud(pos.j + 1, pos.k - 1);
this.play_explode_cloud(pos.j - 1, pos.k - 1);
this.play_sound("adjacent_bomb");
this.score = this.score + (this.point_scores[0] * 9);
this.check_for_next_level();
}
var pos = this.check_type_explosion(this.falling_piece, 7);
if (pos != -1) {
var j = pos.j;
while (j >= 0) {
var k = 0;
while (k < this.grid_dim_x) {
if ((this.grid.elements[j][k] != BLANK) && (j == pos.j)) {
this.play_explode_cloud(j, k);
}
this.grid.elements[j][k] = this.grid.elements[j - 1][k];
if (j == 0) {
this.grid.elements[j][k] = BLANK;
}
k++;
}
j--;
}
this.play_sound("line_bomb");
this.score = this.score + (this.point_scores[0] * this.grid_dim_x);
this.check_for_next_level();
}
this.falling_piece = undefined;
this.remove_filled_lines();
this.current_frame = 0;
if (this.contradicting_pieces().bool) {
this.player_loses();
}
} else if (method == "move_left") {
this.falling_piece.move_right();
} else if (method == "move_right") {
this.falling_piece.move_left();
} else if (method == "rotate_counterclockwise") {
if (penetration.type == "wall") {
this.fix_rotated_piece(penetration, "rotate_clockwise");
} else {
this.falling_piece.rotate_clockwise();
}
} else if (method == "rotate_clockwise") {
if (penetration.type == "wall") {
this.fix_rotated_piece(penetration, "rotate_counterclockwise");
} else {
this.falling_piece.rotate_counterclockwise();
}
}
}
this.create_falling_piece_imprint();
if (!this.paused) {
this.render_grid();
}
};
Tetris.prototype.play_explode_cloud = function (j, k) {
var x = (this.upper_left_x + ((k + 0.5) * this.square_width));
var y = (this.upper_left_y + ((j + 0.5) * this.square_height));
this.timeline.attachMovie("explode_cloud", "cloud" + this.depth, this.depth++);
var _mc = this.timeline["cloud" + this.depth];
_mc._x = x;
_mc._y = y;
};
Tetris.prototype.check_type_explosion = function (p, t) {
var e = p.grid.elements;
var j = 0;
while (j < e.length) {
var k = 0;
while (k < e[j].length) {
var c = e[j][k];
if (c == t) {
return({j:j + p.position.j, k:k + p.position.k});
}
k++;
}
j++;
}
return(-1);
};
Tetris.prototype.quick_render = function () {
var _mc = undefined;
var start_x = this.falling_piece.position.k;
var start_y = this.falling_piece.position.j;
var dim_x = this.falling_piece.return_num_rows();
var dim_y = this.falling_piece.return_num_columns();
var j = start_y;
while (j < dim_y) {
var k = start_x;
while (k < dim_x) {
_mc = this.timeline.game_piece_holder[(("block_" + j) + "_") + k];
_mc._visible = this.grid.elements[j][k] != BLANK;
_mc.block.gotoAndStop(this.grid.elements[j][k]);
k++;
}
j++;
}
};
Tetris.prototype.fix_rotated_piece = function (initial_penetration, opposite_rotation) {
var meth = ((initial_penetration.side == "left") ? "move_right" : "move_left");
var j = 0;
while (j < initial_penetration.depth) {
this.falling_piece[meth]();
j++;
}
var penetration = this.contradicting_pieces();
if (penentration.bool) {
var opposite_meth = ((meth == "move_left") ? "move_right" : "move_left");
var k = 0;
while (k < initial_penetration.depth) {
this.falling_piece[opposite_meth]();
k++;
}
this.falling_piece[opposite_rotation]();
}
};
Tetris.prototype.key_pressed = function () {
if (Key.isDown(37)) {
this.animate_falling_piece("move_left");
} else if (Key.isDown(39)) {
this.animate_falling_piece("move_right");
} else if (Key.isDown(40)) {
this.current_frame = 1;
this.animate_falling_piece("move_down");
} else if (Key.isDown(38) || (Key.isDown(Key.S))) {
this.animate_falling_piece("rotate_counterclockwise");
} else if (Key.isDown(Key.A)) {
this.animate_falling_piece("rotate_clockwise");
} else if (Key.isDown(32)) {
if (this.num_bombs > 0) {
this.num_bombs--;
var j = (this.grid_dim_y - 1);
while (j >= 0) {
var k = 0;
while (k < this.grid_dim_x) {
if ((this.grid.elements[j][k] != BLANK) && (j == (this.grid_dim_y - 1))) {
this.play_explode_cloud(j, k);
}
this.grid.elements[j][k] = this.grid.elements[j - 1][k];
if (j == 0) {
this.grid.elements[j][k] = BLANK;
}
k++;
}
j--;
}
this.falling_piece.position.j++;
this.play_sound("cherrybomb");
this.score = this.score + (this.point_scores[0] * this.grid_dim_x);
this.check_for_next_level();
}
}
};
Tetris.prototype.contradicting_pieces = function () {
var start_j = this.falling_piece.position.j;
var start_k = this.falling_piece.position.k;
var rows = this.falling_piece.return_num_rows();
var columns = this.falling_piece.return_num_columns();
var piece_grid = this.falling_piece.grid;
var penetration = {};
penetration.type = undefined;
penetration.penetration_depth = 0;
penetration.bool = false;
penetration.points = new Array();
var j = start_j;
while (j < (start_j + rows)) {
var k = start_k;
while (k < (start_k + columns)) {
var _j = (j - start_j);
var _k = (k - start_k);
if (((this.grid.elements[j][k] != BLANK) && (this.grid.elements[j][k] != undefined)) && (piece_grid.elements[_j][_k] != BLANK)) {
penetration.bool = true;
penetration.points.push(new Indices(_j, _k));
penetration.type = "piece";
} else if (this.grid.elements[j][k] == undefined) {
penetration.bool = true;
penetration.points.push(new Indices(_j, _k));
penetration.type = "wall";
}
k++;
}
j++;
}
var side_bool = true;
var n = 0;
while (n < penetration.points.length) {
if (penetration.points[n].k > (this.falling_piece.return_num_columns() / 2)) {
side_bool = false;
}
n++;
}
penetration.side = (side_bool ? "left" : "right");
var max_index = penetration.points.return_maximum("k");
var min_index = penetration.points.return_minimum("k");
penetration.depth = ((penetration.side == "left") ? (max_index + 1) : (this.falling_piece.return_num_columns() - penetration.points[min_index].k));
return(penetration);
};
Tetris.prototype.remove_filled_lines = function () {
var blank_spot = false;
var blank_line = true;
this.possible_score = 0;
this.num_lines_shifted = 0;
this.lines_shifted = new Array();
this.point_scored = false;
var num_explosive_found = 0;
var j = (this.grid_dim_y - 1);
while (j >= 0) {
blank_spot = false;
blank_line = true;
num_explosive_found = 0;
var k = 0;
while (k < this.grid_dim_x) {
if (this.grid.elements[j][k] == BLANK) {
blank_spot = true;
} else {
blank_line = false;
}
if (this.grid.elements[j][k] == 8) {
num_explosive_found++;
}
k++;
}
if (!blank_spot) {
this.lines_shifted.push(j);
this.num_lines_shifted++;
this.num_bombs = this.num_bombs + num_explosive_found;
}
if (blank_line) {
j = -1;
}
j--;
}
var i = 0;
while (i < this.explosive_lines.length) {
if (this.explosive_lines[i]) {
var j = this.lines_shifted[i];
var k = 0;
while (k < this.grid_dim_x) {
k++;
}
}
i++;
}
this.score = this.score + ((this.point_scores[0] * this.num_lines_shifted) * this.grid_dim_x);
this.check_for_next_level();
if (this.num_lines_shifted >= 3) {
this.timeline.all_fireworks.gotoAndPlay(1);
} else if (this.num_lines_shifted > 0) {
this.play_sound("line_remove" + Math.randi(0, 4));
}
this.play_block_animations();
if ((this.mode == "With Quiz") && (this.point_scored)) {
this.create_quiz();
} else if ((this.mode == "No Quiz") && (this.point_scored)) {
this.score = this.score + this.possible_score;
this.timeline.score_board.score_display = this.score;
this.check_for_next_level();
} else if ((!this.point_scored) && (this.lines_shifted.length == 0)) {
this.create_falling_piece();
}
this.check_for_next_level();
};
Tetris.prototype.play_block_animations = function (j, nls) {
this.paused = this.lines_shifted.length != 0;
var n = 0;
while (n < this.lines_shifted.length) {
var j = this.lines_shifted[n];
var k = 0;
while (k < this.grid_dim_x) {
var _mc = this.timeline.game_piece_holder[(("block_" + j) + "_") + k];
_mc.gotoAndPlay(this.block_animation);
this.update_score(this.grid.elements[j][k]);
k++;
}
n++;
}
};
Tetris.prototype.update_score = function (block_ID) {
if (block_ID == REGULAR_BLOCK) {
return(true);
}
this.point_scored = true;
this.possible_score = this.possible_score + this.point_scores[block_ID - 2];
};
Tetris.prototype.check_for_next_level = function () {
var possible_level = Math.floor(this.score / this.num_points_next_level);
if (possible_level != this.level) {
this.level = possible_level;
this.current_delay = Math.max(this.minimum_delay, this.current_delay - (this.level * this.delta_delay));
this.timeline.level_display.level = this.level + 1;
this.load_background();
}
};
Tetris.prototype.shift_pieces_down = function () {
var time = getTimer();
if ((time - this.last_called) < 1000) {
return(undefined);
}
this.last_called = time;
var i = 0;
while (i < this.lines_shifted.length) {
var index = ((this.lines_shifted.length - i) - 1);
var n = this.lines_shifted[index];
var j = n;
while (j >= 0) {
var k = 0;
while (k < this.grid_dim_x) {
if (j == 0) {
this.grid.elements[j][k] = BLANK;
} else {
this.grid.elements[j][k] = this.grid.elements[j - 1][k];
}
k++;
}
j--;
}
i++;
}
if (this.mode == "No Quiz") {
this.create_falling_piece();
this.create_falling_piece_imprint();
this.render_grid();
this.paused = false;
} else if ((this.mode == "With Quiz") && (!this.point_scored)) {
this.create_falling_piece();
this.create_falling_piece_imprint();
this.render_grid();
this.paused = false;
} else if ((this.mode == "With Quiz") && (this.point_scored)) {
this.render_grid();
}
};
Tetris.prototype.load_background = function () {
if (this.backgrounds.length == 0) {
return(undefined);
}
this.timeline.background_pictures.loadMovie(this.backgrounds[this.level % this.backgrounds.length]);
};
Tetris.prototype.place_falling_piece = function () {
this.remove_falling_piece_imprint();
var j = 0;
while (j < this.grid_dim_y) {
this.falling_piece.move_down();
if (this.contradicting_pieces().bool) {
this.falling_piece.move_up();
this.create_falling_piece_imprint();
return(undefined);
}
j++;
}
};
Tetris.prototype.create_quiz = function () {
this.paused = true;
if (this.quiz.questions.length == 0) {
this.timeline.controller.get_quiz_data();
}
var index = Math.randi(0, this.quiz.questions.length);
var question = this.quiz.questions[index];
this.quiz.questions.splice(index, 1);
this.timeline.quiz_prompt.play();
this.timeline.quiz_prompt.question = question.question_text;
var j = 0;
while (j < question.choices.length) {
var choice_mc = this.timeline.quiz_prompt["choice" + j];
choice_mc.index = String.fromCharCode(65 + j);
choice_mc.field = question.choices[j];
choice_mc.correct = (ord(question.answer) - 97) == j;
j++;
}
};
Tetris.prototype.quiz_finished = function (num_guesses) {
if (num_guesses == 0) {
this.score = this.score + this.possible_score;
this.check_for_next_level();
this.timeline.score_board.score_display = this.score;
}
this.create_falling_piece();
this.create_falling_piece_imprint();
this.render_grid();
this.paused = false;
};
Tetris.prototype.player_loses = function () {
var j = 0;
while (j < this.songs.length) {
this.timeline.audio_control["_level" + (5000 + j)].stop();
j++;
}
_root.score = this.score;
_root.gotoAndStop("Game Over");
};
Tetris.prototype.mouse_click = function () {
if (this.paused && (this.timeline.prompt.hitTest(_root._xmouse, _root._ymouse, true))) {
this.timeline.prompt.play();
for (var j in this.timeline) {
if (typeof(this.timeline[j])) {
this.timeline[j].removeMovieClip();
}
}
this.initialize();
}
};
Tetris.prototype.manage_songs = function () {
if (this.songs.length == 0) {
return(undefined);
}
if (this.playlist == undefined) {
this.create_playlist();
}
var current_level = this.timeline["_level" + this.playlist[0].load_level];
var next_level = this.timeline["_level" + this.playlist[1].load_level];
if (((current_level.getBytesLoaded() == current_level.getBytesTotal()) && (current_level.getBytesLoaded() != undefined)) && (current_level._currentframe == 1)) {
current_level.play();
} else if (current_level.getBytesLoaded() != current_level.getBytesTotal()) {
current_level.gotoAndStop(1);
}
next_level.stop();
if ((current_level._currentframe == current_level._totalframes) && (current_level._currentframe != undefined)) {
unloadMovieNum (this.playlist[0].load_level);
this.playlist.shift();
if (this.playlist.length == 0) {
this.playlist = undefined;
} else if (this.playlist.length != 1) {
if (this.playlist[1].load_level != undefined) {
loadMovieNum (this.playlist[1].url, this.playlist[1].load_level);
}
}
}
};
Tetris.prototype.create_playlist = function () {
this.playlist = new Array();
var j = 0;
while (j < this.songs.length) {
this.playlist[j] = {url:this.songs[j], load_level:5000 + j};
j++;
}
this.playlist.shuffle();
if (this.playlist[0].load_level != undefined) {
loadMovieNum (this.playlist[0].url, this.playlist[0].load_level);
}
if (this.playlist[1].load_level != undefined) {
loadMovieNum (this.playlist[1].url, this.playlist[1].load_level);
}
};
Tetris.prototype.evaluate_answer = function (choice_mc) {
if (choice_mc.correct) {
this.quiz_finished(0);
this.timeline.quiz_prompt.gotoAndPlay("Correct");
} else {
this.quiz_finished(1);
this.timeline.quiz_prompt.gotoAndPlay("Incorrect");
}
this.paused = true;
};
Tetris.prototype.answer_prompt_done = function () {
this.paused = false;
};
Tetris.prototype.play_sound = function (linkage) {
var _sound = new Sound();
_sound.attachSound(linkage);
_sound.start(0, 1);
};
game = new Tetris();
Instance of Symbol 227 MovieClip "controller" in Symbol 278 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
get_quiz_data = function () {
_parent.game.quiz = new QuizClass(num_quiz_questions, num_quiz_choices);
var j = 0;
while (j < num_quiz_questions) {
var choices = new Array();
var k = 0;
while (k < num_quiz_choices) {
choices[k] = this[(("quiz_answer" + j) + "_") + chr(k + 97)];
k++;
}
var question = new QuestionClass(this["quiz_question" + j], this["closing_statement" + j], this["quiz_answer" + j], choices);
_parent.game.quiz.questions.push(question);
j++;
}
};
}
onClipEvent (data) {
get_quiz_data();
}
onClipEvent (mouseDown) {
_parent.game.mouse_click();
}
onClipEvent (keyDown) {
_parent.game.key_pressed();
}
onClipEvent (enterFrame) {
_parent.game.action();
}
Instance of Symbol 254 MovieClip "quiz_prompt" in Symbol 278 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(5000);
}
Symbol 287 Button
on (press) {
_root.gotoAndStop("Starting Screen");
}
Symbol 301 Button
on (press) {
this.gotoAndStop("weekly");
}
Symbol 302 Button
on (press) {
this.gotoAndStop("daily");
}
Symbol 303 Button
on (press) {
this.gotoAndStop("hourly");
}
Symbol 306 Button
on (press) {
this.gotoAndStop("monthly");
}
Symbol 311 Button
on (press) {
this.gotoAndStop("daily");
}
Symbol 314 MovieClip Frame 1
this._parent.tp = 2592000 /* 0x278D00 */;
this._parent.tc = 0;
this._parent.reload();
stop();
Symbol 314 MovieClip Frame 2
this._parent.tp = 604800 /* 0x093A80 */;
this._parent.tc = 0;
this._parent.reload();
Symbol 314 MovieClip Frame 3
this._parent.tp = 86400 /* 0x015180 */;
this._parent.tc = 0;
this._parent.reload();
Symbol 314 MovieClip Frame 4
this._parent.tp = 3600;
this._parent.tc = 0;
this._parent.reload();
Symbol 321 Button
on (press) {
this.tc--;
this.reload();
}
Symbol 326 Button
on (press) {
this.tc = ((this.tc < 0) ? (this.tc + 1) : 0);
this.reload();
}
Symbol 329 Button
on (press) {
if (this.submitted == false) {
this.loadVariables((((this.__url + "hof_put.php?id=") + this.gid) + "&s=") + this.sc);
}
}
Symbol 333 Button
on (press) {
this._parent.l = 10;
this._parent.reload();
this.gotoAndStop(2);
}
Symbol 336 Button
on (press) {
this._parent.l = 100;
this._parent.reload();
this.gotoAndStop(1);
}
Symbol 337 MovieClip Frame 1
stop();
Symbol 350 MovieClip Frame 1
stop();
Symbol 350 MovieClip Frame 18
stop();
Symbol 354 MovieClip Frame 1
function reset() {
this.m._x = this.s._x;
this.m._y = this.s._y;
}
function scroll(p) {
this._parent.rolki.f1.scroll = (this._parent.rolki.f2.scroll = (this._parent.rolki.f3.scroll = (this._parent.rolki.f4.scroll = int((this.mx * p) / 100))));
}
this.onEnterFrame = function () {
this.s._y = ((this.m._y > 5) ? (((this.m._y < 202) ? (this.m._y) : 202)) : 5);
this.mx = this._parent.rolki.f1.maxscroll;
scroll((100 * (this.s._y - 5)) / 197);
};
Instance of Symbol 353 MovieClip "m" in Symbol 354 MovieClip Frame 1
on (press) {
this.startDrag();
}
on (release, releaseOutside) {
this.stopDrag();
this._parent.reset();
}
Symbol 359 MovieClip Frame 1
this._visible = _root.ligin == undefined;
this.onPress = function () {
getURL ("http://www.netstupidity.com");
};
Symbol 360 MovieClip Frame 1
this.submitted = false;
Symbol 360 MovieClip Frame 2
function reload() {
if (this.rolki._currentframe > 1) {
this.rolki.gotoAndPlay(18);
}
var te = ((-this.tc) * this.tp);
var tb = ((-(this.tc - 1)) * this.tp);
this.loadVariables((((((((((this.__url + "hof_get.php?id=") + this.gid) + "&n=") + this.l) + "&tb=") + tb) + "&te=") + te) + "&s=") + this.sc);
}
this.uu = _root._url;
this.gid = _root.gid;
this.__url = _root.__url;
this.l = 10;
this.sc = eval (this.scr);
if (int(this.sc) > int(_root.bsc)) {
_root.bsc = this.sc;
}
this.onData = function () {
if (this.r == 1) {
this.rolki.gotoAndPlay(2);
clearInterval(this._itr);
return(undefined);
}
if (this.r == "3") {
this.submitted = true;
reload();
}
if (this.r == "2") {
getURL ("javascript:if(confirm('To submit Your score You have to be logged into netstupidity.com site. Do You wish to log in now?')) window.open('http://www.netstupidity.com/login.php'); void(0);");
}
};
stop();
Symbol 367 MovieClip Frame 40
stop();
Symbol 374 MovieClip Frame 1
stop();
Symbol 386 MovieClip Frame 1
stop();
Symbol 386 MovieClip Frame 2
stop();
Symbol 386 MovieClip Frame 10
stop();
Symbol 386 MovieClip Frame 24
stop();
Symbol 386 MovieClip Frame 43
stop();
Symbol 386 MovieClip Frame 56
stop();
Symbol 386 MovieClip Frame 66
stop();
Symbol 386 MovieClip Frame 77
stop();
Symbol 395 Button
on (release) {
_root.eyeland_hs_p = _parent.nameholder.name;
_root.eyeland_hs_e = _parent.emailholder.email;
_parent.gotoAndPlay("save");
}
Symbol 398 Button
on (release) {
_parent.gotoAndPlay("load");
}
Symbol 413 MovieClip Frame 1
stop();
Symbol 413 MovieClip Frame 2
stop();
Symbol 413 MovieClip Frame 12
stop();
Symbol 413 MovieClip Frame 22
stop();
Symbol 413 MovieClip Frame 32
stop();
Symbol 413 MovieClip Frame 42
stop();
Symbol 413 MovieClip Frame 52
stop();
Symbol 413 MovieClip Frame 62
stop();
Symbol 413 MovieClip Frame 72
stop();
Symbol 413 MovieClip Frame 82
stop();
Symbol 413 MovieClip Frame 92
stop();
Symbol 413 MovieClip Frame 102
stop();
Symbol 413 MovieClip Frame 113
stop();
Symbol 416 Button
on (release) {
_root._quality = _root.eyeland_hs_quality;
_parent._parent.play();
}
Symbol 419 MovieClip Frame 1
stop();
Symbol 419 MovieClip Frame 2
stop();
Symbol 419 MovieClip Frame 3
stop();
Symbol 421 MovieClip Frame 1
stop();
Symbol 421 MovieClip Frame 2
stop();
Symbol 451 MovieClip Frame 1
stop();
Symbol 451 MovieClip Frame 25
stop();
Symbol 451 MovieClip Frame 47
stop();
Symbol 451 MovieClip Frame 66
stop();
Symbol 451 MovieClip Frame 82
stop();
Symbol 451 MovieClip Frame 102
stop();
Instance of Symbol 451 MovieClip "line" in Symbol 452 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "line") {
this._visible = false;
}
}
Symbol 456 Button
on (press) {
if (!_parent._parent.script.draggable) {
return(undefined);
}
this.startDrag(false, _parent._parent.script.dragx, _parent._parent.script.topdragy, _parent._parent.script.dragx, _parent._parent.script.topdragy + _parent._parent.script.dragheight);
_parent._parent.script.drag = true;
}
on (release) {
if (!_parent._parent.script.draggable) {
return(undefined);
}
this.stopDrag();
_parent._parent.script.drag = false;
}
Symbol 460 Button
on (press) {
_parent._parent.script.pressup = (_parent._parent.script.moveup = true);
}
on (release) {
_parent._parent.script.pressup = false;
}
Symbol 463 Button
on (press) {
_parent._parent.script.pressdown = (_parent._parent.script.movedown = true);
}
on (release) {
_parent._parent.script.pressdown = false;
}
Symbol 469 Button
on (release) {
btn_press();
}
Symbol 481 MovieClip Frame 1
function rand_str() {
var out = "";
var len = 10;
var alpha = "abcdefghijklmnopqrstuvwxyz";
var n = 0;
while (n < len) {
out = out + alpha.charAt(Math.floor(Math.random() * alpha.length));
n++;
}
return(out);
}
function rhex(num) {
str = "";
j = 0;
while (j <= 3) {
str = str + (hex_chr.charAt((num >> ((j * 8) + 4)) & 15) + hex_chr.charAt((num >> (j * 8)) & 15));
j++;
}
return(str);
}
function str2blks_MD5(str) {
nblk = ((str.length + 8) >> 6) + 1;
blks = new Array(nblk * 16);
i = 0;
while (i < (nblk * 16)) {
blks[i] = 0;
i++;
}
i = 0;
while (i < str.length) {
blks[i >> 2] = blks[i >> 2] | (str.charCodeAt(i) << ((i % 4) * 8));
i++;
}
blks[i >> 2] = blks[i >> 2] | (128 << ((i % 4) * 8));
blks[(nblk * 16) - 2] = str.length * 8;
return(blks);
}
function add2(x, y) {
var lsw = ((x & 65535) + (y & 65535));
var msw = (((x >> 16) + (y >> 16)) + (lsw >> 16));
return((msw << 16) | (lsw & 65535));
}
function rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function cmn(q, a, b, x, s, t) {
return(add2(rol(add2(add2(a, q), add2(x, t)), s), b));
}
function ff(a, b, c, d, x, s, t) {
return(cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
function gg(a, b, c, d, x, s, t) {
return(cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
function hh(a, b, c, d, x, s, t) {
return(cmn((b ^ c) ^ d, a, b, x, s, t));
}
function ii(a, b, c, d, x, s, t) {
return(cmn(c ^ (b | (~d)), a, b, x, s, t));
}
function calcMD5(str) {
x = str2blks_MD5(str);
a = 1732584193 /* 0x67452301 */;
b = -271733879;
c = -1732584194;
d = 271733878 /* 0x10325476 */;
i = 0;
while (i < x.length) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
a = ff(a, b, c, d, x[i + 0], 7, -680876936);
d = ff(d, a, b, c, x[i + 1], 12, -389564586);
c = ff(c, d, a, b, x[i + 2], 17, 606105819);
b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = ff(a, b, c, d, x[i + 4], 7, -176418897);
d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = ff(b, c, d, a, x[i + 7], 22, -45705983);
a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = ff(c, d, a, b, x[i + 10], 17, -42063);
b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = ff(d, a, b, c, x[i + 13], 12, -40341101);
c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = gg(a, b, c, d, x[i + 1], 5, -165796510);
d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = gg(c, d, a, b, x[i + 11], 14, 643717713);
b = gg(b, c, d, a, x[i + 0], 20, -373897302);
a = gg(a, b, c, d, x[i + 5], 5, -701558691);
d = gg(d, a, b, c, x[i + 10], 9, 38016083);
c = gg(c, d, a, b, x[i + 15], 14, -660478335);
b = gg(b, c, d, a, x[i + 4], 20, -405537848);
a = gg(a, b, c, d, x[i + 9], 5, 568446438);
d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = gg(c, d, a, b, x[i + 3], 14, -187363961);
b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = gg(d, a, b, c, x[i + 2], 9, -51403784);
c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = hh(a, b, c, d, x[i + 5], 4, -378558);
d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = hh(b, c, d, a, x[i + 14], 23, -35309556);
a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = hh(c, d, a, b, x[i + 7], 16, -155497632);
b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = hh(a, b, c, d, x[i + 13], 4, 681279174);
d = hh(d, a, b, c, x[i + 0], 11, -358537222);
c = hh(c, d, a, b, x[i + 3], 16, -722521979);
b = hh(b, c, d, a, x[i + 6], 23, 76029189);
a = hh(a, b, c, d, x[i + 9], 4, -640364487);
d = hh(d, a, b, c, x[i + 12], 11, -421815835);
c = hh(c, d, a, b, x[i + 15], 16, 530742520);
b = hh(b, c, d, a, x[i + 2], 23, -995338651);
a = ii(a, b, c, d, x[i + 0], 6, -198630844);
d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = ii(b, c, d, a, x[i + 5], 21, -57434055);
a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = ii(c, d, a, b, x[i + 10], 15, -1051523);
b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = ii(d, a, b, c, x[i + 15], 10, -30611744);
c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = ii(a, b, c, d, x[i + 4], 6, -145523070);
d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = ii(c, d, a, b, x[i + 2], 15, 718787259);
b = ii(b, c, d, a, x[i + 9], 21, -343485551);
a = add2(a, olda);
b = add2(b, oldb);
c = add2(c, oldc);
d = add2(d, oldd);
i = i + 16;
}
return(((rhex(a) + rhex(b)) + rhex(c)) + rhex(d));
}
var hex_chr = "0123456789abcdef";
_root.eyeland_hs_quality = _root._quality;
_root._quality = "HIGH";
_parent.stop();
stop();
Instance of Symbol 368 MovieClip "loader" in Symbol 481 MovieClip Frame 1
onClipEvent (load) {
if ((((_root.eyeland_hs_highscore_url == undefined) || (_root.eyeland_hs_game_id == undefined)) || (_root.eyeland_hs_score_variable == undefined)) || (_root.eyeland_hs_button_label == undefined)) {
trace("== GIAF HS ERROR == Highscore variables not found. Use the \"giaf hs settings\" component on a scene prior to this one to set the highscore variables correctly.");
}
if (_root[_root.eyeland_hs_score_variable] == undefined) {
trace(("== GIAF HS ERROR == Highscore variable \"_root." + _root.eyeland_hs_score_variable) + "\" not set. Please adjust your game's code to make sure this score variable is set before attempting to save it to the server. Use the \"giaf hs settings\" component to set the name of the score variable.");
}
_parent.highscore_url = _root.eyeland_hs_highscore_url;
_parent.game_id = _root.eyeland_hs_game_id;
_parent.score_variable = _root.eyeland_hs_score_variable;
_parent.button_label = _root.eyeland_hs_button_label;
var score = _root[_parent.score_variable];
loadVariables ((((((_parent.highscore_url + "?action=check&id=") + _parent.game_id) + "&score=") + score) + "&rand=") + Math.round(Math.random() * 999999999), this);
}
onClipEvent (data) {
_root.eyeland_hs_result = result;
_root.eyeland_hs_lowscore = lowscore;
_root.eyeland_hs_recordplayeremail = recordplayeremail;
_root.eyeland_hs_emailpromptmessage = unescape(emailpromptmessage);
_root.eyeland_hs_maxchars = Number(maxchars);
_parent.gotoAndPlay("enter");
}
Symbol 481 MovieClip Frame 12
btn_submit._visible = false;
btn_skip._visible = false;
btn_scores._visible = false;
btn_scores._y = btn_submit._y;
btn_playagain._visible = false;
btn_playagain._y = btn_skip._y;
if (_root.eyeland_hs_result == "yes") {
btn_submit._visible = true;
btn_skip._visible = true;
if (_root.eyeland_hs_maxchars > 0) {
nameholder.gotoAndPlay("name" + _root.eyeland_hs_maxchars);
if (_root.eyeland_hs_recordplayeremail == "yes") {
enter_screens.gotoAndPlay("enter_email");
enter_screens.emailpromptmessage = _root.eyeland_hs_emailpromptmessage;
emailholder._y = 40.8;
emailholder.gotoAndPlay("field");
} else {
enter_screens.gotoAndPlay("enter");
}
if (_root.eyeland_hs_maxchars == 3) {
enter_screens.name_label.gotoAndStop(2);
}
} else if (_root.eyeland_hs_recordplayeremail == "yes") {
enter_screens.gotoAndPlay("enter_email_only");
enter_screens.emailpromptmessage = _root.eyeland_hs_emailpromptmessage;
emailholder._y = 20.8;
emailholder.gotoAndPlay("field");
} else {
enter_screens.gotoAndPlay("noname");
}
} else {
btn_scores._visible = true;
btn_playagain._visible = true;
enter_screens.gotoAndPlay("low_score");
enter_screens.low_score_message = ("Score over " + _root.eyeland_hs_lowscore) + " points to get onto the High Score table!";
}
stop();
Instance of Symbol 419 MovieClip "btn_playagain" in Symbol 481 MovieClip Frame 12
onClipEvent (load) {
if (_parent.button_label == "Play Again") {
gotoAndPlay (2);
} else if (_parent.button_label == "Continue") {
gotoAndPlay (3);
}
}
Instance of Symbol 368 MovieClip in Symbol 481 MovieClip Frame 12
onClipEvent (load) {
_parent.score1 = (_parent.score2 = _root[_parent.score_variable]);
}
Symbol 481 MovieClip Frame 22
stop();
Instance of Symbol 368 MovieClip "copy_to_root" in Symbol 481 MovieClip Frame 22
onClipEvent (data) {
_root.eyeland_hs_players = new Array();
_root.eyeland_hs_scores = new Array();
_root.eyeland_hs_dates = new Array();
_root.eyeland_hs_maxscores = this.maxscores;
_root.eyeland_hs_current = this.current;
_root.eyeland_hs_showdate = this.showdate;
_root.eyeland_hs_cleardate = this.cleardate;
_root.eyeland_hs_emailtofriend = this.emailtofriend;
var n = 0;
while (n < numscores) {
_root.eyeland_hs_players.push(unescape(this["p" + n]));
_root.eyeland_hs_scores.push(this["s" + n]);
_root.eyeland_hs_dates.push(unescape(this["d" + n]));
n++;
}
_parent.gotoAndPlay("show");
}
Instance of Symbol 368 MovieClip in Symbol 481 MovieClip Frame 22
onClipEvent (load) {
var score = _root[_parent.score_variable];
var url = ((((_parent.highscore_url + "?action=get&id=") + _parent.game_id) + "&rand=") + Math.round(Math.random() * 999999999));
loadVariables (url, _parent.copy_to_root);
}
Symbol 481 MovieClip Frame 31
stop();
Instance of Symbol 368 MovieClip in Symbol 481 MovieClip Frame 31
onClipEvent (load) {
var score = _root[_parent.score_variable];
var rand = _parent.rand_str();
var url = ((((((((((((_parent.highscore_url + "?action=set&id=") + _parent.game_id) + "&player=") + escape(_root.eyeland_hs_p)) + "&score=") + score) + "&email=") + escape(_root.eyeland_hs_e)) + "&rand=") + rand) + "&rand2=") + _parent.calcMD5(rand + "...you shall not pass"));
loadVariables (url, _parent.copy_to_root);
}
Symbol 481 MovieClip Frame 40
if (_root.eyeland_hs_emailtofriend == "no") {
chbutton._visible = false;
}
stop();
Instance of Symbol 419 MovieClip "playagain" in Symbol 481 MovieClip Frame 40
onClipEvent (load) {
if (_parent.button_label == "Play Again") {
this.gotoAndPlay(2);
} else {
this.gotoAndPlay(3);
}
}
Instance of Symbol 471 MovieClip "chbutton" in Symbol 481 MovieClip Frame 40
onClipEvent (load) {
function btn_press() {
_parent.gotoAndPlay("chform");
}
}
Instance of Symbol 368 MovieClip "script" in Symbol 481 MovieClip Frame 40
onClipEvent (load) {
var topliney = _parent.showbg.list.line._y;
var topdragy = _parent.showbg.dragger._y;
var dragx = _parent.showbg.dragger._x;
var dragheight = 73;
var fieldheight = 167.2;
var maxdragamount = (-fieldheight);
var drag = ((dragonce = false));
var pressup = ((moveup = (pressdown = (movedown = false))));
var linedist = 0;
var curr_dist = 0;
var draggable = false;
_parent.showbg.dragger._alpha = 30;
_parent.showbg.up._alpha = 30;
_parent.showbg.down._alpha = 30;
if (_root.eyeland_hs_cleardate != "00/00/00") {
_parent.clearedmsg = "Scores cleared " + _root.eyeland_hs_cleardate;
}
var n = 0;
while (n < _root.eyeland_hs_maxscores) {
_parent.showbg.list.line.duplicateMovieClip("l" + n, n);
var obj = _parent.showbg.list["l" + n];
if (n != _root.eyeland_hs_current) {
obj.flashbox._visible = false;
}
if (_root.eyeland_hs_showdate == "yes") {
if (_root.eyeland_hs_maxchars > 0) {
obj.gotoAndPlay("name_score_date");
} else {
obj.gotoAndPlay("score_date");
}
} else if (_root.eyeland_hs_maxchars == 0) {
obj.gotoAndPlay("score_only");
}
obj._y = obj._y + curr_dist;
obj.number = (n + 1) + ".";
if (n < _root.eyeland_hs_players.length) {
obj.player = ((_root.eyeland_hs_players[n] == "") ? "anonymous" : (_root.eyeland_hs_players[n]));
obj.score = _root.eyeland_hs_scores[n];
obj.date = _root.eyeland_hs_dates[n];
if (obj.player.maxscroll > 1) {
if (_root.eyeland_hs_showdate == "yes") {
obj.gotoAndPlay("name_score_date_tall");
} else {
obj.gotoAndPlay("name_score_tall");
}
}
} else {
obj.anonymous._visible = false;
obj.player = "";
obj.score = "0";
obj.date = "";
}
curr_dist = curr_dist + obj.flashbox._height;
maxdragamount = maxdragamount + obj.flashbox._height;
if (n == (_root.eyeland_hs_maxscores - 1)) {
obj.hline._visible = false;
}
n++;
}
var bobj = _parent.showbg.list["l" + (_root.eyeland_hs_players.length - 1)];
if (maxdragamount > 0) {
var draggable = true;
_parent.showbg.dragger._alpha = 100;
_parent.showbg.up._alpha = 100;
_parent.showbg.down._alpha = 100;
} else {
var draggable = false;
}
_parent.playagain._alpha = 100;
}
onClipEvent (enterFrame) {
if (moveup && (draggable)) {
_parent.showbg.dragger._y = Math.max(_parent.showbg.dragger._y - 2, topdragy);
dragonce = true;
}
if (!pressup) {
moveup = false;
}
if (movedown && (draggable)) {
_parent.showbg.dragger._y = Math.min(_parent.showbg.dragger._y + 2, topdragy + dragheight);
dragonce = true;
}
if (!pressdown) {
movedown = false;
}
if (drag || (dragonce)) {
linedist = ((_parent.showbg.dragger._y - topdragy) / dragheight) * maxdragamount;
if ((_parent.showbg.dragger._y - topdragy) < 1) {
linedist = 0;
}
if ((_parent.showbg.dragger._y - topdragy) > (dragheight - 1)) {
linedist = maxdragamount;
}
_parent.showbg.list.l0._y = topliney - linedist;
var n = 1;
while (n < _root.eyeland_hs_maxscores) {
_parent.showbg.list["l" + n]._y = _parent.showbg.list["l" + (n - 1)]._y + _parent.showbg.list["l" + (n - 1)].flashbox._height;
n++;
}
dragonce = false;
}
}
Symbol 481 MovieClip Frame 49
message = ("You scored " + _root[score_variable]) + " points! To challenge a friend to beat your score, enter their email address in the field below and click CHALLENGE!";
stop();
Instance of Symbol 478 MovieClip in Symbol 481 MovieClip Frame 49
onClipEvent (load) {
function btn_press() {
_parent.gotoAndPlay("show");
}
}
Instance of Symbol 480 MovieClip in Symbol 481 MovieClip Frame 49
onClipEvent (load) {
function btn_press() {
_root.eyeland_hs_friendemail = _parent.friendemail;
_root.eyeland_hs_yourname = _parent.yourname;
_parent.gotoAndPlay("challenge");
}
}
Symbol 481 MovieClip Frame 60
stop();
Instance of Symbol 368 MovieClip "challenge_handler" in Symbol 481 MovieClip Frame 60
onClipEvent (data) {
_parent.gotoAndPlay("show");
}
Instance of Symbol 368 MovieClip in Symbol 481 MovieClip Frame 60
onClipEvent (load) {
var score = _root[_parent.score_variable];
var id = _parent.game_id;
var friend = escape(_root.eyeland_hs_friendemail);
var yourname = escape(_root.eyeland_hs_yourname);
var url = ((((((((((_parent.highscore_url + "?action=challenge&id=") + id) + "&friend=") + friend) + "&yourname=") + yourname) + "&score=") + score) + "&rand=") + Math.round(Math.random() * 999999999));
loadVariables (url, _parent.challenge_handler);
}