Frame 1
fscommand ("showmenu", "false");
stop();
downloadUrl = "http://v2.arkadium.com/affiliates/request.aspx?referrer=" + _url;
Instance of Symbol 38 MovieClip in Frame 1
onClipEvent (enterFrame) {
numTotal = _root.getBytesTotal();
numLoaded = _root.getBytesLoaded();
numPercent = Math.floor((numLoaded * 100) / numTotal);
if (numPercent < 10) {
strL = "0" + numPercent;
} else {
strL = numPercent;
}
_root.strLoaded = strL + "%";
if (numPercent >= 99) {
_root.play();
}
}
Frame 2
stop();
Frame 3
stop();
Instance of Symbol 95 MovieClip "door" in Frame 3
onClipEvent (enterFrame) {
if (Math.floor(getTimer() / 1000) == 15) {
this.play();
}
}
Frame 6
function getRandomValue(max) {
Result = random(max);
return(Result);
}
num_score = 0;
gameTotalTime = 90;
function setup_sounds() {
drop_sound = new Sound();
remove_sound = new Sound();
warning_sound = new Sound();
benben_sound = new Sound();
benben_sound.attachSound("benben");
warning_sound.attachSound("warning");
remove_sound.attachSound("alu_remove");
drop_sound.attachSound("alu_drop");
}
function initialize_level() {
level_x = num_x;
num_rows = arr_row[num_level - 1];
level_y = num_y - (num_gap * (num_rows - 1));
level_time_fall = arr_time_fall[num_level - 1];
num_count = 10;
num_fall = num_rows;
bln_remove = true;
num_benben_stone = random(60) + 30;
build_mattrix();
}
function setup_level_string() {
if (num_level == 1) {
str_level = "round one";
str_total_score = "";
} else if (num_level == 2) {
str_level = "round two";
str_total_score = "";
} else if (num_level == 3) {
str_level = "round three";
str_total_score = "";
} else if (num_level == 4) {
str_level = "round four";
str_total_score = "";
} else if (num_level == 5) {
str_level = "round five";
str_total_score = "";
} else if (num_level == 6) {
str_level = "round six";
str_total_score = "";
} else {
str_level = "game over";
str_total_score = "total score " + num_score;
bln_game_over = true;
}
}
function start_level() {
bln_end_level = false;
mc_timer.gotoAndStop(1);
str_round = num_level;
initialize_level();
show_guys();
no_matches.gotoAndStop(1);
}
function end_level(num_mask) {
bln_end_level = true;
no_matches._x = 273;
no_matches.play();
num_level++;
setup_level_string();
}
function end_game() {
str_level = "game over";
str_total_score = "total score " + num_score;
bln_end = true;
bln_game_over = true;
remove_all();
str_total_score = "total score " + num_score;
mc_message._y = 180;
mc_message.gotoAndPlay(1);
mc_checker.gotoAndStop(1);
}
function remove_all() {
i = 0;
while (i < matrix.length) {
n = 0;
while (n < matrix[i].length) {
if ((matrix[i][n] != "empty") && (bln_end != true)) {
_root[matrix[i][n]].new.gotoAndPlay(10);
} else {
_root[matrix[i][n]].new.gotoAndPlay(10);
}
n++;
}
i++;
}
}
function build_mattrix() {
i = 0;
while (i < num_cols) {
matrix[i] = new Array(num_rows);
i++;
}
}
function show_guys() {
var x = level_x;
var y = (level_y - 400);
i = 0;
while (i < num_cols) {
n = 0;
while (n < num_rows) {
var str_movie = arr_guys[getRandomValue(4)];
var str_new_movie = String(num_count);
duplicateMovieClip ("mc_container", str_new_movie, num_count);
_root[str_new_movie]._x = x;
_root[str_new_movie]._y = y;
_root[str_new_movie].attachMovie(str_movie, "new", 1);
_root[str_new_movie].str_value = str_movie;
_root[str_new_movie].arr_pos = new Array(i, n);
matrix[i][n] = str_new_movie;
num_count++;
y = y + num_gap;
n++;
}
x = x + num_gap;
y = level_y - 400;
i++;
}
mc_fall.gotoAndPlay(2);
}
function click_on_guy(movie) {
if (_root[movie].new._currentframe == 1) {
if (_root[movie].str_value == "benben") {
benben = false;
add_benben_bonus();
_root[movie].swapDepths(10000);
_root[movie].new.play();
benben_sound.start();
matrix[_root[movie].arr_pos[0]][_root[movie].arr_pos[1]] = "empty";
resort_matrix();
} else {
select_array = new Array();
select_array.push(movie);
check_other(movie);
removie_clips();
}
}
}
function check_other(movie) {
var x = _root[movie].arr_pos[1];
var y = _root[movie].arr_pos[0];
var clr = _root[movie].str_value;
if ((_root[matrix[y][x + 1]].str_value == clr) && (_root[matrix[y][x + 1]]._alpha != 50)) {
_root[matrix[y][x + 1]]._alpha = 50;
select_array.push(matrix[y][x + 1]);
check_other(matrix[y][x + 1]);
}
if ((_root[matrix[y][x - 1]].str_value == clr) && (_root[matrix[y][x - 1]]._alpha != 50)) {
_root[matrix[y][x - 1]]._alpha = 50;
select_array.push(matrix[y][x - 1]);
check_other(matrix[y][x - 1]);
}
if ((_root[matrix[y + 1][x]].str_value == clr) && (_root[matrix[y + 1][x]]._alpha != 50)) {
_root[matrix[y + 1][x]]._alpha = 50;
select_array.push(matrix[y + 1][x]);
check_other(matrix[y + 1][x]);
}
if ((_root[matrix[y - 1][x]].str_value == clr) && (_root[matrix[y - 1][x]]._alpha != 50)) {
select_array.push(matrix[y - 1][x]);
_root[matrix[y - 1][x]]._alpha = 50;
check_other(matrix[y - 1][x]);
}
}
function removie_clips() {
if (1 < select_array.length) {
i = 0;
while (i < select_array.length) {
_root[select_array[i]]._alpha = 100;
_root[select_array[i]].new.play();
matrix[_root[select_array[i]].arr_pos[0]][_root[select_array[i]].arr_pos[1]] = "empty";
i++;
}
remove_sound.start();
mc_remove.gotoAndPlay(1);
add_points(select_array.length);
} else {
mcPenalty._x = _root._xmouse;
mcPenalty._y = _root._ymouse;
mcPenalty.swapDepths(9999);
mcPenalty.gotoAndPlay(2);
num_score = num_score - 1000;
}
}
function add_points(num) {
var my_points = ((num * 50) * num);
num_score = num_score + my_points;
}
function check_end_remove() {
}
function fall_in() {
if (num_fall >= 0) {
n = num_fall;
i = 0;
while (i < 8) {
_root[matrix[i][n]].str_course = get_course(level_x + (i * num_gap), level_y + (n * num_gap), _root[matrix[i][n]]._x, _root[matrix[i][n]]._y);
_root[matrix[i][n]].end_x = level_x + (i * num_gap);
_root[matrix[i][n]].end_y = level_y + (n * num_gap);
_root[matrix[i][n]].bln_move = true;
_root[matrix[i][n]].num_mult = 2;
i++;
}
drop_sound.start();
num_fall--;
}
}
function get_course(end_x, end_y, my_x, my_y) {
if (my_x < end_x) {
return("right");
}
if (end_x < my_x) {
return("left");
}
if (my_y < end_y) {
return("up");
}
if (end_y < my_y) {
return("down");
}
}
function resort_matrix() {
i = 0;
while (i < matrix.length) {
var arr_temp = new Array();
n = 0;
while (n < matrix[i].length) {
if (matrix[i][n] == "empty") {
arr_temp.unshift(matrix[i][n]);
} else {
arr_temp.push(matrix[i][n]);
}
n++;
}
matrix[i] = arr_temp;
arr_temp = null;
i++;
}
check_empty_line();
check_empty_row();
refresh_matrix();
}
function check_empty_row() {
if (7 < matrix[0].length) {
var t = 0;
i = 0;
while (i < 8) {
if (matrix[i][0] != "empty") {
t = 1;
}
i++;
}
if (t == 0) {
i = 0;
while (i < 8) {
matrix[i].splice(0, 1);
i++;
}
level_y = level_y + num_gap;
} else {
warning_sound.start();
}
}
}
function check_empty_line() {
var arr_temp = new Array();
i = 0;
while (i < matrix.length) {
if (matrix[i][matrix[i].length - 1] != "empty") {
arr_temp.push(matrix[i]);
}
i++;
}
i = 0;
while (i < matrix.length) {
if (matrix[i][matrix[i].length - 1] == "empty") {
if ((i % 2) != 0) {
arr_temp.push(matrix[i]);
} else {
arr_temp.unshift(matrix[i]);
}
}
i++;
}
matrix = arr_temp;
}
function refresh_matrix() {
i = 0;
while (i < matrix.length) {
n = 0;
while (n < matrix[i].length) {
if (matrix[i][n] != "empty") {
_root[matrix[i][n]].str_course = get_course(level_x + (i * num_gap), level_y + (n * num_gap), _root[matrix[i][n]]._x, _root[matrix[i][n]]._y);
_root[matrix[i][n]].end_x = level_x + (i * num_gap);
_root[matrix[i][n]].end_y = level_y + (n * num_gap);
_root[matrix[i][n]].arr_pos = new Array(i, n);
_root[matrix[i][n]].bln_move = true;
_root[matrix[i][n]].num_mult = 2;
_root[matrix[i][n]].bln_new = false;
}
n++;
}
i++;
}
check_end_level();
}
function add_row() {
if ((bln_game_over != true) && (bln_end_level != true)) {
mc_checker.gotoAndStop(1);
var x = level_x;
var y = -100;
i = 0;
while (i < matrix.length) {
var str_movie = arr_guys[getRandomValue(4)];
var str_new_movie = String(num_count);
matrix[i].unshift(str_new_movie);
duplicateMovieClip ("mc_container", str_new_movie, num_count);
_root[str_new_movie].bln_new = true;
_root[str_new_movie]._x = x + (i * num_gap);
_root[str_new_movie]._y = y;
_root[str_new_movie].attachMovie(str_movie, "new", 1);
_root[str_new_movie].str_value = str_movie;
num_count++;
i++;
}
mc_fon.play();
level_y = level_y - num_gap;
resort_matrix();
drop_sound.start();
mc_checker.play();
}
}
function check_end_level() {
var valid = 0;
var crunch = 0;
x = 0;
while (x < matrix.length) {
y = 0;
while (y < matrix[x].length) {
if (matrix[x][y] != "empty") {
crunch = 1;
if (_root[matrix[x][y]].str_value == _root[matrix[x + 1][y]].str_value) {
valid = 1;
break;
}
if (_root[matrix[x][y]].str_value == _root[matrix[x - 1][y]].str_value) {
valid = 1;
break;
}
if (_root[matrix[x][y]].str_value == _root[matrix[x][y + 1]].str_value) {
valid = 1;
break;
}
if (_root[matrix[x][y]].str_value == _root[matrix[x][y - 1]].str_value) {
valid = 1;
break;
}
}
y++;
}
x++;
}
if (valid == 0) {
end_level(crunch);
}
}
function sound_on() {
drop_sound.setVolume(100);
remove_sound.setVolume(100);
}
function sound_off() {
drop_sound.setVolume(0);
remove_sound.setVolume(0);
}
function show_benben() {
var n = random(8);
my_movie = matrix[n][matrix[n].length - 1];
old_movie = my_movie;
old_movie_value = _root[my_movie].str_value;
_root[my_movie].attachMovie("mc_benben", "new", 1);
_root[my_movie].str_value = "benben";
}
function add_benben_bonus() {
benben_bonus = arr_benben_bonus[num_level - 1];
num_score = num_score + benben_bonus;
}
function delete_benben() {
if (benben != false) {
_root[old_movie].attachMovie(old_movie_value, "new", 1);
_root[my_movie].str_value = old_movie_value;
}
}
stop();
num_gap = 45;
num_x = 100;
num_y = 380;
num_cols = 8;
num_level = 1;
num_score = 0;
str_total_score = "";
bln_end = false;
bln_game_over = false;
arr_row = new Array(4, 5, 6, 7, 8, 8);
arr_time_fall = new Array(6, 4, 3, 2, 2, 2);
arr_guys = new Array("mc_red", "mc_green", "mc_gold", "mc_blue");
matrix = new Array(num_cols);
arr_benben_bonus = new Array(1000, 1500, 2000, 2500, 3500, 5000);
arr_benben_time = new Array(5, 5, 3, 3, 2, 2);
setup_sounds();
Instance of Symbol 104 MovieClip "mc_container" in Frame 6
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse, true) && (_root.bln_end_level != true)) {
_root.click_on_guy(this._name);
}
}
onClipEvent (enterFrame) {
if (this.bln_move == true) {
if (this.str_course == "left") {
if (this._x < this.end_x) {
this.bln_move = false;
this._x = this.end_x;
_root.check_end_move();
} else {
this._x = this._x - (12.1 * this.num_mult);
}
} else if (this.str_course == "right") {
if (this.end_x < this._x) {
this.bln_move = false;
this._x = this.end_x;
_root.check_end_move();
} else {
this._x = this._x + (12.1 * this.num_mult);
}
} else if (this.str_course == "up") {
if (this.end_y < this._y) {
this.bln_move = false;
this._y = this.end_y;
_root.check_end_move();
} else {
this._y = this._y + (12.1 * this.num_mult);
}
} else if (this.str_course == "down") {
if (this._y < this.end_y) {
this.bln_move = false;
this._y = this.end_y;
_root.check_end_move();
} else {
this._y = this._y - (12.1 * this.num_mult);
}
}
} else if (this.bln_new != true) {
if ((this._x != this.end_x) || (this.y != this.end_y)) {
this.str_course = _root.get_course(this.end_x, this.end_y, this._x, this._y);
this.bln_move = true;
}
}
if (this.hitTest(_root.mc_checker) == true) {
_root.end_game();
}
}
Instance of Symbol 140 MovieClip "no_matches" in Frame 6
onClipEvent (load) {
this.swapDepths(9999);
}
Instance of Symbol 148 MovieClip "mcHelp" in Frame 6
onClipEvent (load) {
this.swapDepths(109990);
}
Frame 12
function playAgain() {
gotoAndStop (3);
}
stop();
mcHelp._visible = false;
Symbol 21 MovieClip [mc_benben] Frame 1
stop();
Symbol 21 MovieClip [mc_benben] Frame 29
_root.check_end_remove();
removeMovieClip(_parent);
Symbol 25 MovieClip [mc_blue] Frame 1
stop();
Symbol 25 MovieClip [mc_blue] Frame 6
_root.check_end_remove();
removeMovieClip(_parent);
Symbol 25 MovieClip [mc_blue] Frame 45
_root.num_score = _root.num_score - 50;
_root.check_end_remove();
removeMovieClip(_parent);
Symbol 28 MovieClip [mc_gold] Frame 1
stop();
Symbol 28 MovieClip [mc_gold] Frame 6
_root.check_end_remove();
removeMovieClip(_parent);
Symbol 28 MovieClip [mc_gold] Frame 45
_root.num_score = _root.num_score - 50;
_root.check_end_remove();
removeMovieClip(_parent);
Symbol 31 MovieClip [mc_green] Frame 1
stop();
Symbol 31 MovieClip [mc_green] Frame 6
_root.check_end_remove();
removeMovieClip(_parent);
Symbol 31 MovieClip [mc_green] Frame 45
_root.num_score = _root.num_score - 50;
_root.check_end_remove();
removeMovieClip(_parent);
Symbol 34 MovieClip [mc_red] Frame 1
stop();
Symbol 34 MovieClip [mc_red] Frame 6
_root.check_end_remove();
removeMovieClip(_parent);
Symbol 34 MovieClip [mc_red] Frame 45
_root.num_score = _root.num_score - 50;
_root.check_end_remove();
removeMovieClip(_parent);
Symbol 73 MovieClip Frame 1
_highquality = 2;
Symbol 73 MovieClip Frame 65
stop();
_root.play();
Symbol 95 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 230
_root.gotoAndStop(6);
Symbol 97 Button
on (release) {
_root.door.gotoAndPlay(30);
_root.gotoAndStop(4);
}
Symbol 99 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 15
this._y = -1000;
Symbol 105 MovieClip Frame 1
stop();
Symbol 105 MovieClip Frame 6
if (_root.num_fall < 0) {
play();
} else {
gotoAndPlay (2);
}
_root.fall_in();
Symbol 105 MovieClip Frame 20
_root.mc_timer.gotoAndPlay(2);
stop();
Symbol 106 MovieClip Frame 5
if (this.n == 1) {
_root.resort_matrix();
} else {
this.n = 1;
}
stop();
Symbol 109 MovieClip Frame 1
stop();
Symbol 109 MovieClip Frame 2
num_level_time = _root.gameTotalTime;
num_start_time = Math.floor(getTimer());
gotoAndPlay (3);
Symbol 109 MovieClip Frame 3
if (_root.bln_end_level != true) {
time = int(num_level_time - ((getTimer() - num_start_time) / 1000));
if (_root.bln_game_over == true) {
gotoAndStop (5);
}
if (time == my_time) {
play();
} else {
if (0 >= time) {
_root.bln_end_level = true;
_root.end_level();
}
if (time == _root.num_benben_stone) {
_root.show_benben();
_root.benben = true;
benben_time = time;
}
if (_root.benben == true) {
if ((benben_time - time) == _root.arr_benben_time[_root.num_level - 1]) {
_root.delete_benben();
_root.benben = false;
}
}
if (time == 10) {
_root.warn_sound.start();
}
if ((((time % _root.level_time_fall) == 0) && (time != 0)) && (time < 90)) {
_root.add_row();
}
minutes = Math.floor((time / 3600) * 60);
seconds = Math.floor((((time / 3600) * 60) - minutes) * 60);
str_time = String(minutes) + " : ";
if (9 < seconds) {
str_time = str_time + String(seconds);
} else {
str_time = str_time + ("0" + String(seconds));
}
play();
}
} else if (0 >= time) {
_root.mc_message._y = 180;
_root.mc_message.gotoAndPlay(1);
_root.remove_all();
_root.no_matches.play();
stop();
} else {
_root.num_score = _root.num_score + 20;
time = time - 1;
minutes = Math.floor((time / 3600) * 60);
seconds = Math.floor((((time / 3600) * 60) - minutes) * 60);
str_time = String(minutes) + " : ";
if (9 < seconds) {
str_time = str_time + String(seconds);
} else {
str_time = str_time + ("0" + String(seconds));
}
play();
}
Symbol 109 MovieClip Frame 4
my_time = time;
gotoAndStop (3);
Symbol 109 MovieClip Frame 5
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 126 MovieClip Frame 1
if (_root.bln_game_over == true) {
this.board.gotoAndStop(7);
} else {
this.board.gotoAndStop(_root.num_level);
}
Symbol 127 MovieClip Frame 2
_root.remove_all();
_root.no_matches._x = -1000;
Symbol 127 MovieClip Frame 70
if (_root.bln_game_over == true) {
stop();
_root.play();
}
Symbol 127 MovieClip Frame 107
stop();
this._y = -1000;
_root.start_level();
Symbol 132 Button
on (release) {
this.gotoAndPlay(2);
}
Symbol 134 Button
on (release) {
this.gotoAndPlay(1);
}
Symbol 135 MovieClip Frame 1
stop();
_root.sound_on();
Symbol 135 MovieClip Frame 2
stop();
_root.sound_off();
Symbol 137 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 15
stop();
Symbol 142 Button
on (release, releaseOutside) {
if (_currentframe == 1) {
play();
}
}
Symbol 147 Button
on (release, releaseOutside) {
_parent.pressButton();
play();
}
Symbol 148 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 16
stop();
Symbol 148 MovieClip Frame 28
gotoAndStop (1);
Symbol 155 Button
on (release) {
getURL (_root.downloadUrl, "_blank");
}
Symbol 157 Button
on (rollOver) {
gotoAndPlay (2);
}
on (release) {
_root.playAgain();
}
Symbol 160 Button
on (rollOver) {
gotoAndPlay (6);
}
on (release) {
getURL (_root.downloadUrl, "_blank");
}
Symbol 161 Button
on (release) {
_root.playAgain();
}
Symbol 163 Button
on (release) {
_root.playAgain();
}
Symbol 164 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 5
stop();
Symbol 164 MovieClip Frame 10
stop();
Symbol 169 MovieClip Frame 135
stop();
Symbol 178 MovieClip Frame 250
stop();