Instance of Symbol 154 MovieClip in Frame 1
//component parameters
onClipEvent (initialize) {
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();";
}
Instance of Symbol 158 MovieClip in Frame 1
//component parameters
onClipEvent (initialize) {
highscore_url = "http://www.gamesinaflash.com/hs_scores.php";
game_id = 10;
score_variable = "score";
button_label = "Play Again";
}
Frame 2
stop();
Frame 3
stop();
Frame 4
game.game_type = _root.game_type;
game.automatic_hint = false;
stop();
_root._quality = "MEDIUM";
Instance of Symbol 331 MovieClip [DiamondMineComponent] "game" in Frame 4
//component parameters
onClipEvent (initialize) {
use_quiz = "False";
quiz_data_file = "dino_quiz.txt";
quiz_piece_probability = 0.2;
correct_points = 100;
incorrect_points = -20;
max_quiz_per_level = 3;
game_type = "Timer";
time_percent_change = 0.025;
level_percent_change_increase = 0.01;
collapse_percent_increase = 3;
level_collapse_percent_change = 0.5;
minimum_collapse_percent = 0.5;
num_rows = 8;
num_columns = 8;
piece_acceleration = 2;
stage_width = 640;
stage_height = 480;
points_per_piece = 10;
level_point_increase = 5;
}
Frame 5
stop();
_root._quality = "HIGH";
Frame 6
this.gotoAndPlay("Starting Screen");
Symbol 10 MovieClip [MathExtensions] Frame 1
#initclip 5
Math.randf = function (a, b) {
return((Math.random() * (b - a)) + a);
};
Math.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + Math.floor(a));
};
#endinitclip
Symbol 11 MovieClip [ArrayExtensions] Frame 1
#initclip 6
Array.prototype.swap = function (a, b) {
var _local1 = this;
var _local2 = _local1[a];
_local1[a] = _local1[b];
_local1[b] = _local2;
};
Array.prototype.swap2D = function (a, b, c, d) {
var _local1 = this;
var _local2 = _local1[a][b];
_local1[a][b] = _local1[c][d];
_local1[c][d] = _local2;
};
Array.prototype.shuffle = function () {
var _local3 = this;
var _local2 = _local3.length;
var _local1 = 0;
while (_local1 < _local2) {
_local3.swap(_local1, Math.randi(0, _local2));
_local1++;
}
};
Array.prototype.rande = function () {
return(this[Math.randi(0, this.length)]);
};
Array.prototype._push = function (e) {
if (e != undefined) {
this[this.length] = e;
}
};
Array.negated_intersection = function (A, B) {
var _local3 = B;
var _array = new Array();
var a_length = A.length;
var b_length = _local3.length;
var _local1 = 0;
while (_local1 < a_length) {
var found = false;
var _local2 = 0;
while (_local2 < b_length) {
if (A[_local1] == _local3[_local2]) {
found = true;
}
_local2++;
}
if (!found) {
_array._push(A[_local1]);
}
_local1++;
}
var _local2 = 0;
while (_local2 < b_length) {
var found = false;
_local1 = 0;
while (_local1 < a_length) {
if (_local3[_local2] == A[_local1]) {
found = true;
}
_local1++;
}
if (!found) {
_array._push(_local3[_local2]);
}
_local2++;
}
return(_array);
};
Array.prototype.remove_repeats = function () {
var _local3 = this;
var _array = new Array();
var _local1 = 0;
while (_local1 < _local3.length) {
found = false;
var _local2 = 0;
while (_local2 < _array.length) {
if (typeof(_local3[_local1]) == "object") {
var equal = true;
for (var n in _local3[_local1]) {
if (_local3[_local1][n] != _array[_local2][n]) {
equal = false;
}
}
if (equal) {
found = true;
}
} else if (_local3[_local1] == _array[_local2]) {
found = true;
}
_local2++;
}
if (!found) {
_array._push(_local3[_local1]);
}
_local1++;
}
return(_array);
};
Array.getIndices = function (a, b) {
var _local3 = b;
var _local2 = new Array();
var _local1 = a;
while (_local1 <= _local3) {
_local2._push(_local1);
_local1++;
}
return(_local2);
};
Array.prototype.return_copy = function () {
var _local2 = this;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
_local3[_local1] = _local2[_local1];
_local1++;
}
return(_local3);
};
#endinitclip
Symbol 12 MovieClip [MovieClipExtensions] Frame 1
#initclip 2
MovieClip.prototype.playing = false;
MovieClip.prototype.mouseOver = false;
MovieClip.prototype._currentlabel = "";
MovieClip.prototype._play = function () {
this.playing = true;
this.play();
};
MovieClip.prototype._stop = function () {
this.playing = false;
this.stop();
};
MovieClip.prototype._gotoAndPlay = function (frame) {
var _local1 = frame;
var _local2 = this;
_local2.playing = true;
if (typeof(_local1) == "string") {
_local2._currentlabel = _local1;
}
_local2.gotoAndPlay(_local1);
};
MovieClip.prototype._gotoAndStop = function (frame) {
var _local1 = frame;
var _local2 = this;
_local2.playing = false;
if (typeof(_local1) == "string") {
_local2._currentlabel = _local1;
}
_local2.gotoAndStop(_local1);
};
MovieClip.prototype.hasLabel = function (label) {
var _local1 = this;
_local1.duplicateMovieClip("__TEMP__", 97324, {_x:-1, _y:-1, _visible:false, _width:1, _height:1});
new Sound(_local1._parent.__TEMP__).setVolume(0);
_local1._parent.__TEMP__.gotoAndStop(label);
var _local3 = _local1._parent.__TEMP__._currentframe;
_local1._parent.__TEMP__.nextFrame();
_local1._parent.__TEMP__.gotoAndStop(label);
var frame_f = _local1._parent.__TEMP__._currentframe;
var _local2 = _local3 == frame_f;
_local1._parent.__TEMP__.removeMovieClip();
return(_local2);
};
MovieClip.prototype.gotoAndPlayRandom = function () {
this._gotoAndPlay(Math.randi(1, this._totalframes + 1));
};
MovieClip.prototype.gotoAndStopRandom = function () {
this._gotoAndStop(Math.randi(1, this._totalframes + 1));
};
#endinitclip
Symbol 28 MovieClip Frame 1
this._stop();
Symbol 28 MovieClip Frame 22
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 28 MovieClip Frame 37
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 28 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 42 MovieClip Frame 1
this._stop();
Symbol 42 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 42 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 42 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 60 MovieClip Frame 1
this._stop();
Symbol 60 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 60 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 60 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 75 MovieClip Frame 1
this._stop();
Symbol 75 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 75 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 75 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 91 MovieClip Frame 1
this._stop();
Symbol 91 MovieClip Frame 25
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 91 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 91 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 106 MovieClip Frame 1
this._stop();
Symbol 106 MovieClip Frame 28
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 106 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 106 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 120 MovieClip Frame 1
this._stop();
Symbol 120 MovieClip Frame 30
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 120 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 120 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 121 MovieClip Frame 1
this._stop();
Symbol 121 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 121 MovieClip Frame 37
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 121 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 122 MovieClip Frame 1
this._stop();
Symbol 122 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 122 MovieClip Frame 37
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 122 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 123 MovieClip Frame 1
this._stop();
Symbol 123 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 123 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 123 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 124 MovieClip Frame 1
this._stop();
Symbol 124 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 124 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 124 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 125 MovieClip Frame 1
this._stop();
Symbol 125 MovieClip Frame 25
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 125 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 125 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 126 MovieClip Frame 1
this._stop();
Symbol 126 MovieClip Frame 28
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 126 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 126 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 127 MovieClip Frame 1
this._stop();
Symbol 127 MovieClip Frame 30
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 127 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 127 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 128 MovieClip [game_piece] Frame 1
this._stop();
Symbol 130 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 62
this._gotoAndPlay(2);
Symbol 131 MovieClip [PieceComponent] Frame 1
#initclip 3
PieceClass = function () {
if (this._name != undefined) {
this.initialize();
}
};
PieceClass.prototype = new MovieClip();
Object.registerClass("PieceComponent", PieceClass);
PieceClass.prototype.initialize = function () {
this.initialize_variables();
this.initialize_graphics();
};
PieceClass.prototype.initialize_variables = function () {
var _local1 = this;
_local1.velocity_x = 0;
_local1.velocity_y = 0;
_local1.acceleration_x = 0;
_local1.acceleration_y = 0;
_local1.onEnterFrame = _local1.fall_to_position;
_local1.useHandCursor = false;
};
PieceClass.prototype.initialize_graphics = function () {
var _local1 = this;
_local1.pieces._gotoAndStop(_local1.type);
if (_local1.quiz) {
_local1.pieces._gotoAndStop(_local1.pieces._currentframe + (_local1.pieces._totalframes / 2));
}
};
PieceClass.prototype.rattle = function () {
var _local1 = this;
_local1._x = _local1.final_position_x + Math.randf(-5, 5);
_local1._y = _local1.final_position_y + Math.randf(-5, 5);
};
PieceClass.prototype.fall_to_position = function () {
var _local1 = this;
_local1.velocity_x = _local1.velocity_x + _local1.acceleration_x;
_local1.velocity_y = _local1.velocity_y + _local1.acceleration_y;
_local1._x = _local1._x + _local1.velocity_x;
_local1._y = _local1._y + _local1.velocity_y;
if (_local1._y > _local1.final_position_y) {
if (_local1.remove_piece) {
_local1.onEnterFrame = undefined;
var _local2 = true;
for (var _local3 in _local1._parent) {
if (_local1._parent[_local3].onEnterFrame != undefined) {
_local2 = false;
}
}
if (_local2 && (_local1.regenerate)) {
_local1._parent._parent.initialize_initial_pieces();
} else if (_local2 && (_local1.game_over)) {
_root.gotoAndStop("Game Over");
} else if (_local2) {
trace("NEXT LEVEL");
_local1._parent._parent.initialize_level();
}
_local1.unloadMovie();
} else {
_local1.velocity_y = 0;
_local1._y = _local1.final_position_y;
delete _local1.onEnterFrame;
_local1._parent._parent.check_all_stopped();
}
}
};
PieceClass.prototype.wait_to_fall = function () {
var _local1 = this;
if ((_local1.current_frame++) >= _local1.num_wait_frames) {
_local1.onEnterFrame = _local1.fall_to_position;
}
};
PieceClass.prototype.onMouseDown = function () {
var _local1 = this;
if (_local1.hitTest(_root._xmouse, _root._ymouse, true)) {
_local1._parent._parent.clicked_piece(_local1);
}
};
PieceClass.prototype.slide_new_position = function () {
var _local1 = this;
_local1._x = _local1._x + ((_local1.final_position_x - _local1._x) / 4);
_local1._y = _local1._y + ((_local1.final_position_y - _local1._y) / 4);
if ((Math.abs(_local1._x - _local1.final_position_x) <= 1) && (Math.abs(_local1._y - _local1.final_position_y) <= 1)) {
_local1.callback();
}
};
PieceClass.prototype.onRollOver = function () {
var _local1 = this;
if (_local1.pieces.sub._currentframe != 1) {
} else if (_local1.pieces.sub._currentlabel != "Clicked Animation") {
_local1._parent._parent.last_clicked_time = getTimer();
_local1.pieces.sub.mouseOver = true;
_local1.pieces.sub._gotoAndPlay("Rollover Animation");
}
};
PieceClass.prototype.onRollOut = function () {
if (this.pieces.sub._currentlabel != "Clicked Animation") {
this.pieces.sub.mouseOver = false;
}
};
#endinitclip
Symbol 132 MovieClip [TextfieldExtensions] Frame 1
#initclip 1
TextField.prototype.scrollToNumber = function (goToNumber, speed) {
var _local1 = this;
_local1.current_num = Number(_local1.text);
_local1.goToNumber = goToNumber;
if (_local1.scroller_interval != undefined) {
clearInterval(_local1.scroller_interval);
}
_local1.scroller_interval = setInterval(_local1.incrementNumber, speed, _local1);
};
Textfield.prototype.incrementNumber = function (_txt) {
var _local1 = _txt;
if (Number(_local1.text) < Number(_local1.goToNumber)) {
_local1.text = Math.floor(Number(_local1.text) + 1);
} else {
_local1.text = Math.floor(Number(_local1.text) - 1);
}
if (Number(_local1.text) == Number(_local1.goToNumber)) {
clearInterval(_local1.scroller_interval);
_local1.scroller_interval = undefined;
}
};
#endinitclip
Symbol 133 MovieClip [ObjectExtensions] Frame 1
#initclip 4
Object.prototype.swap = function (a, b) {
var _local1 = this;
var _local2 = _local1[a];
_local1[a] = _local1[b];
_local1[b] = _local2;
};
#endinitclip
Symbol 136 MovieClip [points_animation] Frame 16
this.unloadMovie();
Symbol 154 MovieClip Frame 1
stop();
Instance of Symbol 153 MovieClip "swfloader" in Symbol 154 MovieClip Frame 1
onClipEvent (load) {
function strip_spaces(str) {
var _local2 = str;
var _local3 = new String("");
var _local1 = 0;
while (_local1 < _local2.length) {
if ((_local2.charAt(_local1) != " ") && (_local2.charAt(_local1) != ";")) {
_local3 = _local3 + _local2.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 timeline_action = _local3.pop();
var first_paren = timeline_action.indexOf("(");
var second_paren = timeline_action.indexOf(")");
var timeline_function = timeline_action.substr(0, first_paren);
var function_parameter = timeline_action.substr(first_paren + 1, second_paren - (first_paren + 1));
var _local2 = timeline;
var _local1 = 0;
while (_local1 < _local3.length) {
_local2 = _local2[_local3[_local1]];
_local1++;
}
if (function_parameter.indexOf("\"") != -1) {
function_parameter = function_parameter.substr(1, function_parameter.length - 2);
}
_local2[timeline_function](function_parameter);
}
}
function execute_action() {
var _local1 = _parent;
unloaded = true;
_local1._visible = false;
simple_script(_local1.play_action_val, _local1);
}
_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();
}
}
Instance of Symbol 157 MovieClip "script" in Symbol 158 MovieClip Frame 1
onClipEvent (load) {
_root.eyeland_hs_highscore_url = _parent.highscore_url;
_root.eyeland_hs_game_id = _parent.game_id;
_root.eyeland_hs_score_variable = _parent.score_variable;
_root.eyeland_hs_button_label = _parent.button_label;
}
Symbol 167 Button
on (release) {
this.play();
}
Symbol 184 Button
on (press) {
this.gotoAndStop(1);
}
Symbol 191 Button
on (press) {
this.gotoAndStop(2);
}
Symbol 193 MovieClip Frame 1
stop();
_root.game_type = "Normal";
Symbol 193 MovieClip Frame 2
_root.game_type = "Timer";
Symbol 196 Button
on (release) {
this.play();
}
Symbol 204 MovieClip Frame 1
this._stop();
Symbol 204 MovieClip Frame 2
this._stop();
Symbol 204 MovieClip Frame 3
this._stop();
Symbol 204 MovieClip Frame 4
this._stop();
Symbol 204 MovieClip Frame 5
this._stop();
Symbol 208 MovieClip Frame 1
this._visible = false;
Symbol 214 MovieClip Frame 1
stop();
Symbol 215 MovieClip Frame 1
stop();
Symbol 224 Button
on (press) {
_root.gotoAndStop("Starting Screen");
}
Symbol 229 Button
on (press) {
if (_parent.paused_prompt._currentframe != 1) {
return(undefined);
}
_parent.pause_game();
this.nextFrame();
}
Symbol 231 Button
on (press) {
if (_parent.paused_prompt._currentframe != 22) {
return(undefined);
}
_parent.unpause_game();
this.prevFrame();
}
Symbol 232 MovieClip Frame 1
stop();
Symbol 234 Button
on (press) {
nextFrame();
}
Symbol 236 Button
on (press) {
prevFrame();
}
Symbol 237 MovieClip Frame 1
stop();
delete this.onEnterFrame;
Symbol 237 MovieClip Frame 2
this.onEnterFrame = function () {
stopAllSounds();
};
Symbol 239 Button
on (press) {
var grid = this.get_current_grid();
var j = 0;
while (j < this.num_rows) {
var k = 0;
while (k < this.num_columns) {
var neighbors = this.get_neighbors(j, k);
if (this.check_possible_swaps(grid, j, k, neighbors)) {
var _mc = this.piece_holder[(("piece_" + j) + "_") + k];
_mc.onRollOver();
_mc.onRollOut();
this.score = this.score - 25;
return(undefined);
}
k++;
}
j++;
}
}
Symbol 255 Button
on (press) {
_parent._parent.evaluate_answer(this);
}
Symbol 275 MovieClip Frame 1
stop();
Symbol 275 MovieClip Frame 22
stop();
_parent.fill_quiz_form();
Symbol 275 MovieClip Frame 59
this._gotoAndStop(1);
Symbol 275 MovieClip Frame 96
this._gotoAndStop(1);
Symbol 290 MovieClip Frame 60
this._gotoAndStop(1);
Symbol 304 MovieClip Frame 1
stop();
Symbol 304 MovieClip Frame 75
this._gotoAndStop(1);
Symbol 317 MovieClip Frame 1
stop();
Symbol 317 MovieClip Frame 22
stop();
Symbol 330 MovieClip Frame 1
stop();
Symbol 330 MovieClip Frame 120
this._gotoAndStop(1);
Symbol 331 MovieClip [DiamondMineComponent] Frame 1
#initclip 7
DiamondMine = function () {
if (this._name != undefined) {
this.initialize();
}
};
DiamondMine.prototype = new MovieClip();
Object.registerClass("DiamondMineComponent", DiamondMine);
DiamondMine.prototype.initialize = function () {
var _local1 = this;
_local1.load_quiz_data();
_local1.initialize_variables();
_local1.initialize_graphics();
_local1.initialize_level();
};
DiamondMine.prototype.load_quiz_data = function () {
var _local1 = this;
_local1.quiz_loader = new LoadVars();
_local1.quiz_loader.load(_local1.quiz_data_file);
_local1.quiz_loader.onLoad = function () {
var _local2 = this;
_local2.loaded_successfully = arguments[0];
_local2.num_choices_per_question = Number(_local2.num_choices_per_question);
_local2.questions = new Array();
var _local1 = 0;
while (_local1 >= 0) {
if (_local2[("question" + _local1) + "_text"] == undefined) {
break;
}
_local2.questions[_local1] = new Object();
_local2.questions[_local1].text = _local2[("question" + _local1) + "_text"];
_local2.questions[_local1].answer = Number(_local2[("question" + _local1) + "_answer"]);
_local2.questions[_local1].choices = new Array();
var _local3 = 0;
while (_local3 < _local2.num_choices_per_question) {
_local2.questions[_local1].choices[_local3] = _local2[(("question" + _local1) + "_choice") + _local3];
_local3++;
}
_local1++;
}
_local2.current_question_list = _local2.questions.return_copy();
_local2.questions.shuffle();
_local2.current_question_list.shuffle();
};
};
DiamondMine.prototype.initialize_variables = function () {
var _local1 = this;
_local1.depth = 0;
_local1.score = 0;
_local1.piece_width = _local1.piece_holder.play_area._width / _local1.num_columns;
_local1.piece_height = _local1.piece_holder.play_area._height / _local1.num_rows;
_local1.piece = new Array();
_local1.current_level = -1;
_local1.selected_piece0_mc = undefined;
_local1.selected_piece1_mc = undefined;
var _local2 = _local1.attachMovie("PieceComponent", "__TEMP__", 123);
_local1.num_pieces = _local2.pieces._totalframes / 2;
_local2.removeMovieClip();
_local1.paused = false;
_local1.shaking_mc = undefined;
_local1.sounds_on = true;
_local1.level_questions_maxed = false;
_local1.num_asked_questions = 0;
};
DiamondMine.prototype.initialize_graphics = function () {
};
DiamondMine.prototype.initialize_level = function () {
var _local1 = this;
_local1.current_level++;
_local1.time_percentage = 50;
_local1.level_prompt._play();
_local1.level_prompt.field = ("Level " + (_local1.current_level + 1)) + "!";
_local1.initialize_initial_pieces();
_local1.piece_holder.backgrounds._play();
_local1.level_questions_maxed = false;
_local1.num_asked_questions = 0;
_local1.paused = false;
};
DiamondMine.prototype.initialize_initial_pieces = function () {
var _local1 = this;
var grid = _local1.calculate_solutionless_grid();
_local1.pieces = new Array();
var _local3 = _local1.num_rows - 1;
while (_local3 >= 0) {
var _local2 = 0;
while (_local2 < _local1.num_columns) {
if (_local3 == (_local1.num_rows - 1)) {
var prev_y = (((_local1.piece_holder.play_area._y - _local1.piece_holder.play_area._height) + (_local1.num_rows * _local1.piece_height)) - Math.randf(0, 50));
} else {
var prev_y = _local1.piece_holder[(("piece_" + (_local3 + 1)) + "_") + _local2]._y;
}
var initial_position_x = (_local1.piece_holder.play_area._x + (_local2 * _local1.piece_width));
var initial_position_y = ((prev_y - (_local1.piece_height * 2)) - Math.randf(50, 100));
var final_position_x = _local1.calculate_final_position(_local3, _local2).x;
var final_position_y = _local1.calculate_final_position(_local3, _local2).y;
_local1.create_piece(_local3, _local2, initial_position_x, initial_position_y, final_position_x, final_position_y, grid[_local3][_local2]);
_local2++;
}
_local3--;
}
};
DiamondMine.prototype.create_piece = function (index_j, index_k, initial_position_x, initial_position_y, final_position_x, final_position_y, type) {
var _local2 = this;
if (((_local2.use_quiz == "True") && (_local2.quiz_loader.loaded_successfully)) && (!_local2.level_questions_maxed)) {
if (Math.random() <= _local2.quiz_piece_probability) {
var quiz = true;
} else {
var quiz = false;
}
}
var _local1 = _local2.piece_holder.attachMovie("PieceComponent", (("piece_" + index_j) + "_") + index_k, _local2.depth++, {type:type, quiz:quiz});
_local1.index_j = index_j;
_local1.index_k = index_k;
_local1._width = _local2.piece_width;
_local1._height = _local2.piece_height;
_local1._x = initial_position_x;
_local1._y = initial_position_y;
_local1.final_position_x = final_position_x;
_local1.final_position_y = final_position_y;
_local1.acceleration_y = _local2.piece_acceleration;
};
DiamondMine.prototype.clicked_piece = function (piece_mc) {
var _local1 = this;
var _local2 = piece_mc;
if (_local1.paused) {
} else if (_local1.check_for_movement()) {
} else {
_local1.last_clicked_time = getTimer();
if (_local2.selector_mc._currentframe != 1) {
_local1.unselect_piece(_local2);
} else if (_local1.selected_piece0_mc != undefined) {
_local1.select_piece(_local2);
_local1.evaluate_player_selection();
_local1.play_sound("egg_move_sound");
} else {
_local1.select_piece(_local2);
}
}
};
DiamondMine.prototype.unselect_piece = function (piece_mc, custom_animation) {
var _local1 = piece_mc;
var _local2 = this;
_local1.selector_mc._gotoAndStop(1);
if (!custom_animation) {
_local1.pieces.sub._gotoAndStop("Default");
}
if (_local1 == _local2.selected_piece0_mc) {
_local2.selected_piece0_mc = undefined;
}
if (_local1 == _local2.selected_piece1_mc) {
_local2.selected_piece1_mc = undefined;
}
};
DiamondMine.prototype.select_piece = function (piece_mc) {
var _local1 = piece_mc;
var _local2 = this;
_local1.selector_mc._gotoAndPlay(2);
_local1.pieces.sub._gotoAndPlay("Clicked Animation");
if (_local2.selected_piece0_mc == undefined) {
_local2.selected_piece0_mc = _local1;
} else {
_local2.selected_piece1_mc = _local1;
_local1.selector_mc._gotoAndPlay(_local2.selected_piece0_mc.selector_mc._currentframe);
}
};
DiamondMine.prototype.evaluate_player_selection = function () {
var _local1 = this;
if (_local1.adjacent_selections()) {
_local1.selected_adjacent_pieces();
} else {
_local1.selected_nonadjacent_pieces();
}
};
DiamondMine.prototype.adjacent_selections = function () {
var _local1 = this;
return(((_local1.selected_piece0_mc.index_j == _local1.selected_piece1_mc.index_j) && (Math.abs(_local1.selected_piece0_mc.index_k - _local1.selected_piece1_mc.index_k) == 1)) || ((_local1.selected_piece0_mc.index_k == _local1.selected_piece1_mc.index_k) && (Math.abs(_local1.selected_piece0_mc.index_j - _local1.selected_piece1_mc.index_j) == 1)));
};
DiamondMine.prototype.selected_adjacent_pieces = function () {
var _local1 = this;
_local1.swap_selected_pieces();
_local1.selected_piece0_mc.selector_mc._gotoAndStop(1);
_local1.selected_piece1_mc.selector_mc._gotoAndStop(1);
_local1.selected_piece0_mc.pieces.sub._gotoAndStop("Default");
_local1.selected_piece1_mc.pieces.sub._gotoAndStop("Default");
};
DiamondMine.prototype.swap_selected_pieces = function () {
var _local1 = this;
_local1.swap_selected_indices();
_local1.swap_selected_instance_names();
_local1.selected_piece0_mc.onEnterFrame = _local1.selected_piece0_mc.slide_new_position;
_local1.selected_piece1_mc.onEnterFrame = _local1.selected_piece1_mc.slide_new_position;
_local1.selected_piece0_mc.callback = _local1.piece_sliding_done_before;
_local1.selected_piece1_mc.callback = undefined;
_local1.update_final_position(_local1.selected_piece0_mc);
_local1.update_final_position(_local1.selected_piece1_mc);
};
DiamondMine.prototype.swap_selected_pieces_back = function () {
var _local1 = this;
_local1.swap_selected_pieces();
_local1.selected_piece0_mc.callback = _local1.piece_sliding_done_after;
_local1.selected_piece1_mc.callback = undefined;
var _local3 = _local1.selected_piece0_mc;
var _local2 = _local1.selected_piece1_mc;
if (_local1.selected_piece0_mc.pieces.sub.hasLabel("Wrong Move")) {
_local3.pieces.sub._gotoAndPlay("Wrong Move");
}
if (_local1.selected_piece1_mc.pieces.sub.hasLabel("Wrong Move")) {
_local2.pieces.sub._gotoAndPlay("Wrong Move");
}
_local1.unselect_piece(_local1.selected_piece0_mc, true);
_local1.unselect_piece(_local1.selected_piece1_mc, true);
};
DiamondMine.prototype.swap_selected_indices = function () {
var _local1 = this;
var _local3 = {a:_local1.selected_piece0_mc.index_j, b:_local1.selected_piece1_mc.index_j};
var _local2 = {a:_local1.selected_piece0_mc.index_k, b:_local1.selected_piece1_mc.index_k};
_local3.swap("a", "b");
_local2.swap("a", "b");
_local1.selected_piece0_mc.index_j = _local3.a;
_local1.selected_piece0_mc.index_k = _local2.a;
_local1.selected_piece1_mc.index_j = _local3.b;
_local1.selected_piece1_mc.index_k = _local2.b;
};
DiamondMine.prototype.swap_selected_instance_names = function () {
var _local1 = this;
var _local3 = _local1.selected_piece0_mc._name;
var _local2 = _local1.selected_piece1_mc._name;
_local1.selected_piece0_mc._name = "name0";
_local1.selected_piece1_mc._name = "name1";
_local1.selected_piece0_mc._name = _local2;
_local1.selected_piece1_mc._name = _local3;
};
DiamondMine.prototype.piece_sliding_done_before = function () {
this._parent._parent.evaluate_grid();
};
DiamondMine.prototype.piece_sliding_done_after = function () {
this._parent._parent.stop_all_movement();
};
DiamondMine.prototype.stop_all_movement = function () {
var _local3 = this;
var _local2 = 0;
while (_local2 < _local3.num_rows) {
var _local1 = 0;
while (_local1 < _local3.num_columns) {
_local3.piece_holder[(("piece_" + _local2) + "_") + _local1].onEnterFrame = undefined;
_local1++;
}
_local2++;
}
};
DiamondMine.prototype.evaluate_grid = function () {
var _local1 = this;
_local1.selected_piece0_mc.onEnterFrame = undefined;
_local1.selected_piece1_mc.onEnterFrame = undefined;
if (_local1.alreadyHasSolution()) {
_local1.handle_solutions();
} else {
if (arguments.length == 0) {
_local1.play_sound("egg_move_sound");
}
_local1.swap_selected_pieces_back();
}
_local1.selected_piece0_mc = undefined;
_local1.selected_piece1_mc = undefined;
};
DiamondMine.prototype.handle_solutions = function () {
var _local2 = this;
var _local1 = _local2.calculate_remove_list();
_local2.update_score(_local1);
_local2.play_remove_animations(_local1);
_local2.shift_pieces_down(_local1);
_local2.add_new_pieces(_local1);
_local2.increase_time_percentage(_local1.length);
_local2.play_sound(["clear_sound0", "clear_sound1", "clear_sound2"].rande());
};
DiamondMine.prototype.increase_time_percentage = function (num_collapsed_pieces) {
var _local1 = this;
if (_local1.game_type == "Timer") {
_local1.time_percentage = _local1.time_percentage + (_local1.collapse_percent_increase + (_local1.level_collapse_percent_change * num_collapsed_pieces));
} else {
_local1.time_percentage = _local1.time_percentage + (_local1.collapse_percent_increase + Math.max((-_local1.level_collapse_percent_change) * num_collapsed_pieces, _local1.minimum_collapse_percent));
}
};
DiamondMine.prototype.calculate_remove_list = function () {
var _local3 = this;
var _local2 = new Array();
var j = 0;
while (j < _local3.num_rows) {
var k = 0;
while (k < _local3.num_columns) {
var _local1 = _local3.get_neighborhood(j, k);
if (((_local1.left.type == _local1.middle.type) && (_local1.middle.type == _local1.right.type)) && (_local1.left.type == _local1.right.type)) {
_local2._push({j:_local1.left.index_j, k:_local1.left.index_k});
_local2._push({j:_local1.middle.index_j, k:_local1.middle.index_k});
_local2._push({j:_local1.right.index_j, k:_local1.right.index_k});
} else if (((_local1.top.type == _local1.middle.type) && (_local1.middle.type == _local1.bottom.type)) && (_local1.top.type == _local1.bottom.type)) {
_local2._push({j:_local1.top.index_j, k:_local1.top.index_k});
_local2._push({j:_local1.middle.index_j, k:_local1.middle.index_k});
_local2._push({j:_local1.bottom.index_j, k:_local1.bottom.index_k});
}
k++;
}
j++;
}
return(_local2.remove_repeats());
};
DiamondMine.prototype.play_remove_animations = function (remove_list) {
var quiz_piece = false;
var _local2 = 0;
while (_local2 < remove_list.length) {
var index_j = remove_list[_local2].j;
var _local3 = remove_list[_local2].k;
var _local1 = this.piece_holder[(("piece_" + index_j) + "_") + _local3];
_local1.IAMDEAD = true;
_local1._name = "__TEMP__" + Math.randi(0, 10000);
_local1.pieces.sub._gotoAndPlay("Remove Animation");
if (_local1.quiz) {
quiz_piece = true;
}
_local1._x = -1000;
_local1._y = -1000;
_local1._visible = false;
_local1.removeMovieClip();
_local2++;
}
if (quiz_piece && (!this.level_questions_maxed)) {
this.create_quiz();
}
};
DiamondMine.prototype.create_quiz = function () {
var _local1 = this;
if (_local1.new_board_prompt.playing) {
} else if (_local1.quiz_prompt._currentframe != 1) {
} else {
_local1.paused = true;
_local1.quiz_prompt._play();
_local1.quiz_prompt.swapDepths(_local1.depth + 5000);
_local1.num_asked_questions++;
if (_local1.num_asked_questions >= _local1.max_quiz_per_level) {
_local1.level_questions_maxed = true;
var j = 0;
while (j < _local1.num_rows) {
var _local3 = 0;
while (_local3 < _local1.num_columns) {
var _local2 = _local1.piece_holder[(("piece_" + j) + "_") + _local3];
if (_local2.pieces._currentframe > _local1.num_pieces) {
_local2.pieces.gotoAndStop(_local2.pieces._currentframe - _local1.num_pieces);
}
_local3++;
}
j++;
}
}
}
};
DiamondMine.prototype.fill_quiz_form = function () {
var _local3 = this;
if (_local3.quiz_loader.current_question_list.length == 0) {
_local3.quiz_loader.current_question_list = _local3.quiz_loader.questions.return_copy();
_local3.quiz_loader.current_question_list.shuffle();
}
var question = _local3.quiz_loader.current_question_list.pop();
_local3.quiz_prompt.question = question.text;
var _local1 = 0;
while (_local1 < _local3.quiz_loader.num_choices_per_question) {
var _local2 = _local3.quiz_prompt["choice" + _local1];
_local2.choice = String.fromCharCode("A".charCodeAt(0) + _local1);
_local2.field = question.choices[_local1];
if (_local1 == question.answer) {
_local2.correct = true;
}
_local1++;
}
};
DiamondMine.prototype.evaluate_answer = function (choice_mc) {
var _local1 = this;
_local1.paused = false;
if (choice_mc.correct) {
_local1.correct_answer();
} else {
_local1.incorrect_answer();
}
};
DiamondMine.prototype.correct_answer = function () {
var _local1 = this;
_local1.score = _local1.score + _local1.correct_points;
_local1.score_txt.scrollToNumber(Math.round(_local1.score), 10);
_local1.quiz_prompt._gotoAndPlay("Correct Answer");
};
DiamondMine.prototype.incorrect_answer = function () {
var _local1 = this;
_local1.score = _local1.score + _local1.incorrect_points;
_local1.score_txt.scrollToNumber(Math.round(_local1.score), 10);
_local1.quiz_prompt._gotoAndPlay("Incorrect Answer");
};
DiamondMine.prototype.shift_pieces_down = function (remove_list) {
var _local2 = this;
var shift_columns = _local2.get_shifted_columns(remove_list);
var k = 0;
while (k < shift_columns.length) {
var j = (_local2.num_rows - 2);
while (j >= 0) {
var _local1 = _local2.piece_holder[(("piece_" + j) + "_") + shift_columns[k]];
if (_local1 != undefined) {
var _local3 = false;
while (!_local3) {
if ((_local2.piece_holder[(("piece_" + (_local1.index_j + 1)) + "_") + _local1.index_k] == undefined) && ((_local1.index_j + 1) < _local2.num_rows)) {
_local1.index_j++;
_local1._name = (("piece_" + _local1.index_j) + "_") + _local1.index_k;
_local1.final_position_x = _local2.calculate_final_position(_local1.index_j, _local1.index_k).x;
_local1.final_position_y = _local2.calculate_final_position(_local1.index_j, _local1.index_k).y;
_local1.onEnterFrame = _local1.fall_to_position;
} else {
_local3 = true;
}
}
}
j--;
}
k++;
}
};
DiamondMine.prototype.get_shifted_columns = function (remove_list) {
var _local2 = remove_list;
var _local3 = new Array();
var _local1 = 0;
while (_local1 < _local2.length) {
_local3._push(_local2[_local1].k);
_local1++;
}
return(_local3.remove_repeats());
};
DiamondMine.prototype.get_minimum_rows = function (columns, remove_list) {
var _local2 = remove_list;
var min_rows = new Array();
var j = 0;
while (j < columns.length) {
var c = columns[j];
var _local3 = Number.MAX_VALUE;
var _local1 = 0;
while (_local1 < _local2.length) {
if (_local2[_local1].k == c) {
if (_local2[_local1].j <= _local3) {
_local3 = _local2[_local1].j;
}
}
_local1++;
}
min_rows[j] = _local3;
j++;
}
return(min_rows);
};
DiamondMine.prototype.get_num_column_pieces = function (shift_columns, remove_list) {
var _local3 = remove_list;
var num_pieces = new Array();
var _local2 = 0;
while (_local2 < shift_columns.length) {
num_pieces[_local2] = 0;
var _local1 = 0;
while (_local1 < _local3.length) {
if (_local3[_local1].k == shift_columns[_local2]) {
num_pieces[_local2]++;
}
_local1++;
}
_local2++;
}
return(num_pieces);
};
DiamondMine.prototype.shift_above_pieces = function (minimum_rows, shift_columns, num_columns_pieces) {
var _local2 = 0;
while (_local2 < shift_columns.length) {
var _local3 = minimum_rows[_local2] - 1;
while (_local3 >= 0) {
var _local1 = this.piece_holder[(("piece_" + _local3) + "_") + shift_columns[_local2]];
_local1.index_j = _local1.index_j + num_columns_pieces[_local2];
_local1._name = (("piece_" + _local1.index_j) + "_") + _local1.index_k;
_local1.final_position_x = this.calculate_final_position(_local1.index_j, _local1.index_k).x;
_local1.final_position_y = this.calculate_final_position(_local1.index_j, _local1.index_k).y;
_local1.onEnterFrame = _local1.fall_to_position;
_local3--;
}
_local2++;
}
};
DiamondMine.prototype.add_new_pieces = function (remove_list) {
var _local1 = this;
var j = 0;
while (j < _local1.num_rows) {
var _local2 = 0;
while (_local2 < _local1.num_columns) {
var _mc = _local1.piece_holder[(("piece_" + j) + "_") + _local2];
if (_mc == undefined) {
var _local3 = j;
while (_local3 < _local1.num_rows) {
var piece_mc = _local1.piece_holder[(("piece_" + _local3) + "_") + _local2];
if (piece_mc != undefined) {
var bottom = _local3;
break;
}
_local3++;
}
var initial_position_x = (_local1.piece_holder.play_area._x + (_local2 * _local1.piece_width));
var initial_position_y = (((-_local1.piece_height) * 0) - ((bottom - j) * _local1.piece_height));
var final_position_x = _local1.calculate_final_position(j, _local2).x;
var final_position_y = _local1.calculate_final_position(j, _local2).y;
_local1.create_piece(j, _local2, initial_position_x, initial_position_y, final_position_x, final_position_y, Math.randi(1, _local1.num_pieces + 1));
}
_local2++;
}
j++;
}
};
DiamondMine.prototype.selected_nonadjacent_pieces = function () {
var _local1 = this;
_local1.unselect_piece(_local1.selected_piece0_mc);
_local1.unselect_piece(_local1.selected_piece1_mc);
};
DiamondMine.prototype.hasSolution = function () {
return(this.alreadyHasSolution());
};
DiamondMine.prototype.alreadyHasSolution = function () {
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
var _local1 = this.get_neighborhood(_local3, _local2);
if ((((_local1.left.type == _local1.middle.type) && (_local1.middle.type == _local1.right.type)) && (_local1.left.type == _local1.right.type)) || (((_local1.top.type == _local1.middle.type) && (_local1.middle.type == _local1.bottom.type)) && (_local1.top.type == _local1.bottom.type))) {
return(true);
}
_local2++;
}
_local3++;
}
return(false);
};
DiamondMine.prototype.hasPossibleSolution = function () {
var _local3 = this;
var grid = _local3.get_current_grid();
var _local2 = 0;
while (_local2 < _local3.num_rows) {
var _local1 = 0;
while (_local1 < _local3.num_columns) {
var neighbors = _local3.get_neighbors(_local2, _local1);
if (_local3.check_possible_swaps(grid, _local2, _local1, neighbors)) {
return(true);
}
_local1++;
}
_local2++;
}
return(false);
};
DiamondMine.prototype.get_neighbors = function (j, k) {
var _local1 = k;
var _local2 = j;
var _local3 = this;
if ((_local2 == 0) && (_local1 == 0)) {
return([[_local2 + 1, _local1], [_local2, _local1 + 1]]);
}
if ((_local2 == 0) && (_local1 == (_local3.num_columns - 1))) {
return([[_local2 + 1, _local1], [_local2, _local1 - 1]]);
}
if ((_local2 == (_local3.num_rows - 1)) && (_local1 == 0)) {
return([[_local2 - 1, _local1], [_local2, _local1 + 1]]);
}
if ((_local2 == (_local3.num_rows - 1)) && (_local1 == (_local3.num_columns - 1))) {
return([[_local2 - 1, _local1], [_local2, _local1 - 1]]);
}
if (_local2 == 0) {
return([[_local2, _local1 - 1], [_local2, _local1 + 1], [_local2 + 1, _local1]]);
}
if (_local1 == 0) {
return([[_local2 - 1, _local1], [_local2 + 1, _local1], [_local2, _local1 + 1]]);
}
if (_local2 == (_local3.num_rows - 1)) {
return([[_local2, _local1 - 1], [_local2, _local1 + 1], [_local2 - 1, _local1]]);
}
if (_local1 == (_local3.num_columns - 1)) {
return([[_local2 - 1, _local1], [_local2 + 1, _local1], [_local2, _local1 - 1]]);
}
return([[_local2 - 1, _local1], [_local2 + 1, _local1], [_local2, _local1 - 1], [_local2, _local1 + 1]]);
};
DiamondMine.prototype.check_possible_swaps = function (grid, j, k, neighbors) {
var _local2 = grid;
var _local3 = k;
var _local1 = 0;
while (_local1 < neighbors.length) {
_local2.swap2D(j, _local3, neighbors[_local1][0], neighbors[_local1][1]);
if (this.gridHasNeighborhoodSolution(_local2, j, _local3)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(_local2, j + 1, _local3)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(_local2, j - 1, _local3)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(_local2, j, _local3 + 1)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(_local2, j, _local3 - 1)) {
return(true);
}
_local2.swap2D(j, _local3, neighbors[_local1][0], neighbors[_local1][1]);
_local1++;
}
return(false);
};
DiamondMine.prototype.get_current_grid = function () {
var _local3 = this;
var grid = new Array();
var _local2 = 0;
while (_local2 < _local3.num_rows) {
grid[_local2] = new Array();
var _local1 = 0;
while (_local1 < _local3.num_columns) {
grid[_local2][_local1] = _local3.piece_holder[(("piece_" + _local2) + "_") + _local1].type;
_local1++;
}
_local2++;
}
return(grid);
};
DiamondMine.prototype.gridHasSolution = function (grid) {
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
var _local1 = new Object();
_local1.left = grid[_local3][_local2 - 1];
_local1.right = grid[_local3][_local2 + 1];
_local1.top = grid[_local3 - 1][_local2];
_local1.bottom = grid[_local3 + 1][_local2];
_local1.middle = grid[_local3][_local2];
if ((((_local1.left == _local1.middle) && (_local1.middle == _local1.right)) && (_local1.left == _local1.right)) || (((_local1.top == _local1.middle) && (_local1.middle == _local1.bottom)) && (_local1.top == _local1.bottom))) {
return(true);
}
_local2++;
}
_local3++;
}
return(false);
};
DiamondMine.prototype.gridHasNeighborhoodSolution = function (grid, j, k) {
var _local2 = grid;
var _local3 = k;
if (_local2[j][_local3] == undefined) {
return(false);
}
var _local1 = new Object();
_local1.left = _local2[j][_local3 - 1];
_local1.right = _local2[j][_local3 + 1];
_local1.top = _local2[j - 1][_local3];
_local1.bottom = _local2[j + 1][_local3];
_local1.middle = _local2[j][_local3];
if ((((_local1.left == _local1.middle) && (_local1.middle == _local1.right)) && (_local1.left == _local1.right)) || (((_local1.top == _local1.middle) && (_local1.middle == _local1.bottom)) && (_local1.top == _local1.bottom))) {
return(true);
}
return(false);
};
DiamondMine.prototype.update_final_position = function (piece_mc) {
var _local1 = piece_mc;
var _local2 = this.calculate_final_position(_local1.index_j, _local1.index_k);
_local1.final_position_x = _local2.x;
_local1.final_position_y = _local2.y;
};
DiamondMine.prototype.calculate_final_position = function (j, k) {
var _local2 = this;
var _local1 = {};
_local1.x = _local2.piece_holder.play_area._x + (k * _local2.piece_width);
_local1.y = _local2.piece_holder.play_area._y + (j * _local2.piece_height);
return(_local1);
};
DiamondMine.prototype.calculate_solutionless_grid = function () {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < this.num_rows) {
_local3[_local2] = new Array();
var _local1 = 0;
while (_local1 < this.num_columns) {
var left = _local3[_local2][_local1 - 1];
var right = _local3[_local2][_local1 + 1];
var top = _local3[_local2 - 1][_local1];
var bottom = _local3[_local2 + 1][_local1];
var possibilities = Array.getIndices(1, this.num_pieces);
var non_possibilities = [left, right, top, bottom];
var different_pieces = Array.negated_intersection(possibilities, non_possibilities);
_local3[_local2][_local1] = different_pieces.rande();
_local1++;
}
_local2++;
}
return(_local3);
};
DiamondMine.prototype.get_neighborhood = function (j, k) {
var _local2 = this;
var _local3 = k;
var _local1 = new Array();
_local1.middle = _local2.piece_holder[(("piece_" + j) + "_") + _local3];
_local1.left = _local2.piece_holder[(("piece_" + j) + "_") + (_local3 - 1)];
_local1.right = _local2.piece_holder[(("piece_" + j) + "_") + (_local3 + 1)];
_local1.top = _local2.piece_holder[(("piece_" + (j - 1)) + "_") + _local3];
_local1.bottom = _local2.piece_holder[(("piece_" + (j + 1)) + "_") + _local3];
return(_local1);
};
DiamondMine.prototype.check_for_movement = function () {
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local1 = 0;
while (_local1 < this.num_columns) {
var _local2 = this.piece_holder[(("piece_" + _local3) + "_") + _local1];
if (_local2.onEnterFrame != undefined) {
return(true);
}
_local1++;
}
_local3++;
}
return(false);
};
DiamondMine.prototype.check_all_stopped = function () {
var _local1 = this;
if (!_local1.check_for_movement()) {
_local1.evaluate_grid(0);
var _local2 = _local1.hasPossibleSolution();
if (!_local2) {
if (_local1.game_type == "Timer") {
_local1.new_board();
} else {
_local1.game_over();
}
}
}
};
DiamondMine.prototype.game_over = function () {
var _local3 = this;
var _local2 = 0;
while (_local2 < _local3.num_rows) {
var _local1 = 0;
while (_local1 < _local3.num_columns) {
_local3.piece_holder[(("piece_" + _local2) + "_") + _local1].game_over = true;
_local1++;
}
_local2++;
}
_local3.explode_pieces();
_local3.game_over_prompt._play();
};
DiamondMine.prototype.onEnterFrame = function () {
var _local2 = this;
if (((getTimer() - _local2.last_clicked_time) > 100000000000) && (!_local2.check_for_movement())) {
_local2.last_clicked_time = getTimer();
var grid = _local2.get_current_grid();
var _local3 = 0;
while (_local3 < _local2.num_rows) {
var _local1 = 0;
while (_local1 < _local2.num_columns) {
var neighbors = _local2.get_neighbors(_local3, _local1);
if (_local2.check_possible_swaps(grid, _local3, _local1, neighbors)) {
var _mc = _local2.piece_holder[(("piece_" + _local3) + "_") + _local1];
_mc.onRollOver(123456789);
_mc.onRollOut(123456789);
return;
}
_local1++;
}
_local3++;
}
}
_local2.update_game_timer();
_local2.update_game_properties();
};
DiamondMine.prototype.update_game_timer = function () {
var _local1 = this;
_local1.old_time_percentage = _local1.time_percentage;
if (((_local1.game_type == "Timer") && (!_local1.paused)) && (_global.__NEW_BOARD_PROMPT__ != true)) {
_local1.time_percentage = _local1.time_percentage - (_local1.time_percent_change + (_local1.level_percent_change_increase * _local1.current_level));
}
if (_local1.time_percentage < 10) {
if (_local1.warn_sound == undefined) {
_local1.warn_sound = new Sound();
_local1.warn_sound.attachSound("warning");
_local1.warn_sound.start();
_local1.warning_sound_start = getTimer();
}
if (getTimer() > (_local1.warning_sound_start + 1000)) {
_local1.warn_sound.stop();
_local1.warn_sound.start();
_local1.warning_sound_start = getTimer();
}
_local1.timer_mc.frame_mc.play();
} else {
_local1.timer_mc.frame_mc.gotoAndStop(1);
}
_local1.render_game_timer();
};
DiamondMine.prototype.render_game_timer = function () {
var _local1 = this;
var _local2 = (_local1.time_percentage / 100) * _local1.timer_mc.frame_mc._width;
_local1.timer_mc.bar_mc._x = _local1.timer_mc.bar_mc._x + ((_local2 - _local1.timer_mc.bar_mc._x) / 10);
_local1.timer_mc.bar_mc._gotoAndStop(Math.round((_local1.time_percentage / 100) * _local1.timer_mc.bar_mc._totalframes) + 1);
if (_local1.time_percentage >= 100) {
_local1.next_level();
} else if (_local1.time_percentage <= 0) {
_root.sounds_on = _local1.sounds_on;
_root._gotoAndStop("Game Over");
}
};
DiamondMine.prototype.next_level = function () {
var _local2 = this;
for (var _local3 in _local2.piece_holder) {
var _local1 = _local2.piece_holder[_local3];
if (typeof(_local1) == "movieclip") {
if ((_local1._name != "backgrounds") && (_local1._name != "play_area")) {
_local1.removeMovieClip();
}
}
}
_local2.paused = true;
_local2.time_percentage = 50;
_local2.initialize_level();
};
DiamondMine.prototype.explode_pieces = function () {
var _local2 = this;
var j = 0;
while (j < _local2.num_rows) {
var _local3 = 0;
while (_local3 < _local2.num_columns) {
var _local1 = _local2.piece_holder[(("piece_" + j) + "_") + _local3];
_local1.velocity_x = Math.randf(-10, 10);
_local1.velocity_y = Math.randf(-30, -20);
_local1.final_position_y = (_local2.piece_holder.play_area._y + _local2.piece_holder.play_area._height) + _local1._height;
_local1._y = _local1.final_position_y + 100;
_local1.remove_piece = true;
_local1.num_wait_frames = Math.randi(0, 50);
_local1.current_frame = 0;
_local1.swapDepths(_local2.depth++);
_local1._name = "__TEMP__" + Math.randi(0, 10000);
_local1.onEnterFrame = _local1.wait_to_fall;
_local3++;
}
j++;
}
};
DiamondMine.prototype.update_score = function (remove_list) {
var _local1 = this;
var score_increase = (remove_list.length * (_local1.points_per_piece + (_local1.level_point_increase * _local1.current_level)));
_local1.score = _local1.score + score_increase;
_local1.score_txt.scrollToNumber(Math.round(_local1.score), 10);
_local1.depth++;
var _local3 = _local1.attachMovie("points_animation", "points" + _local1.depth, _local1.depth);
var _local2 = remove_list.rande();
_local3._x = _local1.piece_holder[(("piece_" + _local2.j) + "_") + _local2.k]._x;
_local3._y = _local1.piece_holder[(("piece_" + _local2.j) + "_") + _local2.k]._y;
_local3.points = "+" + score_increase;
};
DiamondMine.prototype.update_game_properties = function () {
_root.score = this.score;
};
DiamondMine.prototype.new_board = function () {
var _local2 = this;
var j = 0;
while (j < _local2.num_rows) {
var _local1 = 0;
while (_local1 < _local2.num_columns) {
_local2.piece_holder[(("piece_" + j) + "_") + _local1].regenerate = true;
_local1++;
}
j++;
}
_local2.explode_pieces();
for (var j in _local2.piece_holder) {
var _local3 = _local2.piece_holder[j];
if (typeof(_local3) == "movieclip") {
if (((!_local3.regenerate) && (_local3._name != "backgrounds")) && (_local3._name != "play_area")) {
_local3.removeMovieClip();
}
}
}
_local2.new_board_prompt._play();
};
DiamondMine.prototype.pause_game = function () {
this.paused = true;
this.paused_prompt.play();
};
DiamondMine.prototype.unpause_game = function () {
this.paused = false;
this.paused_prompt.play();
};
DiamondMine.prototype.play_sound = function (linkage) {
if (this.sounds_on == true) {
var _local1 = new Sound(this);
_local1.attachSound(linkage);
_local1.start(0, 1);
}
};
DiamondMine.prototype.onMouseDown = function () {
var _local2 = this;
var _local3 = _root;
_local2.shaking_mc.onRollOut(123456789);
_local2.shaking_mc = undefined;
for (var j in _local2.piece_holder) {
var _local1 = _local2.piece_holder[j];
if ((_local1.hitTest(_local3._xmouse, _local3._ymouse, true) && (_local1._name != "backgrounds")) && (_local1._name != "play_area")) {
}
}
};
#endinitclip
this._x = 0;
this._y = 0;
Instance of Symbol 209 MovieClip "piece_holder" in Symbol 331 MovieClip [DiamondMineComponent] Frame 1
onClipEvent (keyDown) {
if (Key.isDown(16)) {
trace(_parent.hasPossibleSolution());
} else if (Key.isDown(32)) {
for (var j in this) {
if (typeof(this[j]) == "movieclip") {
trace(this[j]);
}
}
}
}
Symbol 335 Button
on (press) {
this.gotoAndPlay("Starting Screen");
}
Symbol 346 MovieClip Frame 40
stop();
Symbol 353 MovieClip Frame 1
stop();
Symbol 363 MovieClip Frame 1
stop();
Symbol 363 MovieClip Frame 2
stop();
Symbol 363 MovieClip Frame 12
stop();
Symbol 363 MovieClip Frame 22
stop();
Symbol 370 Button
on (press) {
_parent.field.scroll = Math.max(1, _parent.field.scroll - 1);
}
Symbol 373 Button
on (press) {
_parent.field.scroll = Math.min(_parent.field.maxscroll, _parent.field.scroll + 1);
}
Instance of Symbol 157 MovieClip in Symbol 376 MovieClip Frame 1
onClipEvent (load) {
_parent.field.text = _root[_parent.root_var_name];
if (_parent.field.maxscroll > 1) {
_parent.up._visible = true;
_parent.down._visible = true;
} else {
_parent.up._visible = false;
_parent.down._visible = false;
}
}
onClipEvent (enterFrame) {
}
Symbol 378 MovieClip Frame 1
stop();
Symbol 378 MovieClip Frame 2
stop();
Symbol 381 MovieClip Frame 1
stop();
Symbol 381 MovieClip Frame 2
stop();
Instance of Symbol 376 MovieClip in Symbol 381 MovieClip Frame 2
//component parameters
onClipEvent (initialize) {
root_var_name = "eyeland_hs_currentmessage";
}
Symbol 381 MovieClip Frame 10
stop();
Symbol 381 MovieClip Frame 21
stop();
Symbol 381 MovieClip Frame 34
stop();
Symbol 381 MovieClip Frame 47
stop();
Instance of Symbol 376 MovieClip in Symbol 381 MovieClip Frame 47
//component parameters
onClipEvent (initialize) {
root_var_name = "eyeland_hs_currentmessage";
}
Symbol 390 Button
on (release) {
_root.eyeland_hs_p = (_root.eyeland_hs_e = "");
_root.eyeland_hs_p = _parent.enter_screens.field_name.holder.name;
_root.eyeland_hs_e = _parent.enter_screens.field_email.holder.email;
_parent.gotoAndPlay("save");
}
Symbol 393 Button
on (release) {
_parent.gotoAndPlay("load");
}
Symbol 398 Button
on (release) {
btn_press();
}
Symbol 401 Button
on (release) {
_root._quality = _root.eyeland_hs_quality;
_parent._parent.play();
}
Symbol 404 MovieClip Frame 1
stop();
Symbol 404 MovieClip Frame 2
stop();
Symbol 404 MovieClip Frame 3
stop();
Symbol 435 MovieClip Frame 1
stop();
Symbol 435 MovieClip Frame 25
stop();
Symbol 435 MovieClip Frame 47
stop();
Symbol 435 MovieClip Frame 66
stop();
Symbol 435 MovieClip Frame 82
stop();
Symbol 435 MovieClip Frame 102
stop();
Instance of Symbol 435 MovieClip "line" in Symbol 436 MovieClip Frame 1
onClipEvent (load) {
if (this._name == "line") {
this._visible = false;
}
}
Symbol 440 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, releaseOutside) {
if (!_parent._parent.script.draggable) {
return(undefined);
}
this.stopDrag();
_parent._parent.script.drag = false;
}
Symbol 444 Button
on (press) {
_parent._parent.script.pressup = (_parent._parent.script.moveup = true);
}
on (release, releaseOutside) {
_parent._parent.script.pressup = false;
}
Symbol 447 Button
on (press) {
_parent._parent.script.pressdown = (_parent._parent.script.movedown = true);
}
on (release, releaseOutside) {
_parent._parent.script.pressdown = false;
}
Symbol 455 MovieClip Frame 1
stop();
Symbol 466 MovieClip Frame 1
function rand_str() {
var _local3 = "";
var len = 10;
var _local2 = "abcdefghijklmnopqrstuvwxyz";
var _local1 = 0;
while (_local1 < len) {
_local3 = _local3 + _local2.charAt(Math.floor(Math.random() * _local2.length));
_local1++;
}
return(_local3);
}
function rhex(num) {
var _local1 = num;
str = "";
j = 0;
while (j <= 3) {
str = str + (hex_chr.charAt((_local1 >> ((j * 8) + 4)) & 15) + hex_chr.charAt((_local1 >> (j * 8)) & 15));
j++;
}
return(str);
}
function str2blks_MD5(str) {
var _local1 = str;
nblk = ((_local1.length + 8) >> 6) + 1;
blks = new Array(nblk * 16);
i = 0;
while (i < (nblk * 16)) {
blks[i] = 0;
i++;
}
i = 0;
while (i < _local1.length) {
blks[i >> 2] = blks[i >> 2] | (_local1.charCodeAt(i) << ((i % 4) * 8));
i++;
}
blks[i >> 2] = blks[i >> 2] | (128 << ((i % 4) * 8));
blks[(nblk * 16) - 2] = _local1.length * 8;
return(blks);
}
function add2(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 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) {
var _local1 = b;
return(cmn((_local1 & c) | ((~_local1) & d), a, _local1, 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";
var challenged = false;
_root.eyeland_hs_players = new Array();
_parent.stop();
stop();
Instance of Symbol 157 MovieClip "loader" in Symbol 466 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_harvest_all_emails = harvest_all_emails;
_root.eyeland_hs_emailpromptmessage = unescape(emailpromptmessage);
_root.eyeland_hs_lowscoremessage = lowscoremessage;
_root.eyeland_hs_maxchars = Number(maxchars);
_parent.gotoAndPlay("enter");
}
Symbol 466 MovieClip Frame 12
function show_prompt(high) {
var _local1 = _root;
btn_submit._visible = true;
btn_skip._visible = true;
if (high) {
_local1.eyeland_hs_currentmessage = _local1.eyeland_hs_emailpromptmessage;
} else {
_local1.eyeland_hs_currentmessage = _local1.eyeland_hs_lowscoremessage.split("%").join(_local1.eyeland_hs_lowscore);
}
if (_local1.eyeland_hs_maxchars > 0) {
if ((_local1.eyeland_hs_recordplayeremail == "yes") || (_local1.eyeland_hs_harvest_all_emails == "yes")) {
enter_screens.gotoAndPlay("enter_email");
enter_screens.field_email.holder.gotoAndPlay("field");
} else {
enter_screens.gotoAndPlay("enter");
}
if (_local1.eyeland_hs_maxchars == 3) {
enter_screens.name_label.gotoAndStop(2);
}
enter_screens.field_name.holder.gotoAndPlay("name" + _local1.eyeland_hs_maxchars);
} else if ((_local1.eyeland_hs_recordplayeremail == "yes") || (_local1.eyeland_hs_harvest_all_emails == "yes")) {
enter_screens.gotoAndPlay("enter_email_only");
enter_screens.field_email.holder.gotoAndPlay("field");
} else {
if (high) {
_local1.eyeland_hs_currentmessage = _local1.eyeland_hs_nonamemessage;
}
enter_screens.gotoAndPlay("message_only");
}
}
_root.eyeland_hs_nonamemessage = "You got a high score!\nClick Submit to record your score anonymously.";
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;
btn_challenge._visible = false;
btn_challenge._y = btn_skip._y;
if (_root.eyeland_hs_result == "yes") {
show_prompt(true);
} else if (_root.eyeland_hs_harvest_all_emails == "yes") {
show_prompt(false);
} else {
btn_scores._visible = true;
btn_playagain._visible = true;
if (_root.eyeland_hs_emailtofriend != "no") {
btn_challenge._visible = true;
} else {
btn_scores._x = btn_scores._x + 50;
btn_playagain._x = btn_playagain._x - 50;
}
_root.eyeland_hs_currentmessage = _root.eyeland_hs_lowscoremessage.split("%").join(_root.eyeland_hs_lowscore);
enter_screens.gotoAndPlay("message_only");
}
stop();
Instance of Symbol 400 MovieClip "btn_challenge" in Symbol 466 MovieClip Frame 12
onClipEvent (load) {
function btn_press() {
_parent.gotoAndPlay("chform");
}
}
Instance of Symbol 404 MovieClip "btn_playagain" in Symbol 466 MovieClip Frame 12
onClipEvent (load) {
if (_parent.button_label == "Play Again") {
gotoAndPlay (2);
} else if (_parent.button_label == "Continue") {
gotoAndPlay (3);
}
}
Instance of Symbol 157 MovieClip in Symbol 466 MovieClip Frame 12
onClipEvent (load) {
_parent.score1 = (_parent.score2 = _root[_parent.score_variable]);
}
Symbol 466 MovieClip Frame 22
stop();
Instance of Symbol 157 MovieClip "copy_to_root" in Symbol 466 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 157 MovieClip in Symbol 466 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 466 MovieClip Frame 31
stop();
Instance of Symbol 157 MovieClip in Symbol 466 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(((((_parent.game_id + "-") + score) + "-") + rand) + "...you shall not pass"));
loadVariables (url, _parent.copy_to_root);
}
Symbol 466 MovieClip Frame 40
if (_root.eyeland_hs_emailtofriend == "no") {
chbutton._visible = false;
}
stop();
Instance of Symbol 404 MovieClip "playagain" in Symbol 466 MovieClip Frame 40
onClipEvent (load) {
if (_parent.button_label == "Play Again") {
this.gotoAndPlay(2);
} else {
this.gotoAndPlay(3);
}
}
Instance of Symbol 400 MovieClip "chbutton" in Symbol 466 MovieClip Frame 40
onClipEvent (load) {
function btn_press() {
_parent.gotoAndPlay("chform");
}
}
Instance of Symbol 157 MovieClip "script" in Symbol 466 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;
_parent.clearedmsg = "Your score: " + _root[_parent.score_variable];
if (_root.eyeland_hs_cleardate != "00/00/00") {
_parent.clearedmsg = _parent.clearedmsg + ("\nScore table 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;
if (_parent.challenged) {
_parent.challenged_message.play();
_parent.challenged = false;
}
}
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 466 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!";
yourname = _root.eyeland_hs_p;
stop();
Instance of Symbol 463 MovieClip in Symbol 466 MovieClip Frame 49
onClipEvent (load) {
function btn_press() {
if (_root.eyeland_hs_players.length > 0) {
_parent.gotoAndPlay("show");
} else {
_parent.gotoAndPlay("load");
}
}
}
Instance of Symbol 465 MovieClip in Symbol 466 MovieClip Frame 49
onClipEvent (load) {
function btn_press() {
var _local1 = _parent;
_root.eyeland_hs_friendemail = _local1.friendemail;
_root.eyeland_hs_yourname = _local1.yourname;
_local1.gotoAndPlay("challenge");
}
}
Symbol 466 MovieClip Frame 60
stop();
Instance of Symbol 157 MovieClip "challenge_handler" in Symbol 466 MovieClip Frame 60
onClipEvent (data) {
if (_root.eyeland_hs_players.length > 0) {
_parent.gotoAndPlay("show");
} else {
_parent.gotoAndPlay("load");
}
}
Instance of Symbol 157 MovieClip in Symbol 466 MovieClip Frame 60
onClipEvent (load) {
_parent.challenged = true;
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);
}