Frame 1
stop();
Instance of Symbol 126 MovieClip in Frame 1
//component parameters
onClipEvent (construct) {
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 73
this.stop();
Frame 84
stop();
Instance of Symbol 114 MovieClip [CollapseGameSymbol] in Frame 84
//component parameters
onClipEvent (construct) {
cp_num_rows = 9;
cp_num_columns = 13;
cp_num_row_start = 3;
cp_num_start = 3;
cp_num_pieces = 6;
cp_num_special_pieces = 3;
cp_bomb_bonus_points = 200;
cp_line_bomb_bonus_points = 300;
cp_color_bomb_bonus_points = 200;
cp_bomb_order = [];
cp_bomb_order[0] = "bomb";
cp_bomb_order[1] = "linebomb";
cp_bomb_order[2] = "colorbomb";
cp_points_per_block = 10;
cp_bonus_points = 50000;
cp_select_sound = "select_sound";
cp_collapse_sound = "collapse_sound";
cp_next_piece_time = 30;
cp_next_row_time = 5;
cp_next_row_time_decrease = 0.25;
cp_next_row_time_min = 3;
cp_bonus_time = 3;
cp_special_piece_probability = 0.03;
cp_special_piece_time = 30;
}
Instance of Symbol 156 MovieClip "pause_mc" in Frame 84
/* no clip actions */
Symbol 16 MovieClip [ExtensionsSymbol] Frame 1
#initclip 1
MovieClip.prototype.intersects = function (_mc, align_x, align_y) {
var _local3 = new Array();
var _local2 = new Array();
switch (align_x) {
case "center" :
_local3.push(this._x - (this._width / 2));
_local3.push(this._x + (this._width / 2));
_local2.push(_mc._x - (_mc._width / 2));
_local2.push(_mc._x + (_mc._width / 2));
break;
case "left" :
_local3.push(this._x);
_local3.push(this._x + this._width);
_local2.push(_mc._x);
_local2.push(_mc._x + _mc._width);
break;
case "right" :
_local3.push(this._x - this._width);
_local3.push(this._x);
_local2.push(_mc._x - _mc._width);
_local2.push(_mc._x);
}
switch (align_y) {
case "center" :
_local3.push(this._y - (this._height / 2));
_local3.push(this._y + (this._height / 2));
_local2.push(_mc._y - (_mc._height / 2));
_local2.push(_mc._y + (_mc._height / 2));
break;
case "top" :
_local3.push(this._y);
_local3.push(this._y + this._height);
_local2.push(_mc._y);
_local2.push(_mc._y + _mc._height);
break;
case "bottom" :
_local3.push(this._y - this._height);
_local3.push(this._y);
_local2.push(_mc._y - _mc._height);
_local2.push(_mc._y);
}
if ((_local3[0] < _local2[0]) && (_local3[1] > _local2[0])) {
return(1);
}
if ((_local3[0] < _local2[1]) && (_local3[1] > _local2[1])) {
return(1);
}
if ((_local3[2] < _local2[2]) && (_local3[3] > _local2[2])) {
return(2);
}
if ((_local3[2] < _local2[3]) && (_local3[3] > _local2[3])) {
return(2);
}
return(0);
};
Number.prototype.isOdd = function (x) {
return(x % 2);
};
Number.prototype.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + Math.floor(a));
};
Array.prototype.swap_elements = function (a, b) {
var _local2 = this[a];
this[a] = this[b];
this[b] = _local2;
};
Array.prototype.copy = function (_array) {
var _local2 = 0;
while (_local2 < _array.length) {
this[_local2] = _array[_local2];
_local2++;
}
return(this);
};
Array.prototype.swap_elements2D = function (a, b, c, d) {
if ((a == c) && (b == d)) {
return(undefined);
}
var _local3 = this[a][b];
this[a][b] = this[c][d];
this[c][d] = _local3;
};
Array.prototype.randomize = function () {
var _local3 = new Number();
var _local2 = 0;
while (_local2 < this.length) {
this.swap_elements(_local3.randi(0, this.length), _local3.randi(0, this.length));
_local2++;
}
};
Array.prototype.randomize2D = function () {
var _local5 = this.length;
var _local4 = this[0].length;
var _local2 = new Number();
var _local3 = 0;
while (_local3 < (_local5 * _local4)) {
this.swap_elements2D(_local2.randi(0, _local5), _local2.randi(0, _local4), _local2.randi(0, _local5), _local2.randi(0, _local4));
_local3++;
}
};
Array.prototype.build_2D_Array = function (x, y) {
var _local5 = 0;
var _local4 = 0;
var _local3 = 0;
while (_local3 < x) {
this[_local3] = new Array();
var _local2 = 0;
while (_local2 < y) {
if ((_local4 != 0) && ((_local4 % 2) == 0)) {
_local5++;
}
this[_local3][_local2] = Math.floor(_local5);
_local4++;
_local2++;
}
_local3++;
}
};
Array.prototype.return_random_element = function () {
var _local2 = new Number();
return(this[_local2.randi(0, this.length)]);
};
Array.prototype.get_random_indices = function (a, b) {
var _local2 = new Array();
var _local1 = a;
while (_local1 <= b) {
_local2.push(_local1);
_local1++;
}
_local2.randomize();
return(_local2);
};
Array.prototype.contains = function (_array) {
var _local2 = 0;
while (_local2 < _array.length) {
if (this.return_indices(_array[_local2]) == -1) {
return(false);
}
_local2++;
}
return(true);
};
Array.prototype.return_indices = function (a) {
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == a) {
return(_local2);
}
_local2++;
}
return(-1);
};
Array.prototype.remove_element = function (a) {
var _local2 = this.return_indices(a);
if (_local2 == -1) {
return(this);
}
var _local4 = this.slice(0, _local2);
var _local3 = this.slice(_local2 + 1, this.length);
this=_local4.concat(_local3);//parameter overwritten
_local4.concat(_local3);
return(this);
};
Array.prototype.remove_indices = function (a) {
var _local3 = this.slice(0, a);
var _local2 = this.slice(a + 1, this.length);
this=_local3.concat(_local2);//parameter overwritten
_local3.concat(_local2);
return(this);
};
Array.prototype.push_no_duplicate = function (a) {
var _local2 = this.return_indices(a);
if (_local2 == -1) {
this.push(a);
}
return(this);
};
Array.prototype.populate = function (_indices, _number, _increase) {
var _local2 = 0;
while (_local2 < _indices) {
if (_increase) {
var _local3 = _number + _local2;
} else {
var _local3 = _number;
}
if (this[_local2] == undefined) {
this.push(_local3);
} else {
this[_local2] = _local3;
}
_local2++;
}
return(this);
};
Array.NumericSortFunction = function (A, B) {
if (A < B) {
return(-1);
}
if (A > B) {
return(1);
}
return(0);
};
Array.prototype.rande = function () {
var _local2 = new Number();
return(this[_local2.randi(0, this.length)]);
};
Array.prototype.hasElement = function (e) {
var _local2 = 0;
while (_local2 < this.length) {
if (this[_local2] == e) {
return(true);
}
_local2++;
}
return(false);
};
Array.prototype.swap = function (a, b) {
var _local2 = this[a];
this[a] = this[b];
this[b] = _local2;
};
Array.prototype.removeElementByProp = function (e) {
var _local2 = 0;
while (_local2 < this.length) {
var _local3 = true;
for (var _local5 in this[_local2]) {
if (this[_local2][_local5] != e[_local5]) {
_local3 = false;
}
}
if (_local3) {
this.splice(_local2, 1);
_local2--;
}
_local2++;
}
};
Array.prototype.randomize_array_letters = function () {
var _local2 = new String();
var _local4 = 0;
while (_local4 < this.length) {
var _local5 = 0;
while (_local5 < this[_local4].length) {
_local2 = _local2 + this[_local4].charAt(_local5);
_local5++;
}
_local4++;
}
var _local8 = new Array();
_local4 = 0;
while (_local4 < this.length) {
_local8[_local4] = new String();
var _local5 = 0;
while (_local5 < this[_local4].length) {
var _local7 = new Number();
var _local3 = _local7.randi(0, _local2.length);
var _local6 = _local2.charAt(_local3);
_local2 = _local2.substr(0, _local3) + _local2.substr(_local3 + 1, _local2.length - _local3);
_local8[_local4] = _local8[_local4] + _local6;
_local5++;
}
_local4++;
}
return(_local8);
};
String.prototype.replace = function (s, r) {
var _local4 = "";
var _local2 = 0;
while (_local2 = this.indexOf(s) , _local2 != -1) {
_local4 = _local4 + (this.substr(0, _local2) + r);
this=this.substr(_local2 + s.length);//parameter overwritten
this.substr(_local2 + s.length);
}
return(_local4 + this);
};
String.prototype.return_reverse = function () {
var _local3 = "";
var _local2 = this.length - 1;
while (_local2 >= 0) {
_local3 = _local3 + this.charAt(_local2);
_local2--;
}
return(_local3);
};
String.prototype.replace_where = function (where, newChar) {
var _local2 = "";
_local2 = this.substring(0, where) + newChar;
_local2 = _local2 + this.substring(where + 1, this.length);
return(_local2);
};
String.prototype.remove_where = function (s) {
var _local2 = "";
_local2 = this.substring(0, s);
_local2 = _local2 + this.substring(s + 1, this.length);
return(_local2);
};
String.prototype.pad = function (s, n) {
var _local3 = "";
var _local2 = 0;
while (_local2 < n) {
_local3 = _local3 + s;
_local2++;
}
_local3 = _local3 + this;
return(_local3);
};
String.prototype.randomize_letters = function () {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < this.length) {
_local3.push(this.charAt(_local2));
_local2++;
}
_local3.randomize();
var _local4 = new String();
_local2 = 0;
while (_local2 < _local3.length) {
_local4 = _local4 + _local3[_local2];
_local2++;
}
return(_local4);
};
String.prototype.to_array = function () {
var _local3 = [];
var _local2 = 0;
while (_local2 < this.length) {
_local3.push(this.charAt(_local2));
_local2++;
}
return(_local3);
};
_global.returnConstantString = function (char, n) {
var _local2 = "";
var _local1 = 0;
while (_local1 < n) {
_local2 = _local2 + char;
_local1++;
}
return(_local2);
};
ASSetPropFlags(_global, "returnConstantString", 1);
_global.recursiveObjectTrace = function (obj, level) {
if (level == undefined) {
level = 0;
}
for (var _local3 in obj) {
if (typeof(obj[_local3]) == "object") {
trace(((returnConstantString(" ", level * 4) + _local3) + " = ") + obj[_local3]);
trace(returnConstantString(" ", level * 4) + "{");
recursiveObjectTrace(obj[_local3], level + 1);
trace(returnConstantString(" ", level * 4) + "}");
} else {
trace(((returnConstantString(" ", level * 4) + _local3) + " = ") + obj[_local3]);
}
}
};
ASSetPropFlags(_global, "recursiveObjectTrace", 1);
#endinitclip
Symbol 23 MovieClip [explode_cloud] Frame 1
var _num = new Number();
this.gotoAndPlay(_num.randi(1, 6));
Symbol 23 MovieClip [explode_cloud] Frame 15
this._parent.check_in_explode(this);
this.removeMovieClip();
Symbol 26 MovieClip Frame 1
this.stop();
Symbol 26 MovieClip Frame 7
this._parent._visible = false;
this._parent._parent.check_in_collapsee(this._parent.j, this._parent.k);
Symbol 28 MovieClip Frame 1
this.stop();
Symbol 28 MovieClip Frame 7
this._parent._visible = false;
this._parent._parent.check_in_collapsee(this._parent.j, this._parent.k);
Symbol 30 MovieClip Frame 1
this.stop();
Symbol 30 MovieClip Frame 7
this._parent._visible = false;
this._parent._parent.check_in_collapsee(this._parent.j, this._parent.k);
Symbol 32 MovieClip Frame 1
this.stop();
Symbol 32 MovieClip Frame 7
this._parent._visible = false;
this._parent._parent.check_in_collapsee(this._parent.j, this._parent.k);
Symbol 34 MovieClip Frame 1
this.stop();
Symbol 34 MovieClip Frame 7
this._parent._visible = false;
this._parent._parent.check_in_collapsee(this._parent.j, this._parent.k);
Symbol 36 MovieClip Frame 1
this.stop();
Symbol 36 MovieClip Frame 7
this._parent._visible = false;
this._parent._parent.check_in_collapsee(this._parent.j, this._parent.k);
Symbol 39 MovieClip Frame 1
this.stop();
Symbol 39 MovieClip Frame 7
this._parent._visible = false;
this._parent._parent.check_in_collapsee(this._parent.j, this._parent.k);
Symbol 41 MovieClip Frame 1
this.stop();
Symbol 41 MovieClip Frame 7
this._parent._visible = false;
this._parent._parent.check_in_collapsee(this._parent.j, this._parent.k);
Symbol 45 MovieClip Frame 1
this.stop();
Symbol 45 MovieClip Frame 7
this._parent._visible = false;
this._parent._parent.check_in_collapsee(this._parent.j, this._parent.k);
Symbol 46 MovieClip [selected_piece] Frame 1
this.stop();
Symbol 47 MovieClip [piece] Frame 1
this.stop();
Symbol 58 Button
on (press) {
_root.gotoAndStop("Starting Screen");
}
Symbol 76 Button
on (release) {
gotoAndStop ("login");
}
Symbol 83 Button
on (release) {
var user = this.txtusername.text;
var pass = this.txtpassword.text;
var pts = 0;
var prevpts = _root.pointsearned;
var gtime = _root.totaltimeplayed;
var sc = _root.score;
var loader = new LoadVars();
loader.onLoad = function (success) {
if (success) {
var _local3 = 0;
if (this.pandapoints != null) {
_local3 = this.pandapoints;
}
if ((_root.pointsearned != 0) && (_local3 == 0)) {
if (this.reason != null) {
getURL (("javascript:alert('There was a problem adding the points to your login account: " + this.reason) + "');");
} else {
getURL ("javascript:alert('You have already earned the maximum number of Panda Points for this game today. No Panda Points were added to your account.');");
this.txtusername.text = "";
this.txtpassword.text = "";
_root.pointsearned = undefined;
_root.totaltimeplayed = undefined;
_root.score = undefined;
_root.gotoAndPlay("Game", 1);
}
} else {
if (prevpts != _local3) {
getURL (("javascript:alert('You have already earned the maximum number of Panda Points for this game today. " + _local3) + " Panda Points were added to your account.');");
} else {
getURL (("javascript:alert('" + _local3) + " Panda Points were added to your account.');");
}
this.txtusername.text = "";
this.txtpassword.text = "";
_root.pointsearned = undefined;
_root.totaltimeplayed = undefined;
_root.score = undefined;
_root.gotoAndPlay("Game", 1);
}
}
};
var sender = new LoadVars();
sender.user = user;
sender.pass = pass;
sender.score = sc;
sender.time = gtime;
sender.game = "0950827C-BE54-415f-8E93-2FAAD2532288";
sender.returnuid = _root.returnuid;
sender.extra = "postpoints";
sender.sendAndLoad(_root.postpage, loader, "post");
}
Symbol 88 Button
on (release) {
getURL (_root.baseurl + "/Home.aspx", "_blank");
}
Symbol 92 Button
on (release) {
getURL (_root.baseurl + "/ForgotUsername.aspx", "_blank");
}
Symbol 95 Button
on (release) {
getURL (_root.baseurl + "/ForgotPassword.aspx", "_blank");
}
Symbol 99 MovieClip Frame 1
this.panda_points.panda_point_text.text = 0;
stop();
Symbol 99 MovieClip Frame 2
this._parent.background_music.stop();
Symbol 99 MovieClip Frame 132
this.panda_points.panda_point_text.text = _root.pointsearned;
stop();
Symbol 102 Button
on (release) {
this._parent.pause_game("pause");
this.gotoAndStop(2);
}
Symbol 105 Button
on (release) {
this._parent.pause_game("unpause");
this.gotoAndStop(1);
}
Symbol 106 MovieClip Frame 1
stop();
Symbol 109 Button
on (release) {
this._parent.toggle_sound("off");
this.gotoAndStop(2);
}
Symbol 112 Button
on (release) {
this._parent.toggle_sound("on");
this.gotoAndStop(1);
}
Symbol 113 MovieClip Frame 1
stop();
Symbol 114 MovieClip [CollapseGameSymbol] Frame 1
#initclip 2
CollapseGame = function () {
this.load_data();
};
CollapseGame.prototype = new MovieClip();
Object.registerClass("CollapseGameSymbol", CollapseGame);
Object.prototype.SECOND = 1000;
Object.prototype.LETTER_LIST = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", " "];
CollapseGame.prototype.load_data = function () {
this._visible = false;
this.change_mode("loading data");
this.num_rows = this.cp_num_rows;
this.num_columns = this.cp_num_columns;
this.num_row_start = this.cp_num_row_start;
this.points_per_block = this.cp_points_per_block;
this.bomb_bonus_points = this.cp_bomb_bonus_points;
this.line_bomb_bonus_points = this.cp_line_bomb_bonus_points;
this.color_bomb_bonus_points = this.cp_color_bomb_bonus_points;
this.bomb_order = this.cp_bomb_order;
this.number_start = this.cp_num_start;
this.num_pieces = this.cp_num_pieces;
this.num_special_pieces = this.cp_num_special_pieces;
this.bonus_points = this.cp_bonus_points;
this.bonus_time = this.cp_bonus_time * SECOND;
this.select_sound = this.cp_select_sound;
this.collapse_sound = this.cp_collapse_sound;
this.next_piece_time = this.cp_next_piece_time * SECOND;
this.next_row_time = this.cp_next_row_time * SECOND;
this.next_row_time_decrease = this.cp_next_row_time_decrease * SECOND;
this.next_row_time_min = this.cp_next_row_time_min * SECOND;
this.special_piece_probability = this.cp_special_piece_probability;
this.special_piece_time = this.cp_special_piece_time * SECOND;
this.timeline = this;
for (var _local2 in this) {
if (_local2.indexOf("cp_") != -1) {
delete this[_local2];
}
}
if (this.data_file != undefined) {
this.load_text_file();
} else {
this.initialize();
}
};
CollapseGame.prototype.initialize = function () {
this.initialize_variables();
this.initialize_graphics();
this.initialize_level();
this._visible = true;
this.change_mode("play");
};
CollapseGame.prototype.initialize_variables = function () {
this.current_level = 0;
this.depth = 0;
this.score = 0;
this.game_start_time = getTimer();
this.game_time_count = 0;
this.special_piece_start = getTimer();
this.number_showing = this.num_row_start;
this.number_hidden = this.num_rows - this.number_showing;
this.total_number_pieces = this.num_pieces + this.num_special_pieces;
this.bomb_number = this.total_number_pieces + 1;
this.line_bomb_number = this.total_number_pieces;
this.color_bomb_number = this.total_number_pieces - 1;
this.sound = "on";
this.bombs_available_array = new Array();
this.play_background_music();
};
CollapseGame.prototype.initialize_graphics = function () {
this.grid_mcs = [];
var _local6 = this.playing_area._width / this.num_columns;
var _local7 = this.playing_area._height / this.num_rows;
var _local5 = 0;
while (_local5 < this.num_rows) {
this.grid_mcs[_local5] = [];
var _local4 = 0;
while (_local4 < this.num_columns) {
this.grid_mcs[_local5][_local4] = {p:this.attachMovie("piece", "pcell" + this.depth, this.depth++), s:this.attachMovie("selected_piece", "scell" + this.depth, this.depth++)};
var _local2 = this.grid_mcs[_local5][_local4].p;
var _local3 = this.grid_mcs[_local5][_local4].s;
_local2._width = _local6;
_local2._height = _local7;
_local2._x = this.playing_area._x + (_local4 * _local2._width);
_local2._y = this.playing_area._y + (_local5 * _local2._height);
_local3._width = _local6;
_local3._height = _local7;
_local3._x = this.playing_area._x + (_local4 * _local3._width);
_local3._y = this.playing_area._y + (_local5 * _local3._height);
_local2.type = "piece";
_local3.type = "selected";
_local2._visible = true;
_local3._visible = false;
_local2.j = (_local3.j = _local5);
_local2.k = (_local3.k = _local4);
_local2.onMouseDown = (_local3.onMouseDown = this.press_piece);
_local2.useHandCursor = (_local3.useHandCursor = false);
_local4++;
}
_local5++;
}
};
CollapseGame.prototype.press_piece = function () {
if (this._parent.mode != "play") {
return(undefined);
}
if (this._currentframe == 1) {
return(undefined);
}
if (this._parent.prompt._visible) {
return(undefined);
}
if ((!this.hitTest(_root._xmouse, _root._ymouse, true)) || (!this._visible)) {
return(undefined);
}
if ((getTimer() - this._parent.last_time_called) < 100) {
return(undefined);
}
this._parent.last_time_called = getTimer();
if (this.type == "selected") {
if ((this._parent.selected_adjacents_count >= 1) || (this._parent.grid_mcs[this.j][this.k].s.cell.icon >= this._parent.num_pieces)) {
this._parent.change_mode("collapse");
if (this._parent.selected_special_piece == "bomb") {
this._parent.explode_pieces();
} else if (this._parent.selected_special_piece == "line_bomb") {
this._parent.remove_row_pieces(this.j);
} else if (this._parent.selected_special_piece == "color_bomb") {
this._parent.remove_random_color(this);
} else {
this._parent.collapse_pieces();
}
}
} else {
this._parent.select_adjacents(this.j, this.k);
this._parent.count_selected();
if (this._parent.__currently_selected__ >= 2) {
this._parent.play_sound("bonk");
}
}
};
CollapseGame.prototype.explode_pieces = function () {
var _local4 = this.get_exploders();
var _local12 = 0;
this.num_checked_in = 0;
this.number_exploded = 0;
this.collapsing = [];
var _local8 = 0;
while (_local8 < this.num_rows) {
var _local7 = 0;
while (_local7 < this.num_columns) {
var _local10 = this.grid_mcs[_local8][_local7].p;
var _local11 = this.grid_mcs[_local8][_local7].s;
var _local9 = this.grid_cells[_local8][_local7];
var _local2 = 0;
while (_local2 < _local4.length) {
var _local6 = _local4[_local2].j;
var _local5 = _local4[_local2].k;
if ((Math.abs(_local6 - _local8) <= 1) && (Math.abs(_local5 - _local7) <= 1)) {
this.grid_mcs[_local8][_local7].p._visible = false;
this.grid_mcs[_local8][_local7].s._visible = false;
this.grid_cells[_local8][_local7].icon = 1;
_local12++;
var _local3 = this.attachMovie("explode_cloud", "cloud" + this.depth, this.depth++);
_local3._x = (this.playing_area._x + ((_local7 * this.playing_area._width) / this.num_columns)) + (this.playing_area._width / (2 * this.num_columns));
_local3._y = (this.playing_area._y + ((_local8 * this.playing_area._height) / this.num_rows)) + (this.playing_area._height / (2 * this.num_rows));
this.number_exploded++;
this.collapsing.push({j:_local8, k:_local7});
}
_local2++;
}
_local7++;
}
_local8++;
}
this.remove_redundant_indices(this.collapsing);
if (_local12 != 0) {
this.play_sound("bomb_explode");
}
var _local13 = this.get_possible_score(_local12);
this.score = this.score + (_local13 + this.bomb_bonus_points);
};
CollapseGame.prototype.remove_redundant_indices = function (indices) {
var _local5 = 0;
while (_local5 < this.length) {
var _local2 = _local5 + 1;
while (_local2 < this.length) {
var _local4 = indices[_local5];
var _local3 = indices[_local2];
if ((_local4.j == _local3.j) && (_local4.k == _local3.k)) {
indices.splice(_local2, 1);
_local2--;
}
_local2++;
}
_local5++;
}
};
CollapseGame.prototype.get_exploders = function () {
var _local7 = [];
var _local6 = 0;
while (_local6 < this.num_rows) {
var _local5 = 0;
while (_local5 < this.num_columns) {
var _local2 = this.grid_mcs[_local6][_local5].p;
var _local3 = this.grid_mcs[_local6][_local5].s;
var _local4 = this.grid_cells[_local6][_local5];
if (_local3._visible && (!_local2._visible)) {
_local7.push({j:_local6, k:_local5});
}
_local5++;
}
_local6++;
}
return(_local7);
};
CollapseGame.prototype.count_selected = function () {
var _local5 = 0;
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
var _local4 = this.grid_mcs[_local3][_local2].s;
if (_local4._visible) {
_local5++;
}
_local2++;
}
_local3++;
}
this.__currently_selected__ = _local5;
this.selected_score.text = this.get_possible_score(_local5);
};
CollapseGame.prototype.check_shift_columns = function () {
var _local11 = Math.floor(this.num_columns / 2);
var _local9 = _local11;
var _local10 = _local9 + 1;
var _local7 = this.num_rows - 1;
var _local4 = -1;
var _local6 = 0;
while (_local6 < (_local9 + 1)) {
if ((!this.grid_mcs[_local7][_local6].p._visible) && (!this.grid_mcs[_local7][_local6].s._visible)) {
var _local8 = _local6 + 1;
var _local5 = 0;
while (_local5 < _local8) {
var _local3 = _local6 + (_local5 * _local4);
var _local2 = 0;
while (_local2 < this.num_rows) {
this.grid_cells[_local2][_local3].icon = this.grid_cells[_local2][_local3 + _local4].icon;
this.grid_mcs[_local2][_local3].s._visible = this.grid_mcs[_local2][_local3 + _local4].s._visible;
this.grid_mcs[_local2][_local3].p._visible = this.grid_mcs[_local2][_local3 + _local4].p._visible;
this.grid_mcs[_local2][_local3].s.gotoAndStop(this.grid_cells[_local2][_local3].icon);
this.grid_mcs[_local2][_local3].p.gotoAndStop(this.grid_cells[_local2][_local3].icon);
if ((_local3 == (this.num_columns - 1)) || (_local3 == 0)) {
this.grid_cells[_local2][_local3].icon = 1;
this.grid_mcs[_local2][_local3].s._visible = false;
this.grid_mcs[_local2][_local3].p._visible = false;
}
_local2++;
}
_local5++;
}
}
_local6++;
}
_local4 = 1;
_local6 = this.num_columns - 1;
while (_local6 >= _local10) {
if ((!this.grid_mcs[_local7][_local6].p._visible) && (!this.grid_mcs[_local7][_local6].s._visible)) {
var _local8 = this.num_columns - _local6;
var _local5 = 0;
while (_local5 < _local8) {
var _local3 = _local6 + (_local5 * _local4);
var _local2 = 0;
while (_local2 < this.num_rows) {
this.grid_cells[_local2][_local3].icon = this.grid_cells[_local2][_local3 + _local4].icon;
this.grid_mcs[_local2][_local3].s._visible = this.grid_mcs[_local2][_local3 + _local4].s._visible;
this.grid_mcs[_local2][_local3].p._visible = this.grid_mcs[_local2][_local3 + _local4].p._visible;
this.grid_mcs[_local2][_local3].s.gotoAndStop(this.grid_cells[_local2][_local3].icon);
this.grid_mcs[_local2][_local3].p.gotoAndStop(this.grid_cells[_local2][_local3].icon);
if ((_local3 == (this.num_columns - 1)) || (_local3 == 0)) {
this.grid_cells[_local2][_local3].icon = 1;
this.grid_mcs[_local2][_local3].s._visible = false;
this.grid_mcs[_local2][_local3].p._visible = false;
}
_local2++;
}
_local5++;
}
}
_local6--;
}
};
CollapseGame.prototype.collapse_pieces = function () {
this.collapsing = [];
this.num_checked_in = 0;
if (this.initial_collapse != undefined) {
this.num_checked_in = this.initial_collapse.length;
var _local6 = 0;
while (_local6 < this.initial_collapse.length) {
this.collapsing.push({j:this.initial_collapse[_local6].j, k:this.initial_collapse[_local6].k});
_local6++;
}
this.initial_collapse = undefined;
}
var _local7 = 0;
var _local8 = 0;
var _local6 = 0;
while (_local6 < this.num_rows) {
var _local5 = 0;
while (_local5 < this.num_columns) {
var _local3 = this.grid_mcs[_local6][_local5].p;
var _local2 = this.grid_mcs[_local6][_local5].s;
var _local4 = this.grid_cells[_local6][_local5];
if (_local2._visible && (!_local3._visible)) {
_local2.j = _local6;
_local2.k = _local5;
_local3._visible = false;
_local4.icon = 1;
_local2._mc.play();
this.collapsing.push({j:_local6, k:_local5});
_local8 = _local8 + this.points_per_block;
_local7++;
}
_local5++;
}
_local6++;
}
_local8 = this.get_possible_score(_local7);
this.last_collapse_score.text = _local8;
this.score = this.score + _local8;
var _local9 = new Number();
this.play_sound("multiple_rocks_fall" + _local9.randi(1, 4));
if (_local7 > 0) {
this.play_sound(this.collapse_sound);
}
if (_local7 > 0) {
return(true);
}
return(false);
};
CollapseGame.prototype.remove_row_pieces = function (_row) {
this.collapsing = [];
this.num_checked_in = 0;
var _local7 = 0;
var _local8 = 0;
var _local6 = _row;
var _local5 = 0;
while (_local5 < this.num_columns) {
var _local4 = this.grid_mcs[_local6][_local5].p;
var _local2 = this.grid_mcs[_local6][_local5].s;
var _local3 = this.grid_cells[_local6][_local5];
if (_local3.icon > 1) {
_local2.j = _local6;
_local2.k = _local5;
_local4._visible = false;
_local3.icon = 1;
_local2._mc.play();
this.collapsing.push({j:_local6, k:_local5});
_local8 = _local8 + this.points_per_block;
_local7++;
}
_local5++;
}
this.score = this.score + this.line_bomb_bonus_points;
var _local9 = new Number();
this.play_sound("multiple_rocks_fall" + _local9.randi(1, 4));
if (_local7 > 0) {
this.play_sound(this.collapse_sound);
}
if (_local7 > 0) {
return(true);
}
return(false);
};
CollapseGame.prototype.remove_random_color = function (_me) {
this.collapsing = [];
this.num_checked_in = 0;
var _local11 = new Number();
var _local10 = _local11.randi(1, this.number_start + 1) + 1;
var _local5 = 0;
var _local6 = 0;
var _local9 = 0;
while (_local9 < this.num_rows) {
var _local8 = 0;
while (_local8 < this.num_columns) {
var _local4 = this.grid_mcs[_local9][_local8].p;
var _local2 = this.grid_mcs[_local9][_local8].s;
var _local3 = this.grid_cells[_local9][_local8];
if (_local3.icon == _local10) {
_local2.j = _local9;
_local2.k = _local8;
_local4._visible = false;
_local3.icon = 1;
_local2._mc.play();
this.collapsing.push({j:_local9, k:_local8});
_local6 = _local6 + this.points_per_block;
_local5++;
} else if ((_local8 == _me.k) && (_local9 == _me.j)) {
_local2.j = _local9;
_local2.k = _local8;
_local4._visible = false;
_local3.icon = 1;
_local2._mc.play();
this.collapsing.push({j:_local9, k:_local8});
_local6 = _local6 + this.points_per_block;
_local5++;
}
_local8++;
}
_local9++;
}
this.score = this.score + (this.color_bomb_bonus_points * _local5);
_local11 = new Number();
this.play_sound("multiple_rocks_fall" + _local11.randi(1, 4));
if (_local5 > 0) {
this.play_sound(this.collapse_sound);
}
if (_local5 > 0) {
return(true);
}
return(false);
};
CollapseGame.prototype.game_over = function () {
this.change_mode("over");
this.game_is_over = true;
_root.score = this.score.text;
this.tryPostScore(this.score_var.text, this.game_time.text, "LOSE");
this.game_over_prompt.gotoAndPlay(2);
this.game_over_prompt.swapDepths(this.depth++);
};
CollapseGame.prototype.tryPostScore = function (sc, gtime, extra) {
_root.pointsearned = 0;
if (_root.postpage != null) {
this.game_start_time = getTimer();
var _local5 = this.game_time_count++;
if (_local5 < 0) {
_local5 = 0;
}
var _local8 = Math.floor(_local5 / 60);
var _local4 = _local5 % 60;
if (_local4 <= 9) {
_local4 = "0" + _local4;
}
gtime = (_local8 + ":") + _local4;
_root.totaltimeplayed = gtime;
_root.score = sc;
var _local6 = new LoadVars();
_local6.onLoad = function (success) {
if (success) {
var _local3 = 0;
if (this.pandapoints != null) {
_local3 = this.pandapoints;
}
_root.pointsearned = _local3;
_root.returnuid = this.returnuid;
}
};
var _local3 = new LoadVars();
_local3.score = sc;
_local3.time = gtime;
_local3.game = "0950827C-BE54-415f-8E93-2FAAD2532288";
_local3.extra = "getpoints";
_local3.sendAndLoad(_root.postpage, _local6, "post");
}
};
CollapseGame.prototype.check_in_collapsee = function () {
this.num_checked_in++;
if (this.num_checked_in == this.collapsing.length) {
var _local2 = 0;
while (_local2 < this.collapsing.length) {
this.move_above_pieces_down(this.collapsing[_local2].j, this.collapsing[_local2].k);
_local2++;
}
this.check_shift_columns();
this.change_mode("play");
}
};
CollapseGame.prototype.check_in_explode = function (j) {
this.num_checked_in++;
if (this.num_checked_in == this.number_exploded) {
j = 0;
while (j < this.collapsing.length) {
this.move_above_pieces_down(this.collapsing[j].j, this.collapsing[j].k);
j++;
}
this.check_shift_columns();
this.change_mode("play");
}
};
CollapseGame.prototype.move_above_pieces_down = function (j, k) {
var _local2 = j;
while (_local2 >= 0) {
this.grid_cells[_local2][k].icon = this.grid_cells[_local2 - 1][k].icon;
this.grid_mcs[_local2][k].s._visible = this.grid_mcs[_local2 - 1][k].s._visible;
this.grid_mcs[_local2][k].p._visible = this.grid_mcs[_local2 - 1][k].p._visible;
this.grid_mcs[_local2][k].s.gotoAndStop(this.grid_cells[_local2 - 1][k].icon);
this.grid_mcs[_local2][k].p.gotoAndStop(this.grid_cells[_local2 - 1][k].icon);
if (_local2 == 0) {
this.grid_cells[_local2][k].icon = 1;
this.grid_mcs[_local2][k].s._visible = false;
this.grid_mcs[_local2][k].p._visible = false;
}
_local2--;
}
};
CollapseGame.prototype.move_all_pieces_up = function () {
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
if (_local3 == 0) {
if (this.grid_cells[_local3][_local2].icon > 1) {
this.game_over();
return(false);
}
}
this.grid_cells[_local3][_local2].icon = this.grid_cells[_local3 + 1][_local2].icon;
this.grid_mcs[_local3][_local2].s._visible = false;
this.grid_mcs[_local3][_local2].p._visible = true;
this.grid_mcs[_local3][_local2].s.gotoAndStop(this.grid_cells[_local3 + 1][_local2].icon);
this.grid_mcs[_local3][_local2].p.gotoAndStop(this.grid_cells[_local3 + 1][_local2].icon);
if (_local3 == (this.num_rows - 1)) {
this.grid_cells[n][k].icon = 1;
this.grid_mcs[n][k].s._visible = false;
this.grid_mcs[n][k].p._visible = false;
}
_local2++;
}
_local3++;
}
return(true);
};
CollapseGame.prototype.select_adjacents = function (pj, pk) {
this.unselect_all();
var _local13 = this.grid_mcs[pj][pk].p;
var _local14 = this.grid_mcs[pj][pk].s;
var _local10 = this.grid_cells[pj][pk];
this.selected_adjacents_count = 0;
if (_local10.icon == this.bomb_number) {
this.selected_special_piece = "bomb";
} else if (_local10.icon == this.line_bomb_number) {
this.selected_special_piece = "line_bomb";
} else if (_local10.icon == this.color_bomb_number) {
this.selected_special_piece = "color_bomb";
} else {
this.selected_special_piece = "";
}
_local13._visible = false;
_local14._visible = true;
var _local4 = 3;
var _local9 = true;
while (_local9) {
_local9 = false;
var _local7 = 0;
while (_local7 < _local4) {
var _local3 = 0;
while (_local3 < _local4) {
var _local6 = (pj - ((_local4 - 1) / 2)) + _local7;
var _local5 = (pk - ((_local4 - 1) / 2)) + _local3;
var _local2 = this.grid_mcs[_local6][_local5];
var _local8 = this.grid_cells[_local6][_local5];
if (this.is_adjacent_to_selected(_local2, _local8, _local10)) {
_local2.s._visible = true;
_local2.p._visible = false;
_local9 = true;
this.selected_adjacents_count++;
}
_local3++;
}
_local7++;
}
_local4 = _local4 + 2;
}
};
CollapseGame.prototype.is_adjacent_to_selected = function (_mcs, cell, ccell) {
if (_mcs.s._visible && (!_mcs.p._visible)) {
return(undefined);
}
if (cell.icon == ccell.icon) {
var _local3 = _mcs.s.j;
var _local2 = _mcs.s.k;
if (this.grid_mcs[_local3 + 1][_local2].s._visible == true) {
return(true);
}
if (this.grid_mcs[_local3][_local2 + 1].s._visible == true) {
return(true);
}
if (this.grid_mcs[_local3][_local2 - 1].s._visible == true) {
return(true);
}
if (this.grid_mcs[_local3 - 1][_local2].s._visible == true) {
return(true);
}
}
return(false);
};
CollapseGame.prototype.unselect_all = function () {
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
var _local4 = this.grid_mcs[_local3][_local2].p;
var _local5 = this.grid_mcs[_local3][_local2].s;
if (_local4._visible || (_local5._visible)) {
_local4._visible = true;
_local5._visible = false;
}
_local2++;
}
_local3++;
}
};
CollapseGame.prototype.onEnterFrame = function () {
if (this.mode != "play") {
return(undefined);
}
this.update_game_properties();
if (this.check_nomore_pieces()) {
this.waitID = setInterval(this.timeline, "hide_bonus_prompt", this.bonus_time);
}
};
CollapseGame.prototype.update_game_properties = function () {
if (this.game_is_over == true) {
return(undefined);
}
if (this.mode != "play") {
return(undefined);
}
var _local3 = this.level_next_row_delay - (getTimer() - this.last_row_created);
if (_local3 <= 0) {
this.add_row_of_pieces();
}
this.score_var.text = this.score;
if ((getTimer() - this.game_start_time) < SECOND) {
return(undefined);
}
this.game_start_time = getTimer();
_local3 = this.game_time_count++;
if (_local3 < 0) {
_local3 = 0;
}
var _local4 = Math.floor(_local3 / 60);
var _local2 = _local3 % 60;
if (_local2 <= 9) {
_local2 = "0" + _local2;
}
this.game_time.text = (_local4 + ":") + _local2;
};
CollapseGame.prototype.add_row_of_pieces = function () {
this.last_row_created = getTimer();
this.play_sound("rock_slides_over");
if (!this.move_all_pieces_up()) {
return(undefined);
}
var _local3 = this.next_piece_delay - (getTimer() - this.last_piece_created);
if (_local3 <= 0) {
this.next_piece_delay = this.next_piece_time * 1.5;
this.last_piece_created = getTimer();
this.number_start++;
if (this.number_start > this.num_pieces) {
this.number_start = this.num_pieces;
}
this.level_next_row_delay = this.level_next_row_delay - this.next_row_time_decrease;
if (this.level_next_row_delay < this.next_row_time_min) {
this.level_next_row_delay = this.next_row_time_min;
}
}
var _local2 = 0;
while (_local2 < this.num_columns) {
this.add_piece(_local2);
_local2++;
}
if (this.add_sound == undefined) {
this.add_sound = "rock_impact2";
}
};
CollapseGame.prototype.add_piece = function (col) {
this.new_piece = this.attachMovie("piece", "piece" + this.depth, this.depth++);
var _local4 = false;
if (this.special_piece_time <= (getTimer() - this.special_piece_start)) {
if (this.bomb_order.length > 0) {
this.bombs_available_array.push(this.bomb_order.shift());
}
this.special_piece_start = getTimer();
}
if (this.bombs_available_array.length > 0) {
if (Math.random() < this.special_piece_probability) {
_local4 = true;
if ((this.number_start >= 5) && (this.bombs_available_array.return_indices("colorbomb") != -1)) {
var _local3 = Math.random();
if (_local3 < 0.33) {
var _local2 = this.total_number_pieces + 1;
} else if ((_local3 >= 0.33) && (_local3 < 0.66)) {
var _local2 = this.total_number_pieces - 1;
} else {
var _local2 = this.total_number_pieces;
}
} else if (Math.random() < 0.5) {
var _local2 = this.total_number_pieces + 1;
} else if (this.bombs_available_array.return_indices("linebomb") != -1) {
var _local2 = this.total_number_pieces;
}
}
}
if (_local4 == false) {
var _local5 = new Number();
var _local2 = _local5.randi(1, this.number_start + 1) + 1;
}
if (_local2 == this.bomb_number) {
this.play_sound("bomb_appears");
}
this.new_piece.gotoAndStop(_local2);
this.new_piece.icon = _local2;
this.new_piece.next_fall_column = col;
this.new_piece.final_x = ((col * this.playing_area._width) / this.num_columns) + this.playing_area._x;
this.new_piece._width = this.playing_area._width / this.num_columns;
this.new_piece._height = this.playing_area._height / this.num_rows;
this.new_piece._x = -this.new_piece._width;
this.new_piece._y = this.playing_area._y + ((this.num_columns - 1) * this.new_piece._height);
this.add_piece_to_grid(col, _local2);
this.render_grid();
};
CollapseGame.prototype.move_new_piece = function () {
this._x = this._x + ((this.final_x - this._x) / 4);
if (Math.abs(this._x - this.final_x) < 2) {
this._x = this.final_x;
if (this.placed_start_time == undefined) {
this.placed_start_time = getTimer();
}
if ((getTimer() - this.placed_start_time) >= 500) {
this._parent.add_piece_to_grid(this.next_fall_column, this.icon);
if (this._parent.add_sound != undefined) {
this._parent.play_sound(this._parent.add_sound);
this._parent.add_sound = undefined;
}
this._parent.check_shift_columns();
this._parent.render_grid();
this.onEnterFrame = undefined;
this.removeMovieClip();
}
}
};
CollapseGame.prototype.add_piece_to_grid = function (col, icon) {
var _local2 = this.num_rows - 1;
this.grid_cells[_local2][col].icon = icon;
this.grid_mcs[_local2][col].p._visible = true;
this.render_grid();
};
CollapseGame.prototype.initialize_level = function () {
this.level_next_row_delay = this.next_row_time;
this.last_row_created = getTimer();
this.game_start_time = getTimer();
this.next_piece_delay = this.next_piece_time;
this.last_piece_created = getTimer();
this.create_random_grid();
};
CollapseGame.prototype.create_random_grid = function () {
this.grid_cells = [];
this.initial_collapse = [];
var _local3 = 0;
while (_local3 < this.num_rows) {
this.grid_cells[_local3] = [];
var _local2 = 0;
while (_local2 < this.num_columns) {
this.grid_cells[_local3][_local2] = {};
var _local4 = new Number();
this.grid_cells[_local3][_local2].icon = _local4.randi(1, this.number_start + 1) + 1;
if (_local3 < this.number_hidden) {
this.grid_cells[_local3][_local2].icon = 1;
}
this.grid_cells[_local3][_local2].selected = false;
_local2++;
}
_local3++;
}
this.render_grid();
};
CollapseGame.prototype.render_grid = function () {
var _local6 = 0;
while (_local6 < this.num_rows) {
var _local5 = 0;
while (_local5 < this.num_columns) {
var _local2 = this.grid_cells[_local6][_local5];
var _local3 = this.grid_mcs[_local6][_local5].p;
var _local4 = this.grid_mcs[_local6][_local5].s;
_local3.cell = _local2;
_local4.cell = _local2;
if (_local2.icon > 1) {
_local4._visible = false;
_local3._visible = false;
if (_local2.selected) {
_local4._visible = true;
} else {
_local3._visible = true;
}
_local3.gotoAndStop(_local2.icon);
_local4.gotoAndStop(_local2.icon);
} else {
_local4._visible = false;
_local3._visible = false;
_local4.gotoAndStop(1);
_local3.gotoAndStop(1);
}
_local5++;
}
_local6++;
}
};
CollapseGame.prototype.check_special_piece = function () {
return(false);
};
CollapseGame.prototype.check_nomore_pieces = function () {
var _local3 = this.num_rows - 1;
var _local2 = 0;
while (_local2 < this.num_columns) {
if (this.grid_mcs[_local3][_local2].s._visible || (this.grid_mcs[_local3][_local2].p._visible)) {
return(false);
}
_local2++;
}
this.change_mode("wait");
this.score = this.score + this.bonus_points;
this.timeline.attachMovie("bonus", "bonus", this.depth++);
this.bonus._x = (this.playing_area._width / 2) + this.playing_area._x;
this.bonus._y = (this.playing_area._height / 2) + this.playing_area._y;
this.bonus.bonus_var.text = ("Extra " + this.bonus_points) + " pts!";
return(true);
};
CollapseGame.prototype.hide_bonus_prompt = function () {
this.bonus.removeMovieClip();
this.add_row_of_pieces();
this.change_mode("play");
clearInterval(this.waitID);
};
CollapseGame.prototype.play_sound = function (linkage) {
if (this.sound == "on") {
var _local2 = new Sound();
_local2.attachSound(linkage);
_local2.start(0, 1);
}
};
CollapseGame.prototype.get_possible_score = function (num_blocks) {
return(num_blocks * this.points_per_block);
};
CollapseGame.prototype.toggle_sound = function (_which) {
this.sound = _which;
if (this.sound == "off") {
this.random_call_mc.stop();
this.background_music.stop();
} else {
this.play_background_music();
this.random_call_mc.play();
}
};
CollapseGame.prototype.play_background_music = function () {
this.background_music = new Sound();
this.background_music.attachSound("background");
this.background_music.start();
this.background_music.setVolume(50);
this.background_music.timeline = this.timeline;
this.background_music.onSoundComplete = function () {
this.timeline.background_music.start();
};
};
CollapseGame.prototype.pause_game = function (_which) {
if (_which == "pause") {
this.change_mode("pause");
this._parent.pause_mc.gotoAndPlay("close");
this.pause_mc.swapDepths(this.depth++);
} else {
this.change_mode("play");
this._parent.pause_mc.gotoAndPlay("open");
}
};
CollapseGame.prototype.change_mode = function (new_mode) {
if (old_mode == "wait") {
clearInterval(this.waitID);
}
this.old_mode = this.mode;
this.mode = new_mode;
};
#endinitclip
this._x = (this._y = 0);
Instance of Symbol 99 MovieClip "game_over_prompt" in Symbol 114 MovieClip [CollapseGameSymbol] Frame 1
/* no clip actions */
Symbol 122 MovieClip Frame 100
stop();
Symbol 126 MovieClip Frame 1
stop();
Instance of Symbol 125 MovieClip "swfloader" in Symbol 126 MovieClip Frame 1
onClipEvent (load) {
function strip_spaces(str) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < str.length) {
if ((str.charAt(_local1) != " ") && (str.charAt(_local1) != ";")) {
_local3 = _local3 + str.charAt(_local1);
}
_local1++;
}
return(_local3);
}
function simple_script(action, timeline) {
action = strip_spaces(action);
if ((action.length > 0) && ((action.indexOf(")") != -1) && (action.indexOf("(") != -1))) {
var _local3 = action.split(".");
var _local5 = _local3.pop();
var _local7 = _local5.indexOf("(");
var _local9 = _local5.indexOf(")");
var _local8 = _local5.substr(0, _local7);
var _local4 = _local5.substr(_local7 + 1, _local9 - (_local7 + 1));
var _local2 = timeline;
var _local1 = 0;
while (_local1 < _local3.length) {
_local2 = _local2[_local3[_local1]];
_local1++;
}
if (_local4.indexOf("\"") != -1) {
_local4 = _local4.substr(1, _local4.length - 2);
}
_local2[_local8](_local4);
}
}
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) {
switch (_parent.xin_motion_val) {
case "Up" :
_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) {
switch (_parent.xin_motion_val) {
case "Toward" :
_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_x - _parent._x) > Math.abs(orig_y - _parent._y)) {
_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") && (Math.abs(_parent._alpha - orig_a) <= 1)) || (((_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 ((rl > 10) && (rt > 10)) {
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) {
switch (_parent.xout_motion_val) {
case "Down" :
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 "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 (_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 "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 (Math.abs(perc_fadeout - 100) > 1) {
break;
}
execute_action();
}
if (!(_parent.xout_alphatype_val === "Yes")) {
} else {
_parent._alpha = (orig_a / 100) * (100 - perc_fadeout);
}
} else {
execute_action();
}
}
Symbol 138 Button
on (press) {
stopAllSounds();
this.play();
}
Symbol 145 MovieClip Frame 15
stop();
Symbol 156 MovieClip Frame 1
stop();
Symbol 156 MovieClip Frame 10
stop();