Frame 1
var myGameName = "face_chase";
var myDeveloper = "3rdsense";
var myGenre = 5;
var myGameType = 2;
var myThreshold = 1000;
_root.score = 0;
_root.loadComplete = function () {
trace("load comnplete");
_root.gotoAndStop("intro");
};
_root.introComplete = function () {
trace("anim complete");
_root.gotoAndStop("instructions");
};
_root.playAgain = function () {
_root.gotoAndStop("instructions");
};
System.security;
_root.pirateSwitch = function () {
var _local2 = false;
if ((((_root.Stattooz.pPlayer != "External") && (_root.Stattooz.pPlayer != "nopirate")) || (System.capabilities.playerType != "External")) && (myGameType != 1)) {
if (((((((((((!((_url.indexOf("file://") == 0) && (_url.indexOf("development") != -1))) && (_url.indexOf("", 0) != 0)) && (_url.indexOf("", 0) != 0)) && (_url.indexOf("http://www.fizzy.com/", 0) != 0)) && (_url.indexOf("", 0) != 0)) && (_url.indexOf("", 0) != 0)) && (_url.indexOf("", 0) != 0)) && (_url.indexOf("", 0) != 0)) && (_url.indexOf("", 0) != 0)) && (_url.indexOf("", 0) != 0)) && (_url.indexOf("", 0) != 0)) {
}
}
return(_local2);
};
_root.checkPirate = function () {
trace("PIRATE CHECKER");
if (_root.pirateSwitch()) {
_root.reportEvent("pirate");
_root.gotoAndStop("pirate");
} else {
_root.introComplete();
}
};
initialize();
_global.ipb_get_gname = function () {
var _local4 = _root._url;
var _local5 = "";
var _local3 = "";
var _local6 = _local4.lastIndexOf("\\") + 1;
if ((_local6 == -1) || (_local6 == 0)) {
_local6 = _local4.lastIndexOf("/") + 1;
}
var _local2 = _local6;
var _local7 = String(_local4).length;
while (_local2 < String(_local4).length) {
_local3 = _local4.charAt(_local2);
if (_local3 == ".") {
break;
}
_local5 = _local5 + _local3;
_local2++;
}
return(_local5);
};
ipb_gname = _global.ipb_get_gname();
xx = new LoadVars();
xx.onLoad = function (success) {
if (success) {
_global.ipb_scoreVar = this.scoreVar;
}
};
fname = ((("arcade/gamedata/" + ipb_gname) + "/") + ipb_gname) + ".txt";
xx.load(fname);
Frame 10
stop();
Frame 19
stop();
Frame 29
stop();
Frame 39
stop();
Instance of Symbol 310 MovieClip in Frame 39
on (release) {
_root.gotoAndStop("instructions");
}
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
Frame 49
stop();
Instance of Symbol 310 MovieClip in Frame 49
on (release) {
_root.gotoAndStop("instructions");
}
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
Frame 70
stop();
Instance of Symbol 353 MovieClip in Frame 70
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
on (release) {
_root.Stattooz.reportEvent("play");
_root.gotoAndPlay("game");
}
Instance of Symbol 355 MovieClip in Frame 70
on (release) {
_root.gotoAndStop("credits");
}
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
Instance of Symbol 357 MovieClip in Frame 70
on (release) {
_root.gotoAndStop("howto");
}
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
Frame 110
this.myPlayerID.text = _level0.citizen_kane;
game.game_type = _root.game_type;
game.automatic_hint = false;
stop();
_root._quality = "HIGH";
Instance of Symbol 471 MovieClip [DiamondMineComponent] "game" in Frame 110
//component parameters
onClipEvent (construct) {
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 = 520;
points_per_piece = 10;
level_point_increase = 100;
}
Instance of Symbol 259 MovieClip [PieceComponent] in Frame 111
//component parameters
onClipEvent (construct) {
}
Frame 111
_root._quality = "HIGH";
_root.reportEvent("endpass");
gotoAndStop (123);
Frame 121
stop();
_root._quality = "HIGH";
_root.reportEvent("endfail");
Instance of Symbol 496 MovieClip in Frame 121
on (release) {
_root.gotoAndPlay("Instructions");
}
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
Instance of Symbol 259 MovieClip [PieceComponent] in Frame 121
//component parameters
onClipEvent (construct) {
}
Frame 123
stop();
_root._quality = "HIGH";
_root.reportEvent("endpass");
Instance of ? in Frame 123
on (release) {
_root.gotoAndPlay("Instructions");
}
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
Instance of Symbol 259 MovieClip [PieceComponent] in Frame 123
//component parameters
onClipEvent (construct) {
}
Instance of Symbol 502 MovieClip in Frame 123
on (release) {
score = _level0.score;
_root.score = score;
_global.ipbSend(_root.score);
}
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
Symbol 507 MovieClip Frame 1
if (yy.savescore == 1) {
if (ipb_score == undefined) {
ipb_score = eval (_global.ipb_scoreVar);
}
xx = new LoadVars();
xx.arcadegid = _root.ibpro_gameid;
xx.gscore = ipb_score;
xx.gname = _global.ipb_get_gname();
xx.enscore = (ipb_score * yy.randchar) ^ yy.randchar2;
xx.send("index.php?autocom=arcade&do=savescore", "_self", "POST");
stop();
}
_global.ipbSend = function (ipb_score) {
_root._visible = false;
_root.enabled = false;
xx = new LoadVars();
yy = new LoadVars();
xx.sendAndLoad("index.php?autocom=arcade&do=verifyscore", yy, "POST");
};
Symbol 12 MovieClip [MathExtensions] Frame 1
#initclip 8
_global.Math2 = new Object();
_global.Math2.randf = function (a, b) {
return((Math.random() * (b - a)) + a);
};
_global.Math2.randi = function (a, b) {
return(Math.floor(Math.random() * (b - a)) + Math.floor(a));
};
#endinitclip
Symbol 13 MovieClip [ArrayExtensions] Frame 1
#initclip 9
Array.prototype.swap = function (a, b) {
var _local2 = this[a];
this[a] = this[b];
this[b] = _local2;
};
Array.prototype.swap2D = function (a, b, c, d) {
var _local2 = this[a][b];
this[a][b] = this[c][d];
this[c][d] = _local2;
};
Array.prototype.shuffle = function () {
var _local4 = this.length;
var _local3 = 0;
while (_local3 < _local4) {
this.swap(_local3, _global.Math2.randi(0, _local4));
_local3++;
}
};
Array.prototype.rande = function () {
return(this[_global.Math2.randi(0, this.length)]);
};
Array.prototype._push = function (e) {
if (e != undefined) {
this[this.length] = e;
}
};
Array.negated_intersection = function (A, B) {
var _local8 = new Array();
var _local7 = A.length;
var _local6 = B.length;
var _local1 = 0;
while (_local1 < _local7) {
var _local5 = false;
var _local2 = 0;
while (_local2 < _local6) {
if (A[_local1] == B[_local2]) {
_local5 = true;
}
_local2++;
}
if (!_local5) {
_local8._push(A[_local1]);
}
_local1++;
}
var _local2 = 0;
while (_local2 < _local6) {
var _local5 = false;
_local1 = 0;
while (_local1 < _local7) {
if (B[_local2] == A[_local1]) {
_local5 = true;
}
_local1++;
}
if (!_local5) {
_local8._push(B[_local2]);
}
_local2++;
}
return(_local8);
};
Array.prototype.remove_repeats = function () {
var _local5 = new Array();
var _local2 = 0;
while (_local2 < this.length) {
found = false;
var _local3 = 0;
while (_local3 < _local5.length) {
if (typeof(this[_local2]) == "object") {
var _local4 = true;
for (var _local6 in this[_local2]) {
if (this[_local2][_local6] != _local5[_local3][_local6]) {
_local4 = false;
}
}
if (_local4) {
found = true;
}
} else if (this[_local2] == _local5[_local3]) {
found = true;
}
_local3++;
}
if (!found) {
_local5._push(this[_local2]);
}
_local2++;
}
return(_local5);
};
Array.getIndices = function (a, b) {
var _local2 = new Array();
var _local1 = a;
while (_local1 <= b) {
_local2._push(_local1);
_local1++;
}
return(_local2);
};
Array.prototype.return_copy = function () {
var _local3 = new Array();
var _local2 = 0;
while (_local2 < this.length) {
_local3[_local2] = this[_local2];
_local2++;
}
return(_local3);
};
#endinitclip
Symbol 14 MovieClip [MovieClipExtensions] Frame 1
#initclip 5
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) {
this.playing = true;
if (typeof(frame) == "string") {
this._currentlabel = frame;
}
this.gotoAndPlay(frame);
};
MovieClip.prototype._gotoAndStop = function (frame) {
this.playing = false;
if (typeof(frame) == "string") {
this._currentlabel = frame;
}
this.gotoAndStop(frame);
};
MovieClip.prototype.hasLabel = function (label) {
this.duplicateMovieClip("__TEMP__", 97324, {_x:-1, _y:-1, _visible:false, _width:1, _height:1});
new Sound(this._parent.__TEMP__).setVolume(0);
this._parent.__TEMP__.gotoAndStop(label);
var _local3 = this._parent.__TEMP__._currentframe;
this._parent.__TEMP__.nextFrame();
this._parent.__TEMP__.gotoAndStop(label);
var _local4 = this._parent.__TEMP__._currentframe;
var _local2 = _local3 == _local4;
this._parent.__TEMP__.removeMovieClip();
return(_local2);
};
MovieClip.prototype.gotoAndPlayRandom = function () {
this._gotoAndPlay(_global.Math2.randi(1, this._totalframes + 1));
};
MovieClip.prototype.gotoAndStopRandom = function () {
this._gotoAndStop(_global.Math2.randi(1, this._totalframes + 1));
};
#endinitclip
Symbol 15 MovieClip [TextfieldExtensions] Frame 1
#initclip 6
TextField.prototype.scrollToNumber = function (goToNumber, speed) {
this.current_num = Number(this.text);
this.goToNumber = goToNumber;
if (this.scroller_interval != undefined) {
clearInterval(this.scroller_interval);
}
this.scroller_interval = setInterval(this.incrementNumber, speed, this);
};
Textfield.prototype.incrementNumber = function (_txt) {
if (Number(_txt.text) < Number(_txt.goToNumber)) {
_txt.text = Math.floor(Number(_txt.text) + 1);
} else {
_txt.text = Math.floor(Number(_txt.text) - 1);
}
if (Number(_txt.text) == Number(_txt.goToNumber)) {
clearInterval(_txt.scroller_interval);
_txt.scroller_interval = undefined;
}
};
#endinitclip
Symbol 16 MovieClip [ObjectExtensions] Frame 1
#initclip 4
Object.prototype.swap = function (a, b) {
var _local2 = this[a];
this[a] = this[b];
this[b] = _local2;
};
#endinitclip
Symbol 19 MovieClip [points_animation] Frame 16
this.unloadMovie();
Symbol 31 MovieClip [mouth1b] Frame 9
stop();
Symbol 31 MovieClip [mouth1b] Frame 19
stop();
Symbol 31 MovieClip [mouth1b] Frame 29
stop();
Symbol 31 MovieClip [mouth1b] Frame 39
stop();
Symbol 31 MovieClip [mouth1b] Frame 49
stop();
Symbol 31 MovieClip [mouth1b] Frame 60
stop();
Symbol 31 MovieClip [mouth1b] Frame 70
stop();
Symbol 31 MovieClip [mouth1b] Frame 80
stop();
Symbol 31 MovieClip [mouth1b] Frame 90
stop();
Symbol 31 MovieClip [mouth1b] Frame 100
stop();
Symbol 31 MovieClip [mouth1b] Frame 109
stop();
Symbol 42 MovieClip [eyes1b] Frame 9
stop();
Symbol 42 MovieClip [eyes1b] Frame 19
stop();
Symbol 42 MovieClip [eyes1b] Frame 29
stop();
Symbol 42 MovieClip [eyes1b] Frame 39
stop();
Symbol 42 MovieClip [eyes1b] Frame 49
stop();
Symbol 42 MovieClip [eyes1b] Frame 59
stop();
Symbol 42 MovieClip [eyes1b] Frame 69
stop();
Symbol 42 MovieClip [eyes1b] Frame 79
stop();
Symbol 42 MovieClip [eyes1b] Frame 90
stop();
Symbol 42 MovieClip [eyes1b] Frame 100
stop();
Symbol 42 MovieClip [eyes1b] Frame 111
stop();
Symbol 65 MovieClip Frame 10
stop();
Symbol 68 MovieClip [avatarb] Frame 25
if (random(10) > 6) {
this.head.eyes.gotoAndStop("blink");
}
if (random(10) > 8) {
this.head.eyes.gotoAndStop("right");
}
Symbol 68 MovieClip [avatarb] Frame 31
this.head.eyes.gotoAndStop("normal");
Symbol 68 MovieClip [avatarb] Frame 50
gotoAndPlay (1);
Symbol 68 MovieClip [avatarb] Frame 51
this.head.mouth.gotoAndPlay("laugh");
Symbol 68 MovieClip [avatarb] Frame 85
this.head.mouth.gotoAndPlay("happy");
this.myBonusBubble.myBubble._alpha = 0;
Symbol 94 MovieClip Frame 1
this._stop();
if (((_level0.citizen_kane != undefined) && (_level0.citizen_kane != "default")) && (_level0.citizen_kane != "")) {
var myListener = new Object();
myListener.onLoadInit = function (thisClip) {
thisClip._width = this.pWidth;
thisClip._height = this.pHeight;
};
var myLoader = new MovieClipLoader();
var myHolder = this.myFace;
myListener.pWidth = myHolder._width;
myListener.pHeight = myHolder._height;
myLoader.addListener(myListener);
myLoader.loadClip(_level0.citizen_kane, this.myFace, myHolder);
}
Symbol 94 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 94 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 94 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 99 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 18
var me = this._parent._parent;
me._x = -1000;
me._y = -1000;
me._visible = false;
me.unloadMovie();
if (_root.myHandle) {
_root.game.handle_solutions_2();
}
stop();
Symbol 100 MovieClip Frame 1
stop();
Symbol 100 MovieClip Frame 18
gotoAndStop (1);
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 22
gotoAndStop (1);
Symbol 127 MovieClip Frame 1
this._stop();
Symbol 127 MovieClip Frame 22
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 127 MovieClip Frame 37
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 127 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 143 MovieClip Frame 1
this._stop();
Symbol 143 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 143 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 143 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 147 MovieClip Frame 1
this._stop();
Symbol 147 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 147 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 147 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 169 MovieClip Frame 1
this._stop();
Symbol 169 MovieClip Frame 25
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 169 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 169 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 190 MovieClip Frame 1
this._stop();
Symbol 190 MovieClip Frame 28
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 190 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 190 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 209 MovieClip Frame 1
this._stop();
Symbol 209 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 209 MovieClip Frame 37
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 209 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 229 MovieClip Frame 1
this._stop();
Symbol 229 MovieClip Frame 30
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 229 MovieClip Frame 44
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 229 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 250 MovieClip Frame 1
this._stop();
Symbol 250 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 250 MovieClip Frame 36
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 250 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 254 MovieClip Frame 1
this._stop();
Symbol 254 MovieClip Frame 23
if (this.mouseOver) {
this._gotoAndPlay("Rollover Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 254 MovieClip Frame 37
if (this.mouseOver) {
this._gotoAndPlay("Clicked Animation");
} else {
this._gotoAndStop("Default");
}
Symbol 254 MovieClip Frame 62
this._gotoAndStop("Default");
Symbol 255 MovieClip [game_piece] Frame 1
this._stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 2
stop();
Symbol 258 MovieClip Frame 62
this._gotoAndPlay(2);
Symbol 259 MovieClip [PieceComponent] Frame 1
#initclip 7
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 () {
this.velocity_x = 0;
this.velocity_y = 0;
this.acceleration_x = 0;
this.acceleration_y = 0;
this.onEnterFrame = this.fall_to_position;
this.useHandCursor = false;
};
PieceClass.prototype.initialize_graphics = function () {
this.pieces._gotoAndStop(this.type);
if (this.quiz) {
this.pieces._gotoAndStop(this.pieces._currentframe + (this.pieces._totalframes / 2));
}
};
PieceClass.prototype.rattle = function () {
this._x = this.final_position_x + _global.Math2.randf(-5, 5);
this._y = this.final_position_y + _global.Math2.randf(-5, 5);
};
PieceClass.prototype.fall_to_position = function () {
this.velocity_x = this.velocity_x + this.acceleration_x;
this.velocity_y = this.velocity_y + this.acceleration_y;
this._x = this._x + this.velocity_x;
this._y = this._y + this.velocity_y;
if (this._y > this.final_position_y) {
if (this.remove_piece) {
this.onEnterFrame = undefined;
var _local3 = true;
for (var _local4 in this._parent) {
if (this._parent[_local4].onEnterFrame != undefined) {
_local3 = false;
}
}
if (_local3 && (this.regenerate)) {
this._parent._parent.initialize_initial_pieces();
} else if (_local3 && (this.game_over)) {
_root.gotoAndStop("Game Over");
} else if (_local3) {
trace("NEXT LEVEL");
this._parent._parent.initialize_level();
}
this.unloadMovie();
} else {
this.velocity_y = 0;
this._y = this.final_position_y;
delete this.onEnterFrame;
this._parent._parent.check_all_stopped();
}
}
};
PieceClass.prototype.wait_to_fall = function () {
if ((this.current_frame++) >= this.num_wait_frames) {
this.onEnterFrame = this.fall_to_position;
}
};
PieceClass.prototype.onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this._parent._parent.clicked_piece(this);
}
};
PieceClass.prototype.slide_new_position = function () {
this._x = this._x + ((this.final_position_x - this._x) / 4);
this._y = this._y + ((this.final_position_y - this._y) / 4);
if ((Math.abs(this._x - this.final_position_x) <= 1) && (Math.abs(this._y - this.final_position_y) <= 1)) {
this.pieces.myWrong._alpha = 0;
this.callback();
}
};
PieceClass.prototype.onRollOver = function () {
this.pieces.myRollover.gotoAndPlay(2);
this.pieces.myRolloverRim._alpha = 100;
};
PieceClass.prototype.onRollOut = function () {
if (this.pieces.sub._currentlabel != "Clicked Animation") {
this.pieces.sub.mouseOver = false;
}
this.pieces.myRolloverRim._alpha = 0;
};
#endinitclip
Symbol 504 MovieClip [__Packages.branditz] Frame 0
class branditz
{
var pVersion, pGameName, pGameType, pStartFunction, pLoadedList, pLoaded, pLoadWhenCached, pCacheKiller, pBreak, pBreakID, pRequestAddress, pDomain, pElements, pPreLoadingHolder, pSkinPath;
function branditz (thisGameName, thisGameType, thisStartFunction) {
function itemHandler1(obj, item) {
getURL ("http://www.playaholics.com/play/" + _root.Stattooz.pGameName);
}
_root.mySandbox.text = "Sandbox = " + System.security.sandboxType;
pVersion = 2;
pGameName = thisGameName;
pGameType = thisGameType;
pStartFunction = thisStartFunction;
System.security.allowDomain("*");
pLoadedList = [];
pLoaded = false;
pLoadWhenCached = false;
pCacheKiller = "";
pBreak = false;
pBreakID = setInterval(this, "serverTimer", 20000);
if (Number(thisGameType) == 1) {
pRequestAddress = "http://skins.branditz.com";
} else {
var _local4 = getDomain(_root._url);
pDomain = _local4;
if (_local4 != "default") {
pRequestAddress = pDomain + "branditz/";
} else {
pRequestAddress = "http://skins.branditz.com";
}
}
if (_root._url.slice(0, 4) != "file") {
pCacheKiller = "?cache=" + Math.random();
}
var _local3 = new ContextMenu();
_local3.hideBuiltInItems();
if (Number(thisGameType) == 1) {
var _local5 = new ContextMenuItem("Play the full version of this game!", itemHandler1);
_local3.customItems.push(_local5);
}
_root.menu = _local3;
getRemotePaths();
}
function getRemotePaths() {
var _local3 = new LoadVars();
var _local4 = new LoadVars();
_local4.pController = this;
var _local5 = pRequestAddress;
_root.myFeedback.text = _root.myFeedback.text + (("OPENING: " + pRequestAddress) + newline);
_local4.onLoad = function (success) {
_root.myFeedback.text = _root.myFeedback.text + ((" SUCCESS = " + success) + newline);
if (success) {
this.pController.pSkinPath = this.skinurl;
this.pController.pElements = this.elements.split(",");
_root.myFeedback.text = _root.myFeedback.text + ((" LOADED " + this) + newline);
this.pController.pStartFunction(this.pController.pSkinPath, this.pController.pDomain);
if (((this.pController.pSkinPath == undefined) || (this.pController.pSkinPath == "noskin")) || (this.pController.pElements.length < 1)) {
_root.gotoAndStop("preloader");
} else {
this.pController.preloadElements();
}
} else {
_root.myFeedback.text = _root.myFeedback.text + " ERROR - \r";
this.pController.pStartFunction(this.pController.pSkinPath, this.pController.pDomain);
_root.pStattooz.reportEvent("patherror");
_root.gotoAndStop("preloader");
}
trace("my request location = " + this.pController.pRequestAddress);
};
_local4.onHTTPStatus = function (httpStatus) {
_root.myFeedback.text = _root.myFeedback.text + "?\r";
var _local3 = this.pController.reportHttpStatus(httpStatus);
_root.myFeedback.text = _root.myFeedback.text + (((("STATUS = " + httpStatus) + " ") + _local3) + newline);
};
_local3.version = pVersion;
_local3.url = _root._url;
_local3.gamename = pGameName;
_local3.gametype = pGameType;
_local3.sendAndLoad(_local5, _local4, "POST");
}
function preloadElements() {
if ((pElements.length > 0) && (!pBreak)) {
var _local3 = (pPreLoadingHolder = _root.createEmptyMovieClip("myBrandingLoader", _root.getNextHighestDepth()));
_local3._xscale = 1;
_local3._yscale = 1;
_local3._x = -1000;
_local3._y = -1000;
_local3._alpha = 0;
preloadNext(pPreLoadingHolder);
} else {
pLoaded = true;
_root.gotoAndStop("preloader");
}
}
function preloadElement(thisElement, thisContainer) {
_root.myLoadingText.text = "LOADING:" + thisElement;
var _local5 = thisContainer.createEmptyMovieClip(thisElement + "Holder", thisContainer.getNextHighestDepth());
var _local3 = new Object();
_local3.myController = this;
_local3.myElement = thisElement;
_local3.myContainer = thisContainer;
_local3.onLoadProgress = function (target, bytesLoaded, bytesTotal) {
_root.myLoadingText.text = "LOADING:" + thisElement;
};
_local3.onLoadInit = function (thisClip) {
trace("Branding Element Preloaded: " + thisClip);
this.myController.addToLoaded(this.myElement);
this.myController.preloadNext(this.myContainer);
};
_local3.onLoadError = function (thisClip) {
this.myController.preloadNext(this.myContainer);
};
var _local4 = new MovieClipLoader();
_local4.addListener(_local3);
_local4.loadClip((pSkinPath + thisElement) + ".swf", _local5);
}
function preloadNext(thisContainer) {
if ((pElements.length > 0) && (!pBreak)) {
var _local3 = pElements.splice(0, 1)[0];
preloadElement(_local3, pPreLoadingHolder);
} else {
pPreLoadingHolder.removeMovieClip();
pLoaded = true;
_root.gotoAndStop("preloader");
}
}
function reportHttpStatus(thisStatusNumber) {
var _local1;
if (thisStatusNumber < 100) {
_local1 = "flashError";
} else if (thisStatusNumber < 200) {
_local1 = "informational";
} else if (thisStatusNumber < 300) {
_local1 = "successful";
} else if (thisStatusNumber < 400) {
_local1 = "redirection";
} else if (thisStatusNumber < 500) {
_local1 = "clientError";
} else if (thisStatusNumber < 600) {
_local1 = "serverError";
} else if (thisStatusNumber == undefined) {
_local1 = "File Not found";
}
return(_local1);
}
function addToLoaded(thisElement) {
pLoadedList.push(thisElement);
}
function serverTimer() {
trace("Timer Finished");
if (!pLoaded) {
trace("Not Loaded");
pBreak = true;
}
clearInterval(pBreak);
}
function activateElement(thisElement, thisHolder, thisForce) {
if (isInArray(thisElement, pLoadedList) || (thisForce)) {
var _local3 = new Object();
_local3.myController = this;
_local3.myElement = thisElement;
_local3.X = thisHolder._x;
_local3.Y = thisHolder._y;
_local3.onLoadInit = function (thisClip) {
_root.myFeedback.text = "Load success - " + this.myElement;
thisClip.myX = this.X;
thisClip.myY = this.Y;
thisClip.gotoAndStop("show");
};
var _local4 = new MovieClipLoader();
_local4.addListener(_local3);
trace((("my clip = " + pSkinPath) + thisElement) + ".swf");
_local4.loadClip(((pSkinPath + thisElement) + ".swf") + pCacheKiller, thisHolder);
}
}
function isInArray(thisItem, thisArray) {
var _local2 = false;
for (var _local3 in thisArray) {
if (thisArray[_local3] == thisItem) {
_local2 = true;
break;
}
}
return(_local2);
}
function getDomain(thisUrl) {
var _local2;
var _local3 = thisUrl.split(":")[0];
switch (_local3) {
case "http" :
case "https" :
var _local1 = thisUrl.split("/");
_local2 = ((((_local1[0] + "/") + _local1[1]) + "/") + _local1[2]) + "/";
break;
default :
_local2 = "default";
}
return(_local2);
}
}
Symbol 505 MovieClip [__Packages.expressinstall] Frame 0
class expressinstall
{
var needsUpdate, updater, hold;
function expressinstall () {
needsUpdate = ((_root.MMplayerType == undefined) ? false : true);
}
function init() {
if (needsUpdate) {
loadUpdater();
return(true);
}
return(false);
}
function loadUpdater() {
System.security.allowDomain("fpdownload.macromedia.com");
updater = _root.createEmptyMovieClip("expressInstallHolder", 10000000);
var _self = this;
updater.installStatus = _self.onInstallStatus;
hold = updater.createEmptyMovieClip("hold", 1);
updater.onEnterFrame = function () {
if (typeof(this.hold.startUpdate) == "function") {
_self.initUpdater();
this.onEnterFrame = null;
}
};
var _local3 = Math.random();
hold.loadMovie("http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?" + _local3);
}
function initUpdater() {
hold.redirectURL = _root.MMredirectURL;
hold.MMplayerType = _root.MMplayerType;
hold.MMdoctitle = _root.MMdoctitle;
hold.startUpdate();
}
function onInstallStatus(msg) {
if (msg == "Download.Complete") {
} else if (msg == "Download.Cancelled") {
} else if (msg == "Download.Failed") {
}
}
}
Symbol 506 MovieClip [__Packages.stattooz] Frame 0
class stattooz
{
var pGameName, pDeveloper, pGenre, pGameType, pGameSkin, pThreshold, pDomain, pPlayer, pGameUrl, pStatsPath;
function stattooz (thisGameName, thisDeveloper, thisGenre, thisGameType, thisGameSkin, thisPlayer, thisThreshold, thisDomain) {
pGameName = thisGameName;
pDeveloper = thisDeveloper;
pGenre = thisGenre;
pGameType = thisGameType;
pGameSkin = thisGameSkin;
pThreshold = thisThreshold;
pDomain = thisDomain;
if (pGameSkin == undefined) {
pGameSkin = "noskin";
}
pPlayer = thisPlayer;
if ((thisPlayer != "activate") && (thisPlayer != "nopirate")) {
pPlayer = System.capabilities.playerType;
}
pGameUrl = _root._url;
pStatsPath = "http://log.stattooz.com";
}
function reportEvent(thisEventName) {
if (pPlayer != "External") {
var _local2 = getEventId(thisEventName);
sendStat(_local2);
}
}
function sendStat(thisEventID) {
var _local3 = new LoadVars();
var _local4 = new LoadVars();
_local4.pEvent = thisEventID;
_local4.pController = this;
_local4.onLoad = function (success) {
var _local3;
if (success) {
if (this.done == "true") {
_local3 = (("SUCCESS - Stat Reporting - Event: " + this.pEvent) + " Done = ") + this.done;
} else {
_local3 = (("ERROR - Stat Reporting - Event: " + this.pEvent) + " Done = ") + this.done;
}
} else {
_local3 = (("ERROR - Stat Reporting - Event: " + this.pEvent) + " Log file not located: ") + this.pStatsPath;
}
trace(_local3);
_root.myFeedback.text = _root.myFeedback.text + (_local3 + newline);
};
_local4.onHTTPStatus = function (httpStatus) {
this.pController.reportHttpStatus(httpStatus);
};
_local3.skin = pGameSkin;
_local3.gamename = pGameName;
_local3.genre = pGenre;
_local3.developer = pDeveloper;
_local3.url = pGameUrl;
_local3.event = thisEventID;
_local3.type = pGameType;
pStatsPath;
}
function getEventId(thisEventName) {
var _local1;
if (!isNaN(Number(thisEventName))) {
_local1 = thisEventName;
} else {
switch (thisEventName) {
case "load" :
_local1 = 1;
break;
case "play" :
_local1 = 2;
break;
case "endpass" :
_local1 = 3;
break;
case "endfail" :
_local1 = 4;
break;
case "submit" :
_local1 = 5;
break;
case "moregames" :
_local1 = 6;
break;
case "creditsview" :
_local1 = 7;
break;
case "creditsthrough" :
_local1 = 8;
break;
case "pirate" :
_local1 = 9;
break;
case "patherror" :
_local1 = 10;
break;
case "skinerror" :
_local1 = 11;
break;
default :
_local1 = 0;
}
}
return(_local1);
}
function submitScore() {
_root.Stattooz.reportEvent("submit");
var _local3 = new LoadVars();
_local3.developer = pDeveloper;
_local3.score = _root.score;
_local3.game_name = pGameName;
pDomain + "comp_entry.php";
}
}
Symbol 272 MovieClip Frame 1
stop();
Symbol 273 MovieClip Frame 1
_root.Branditz.activateElement("preloader", this);
Symbol 273 MovieClip Frame 2
function loadFinished() {
trace("the loader is done");
pStattooz.reportEvent("skinerror");
_root.loadComplete();
}
this._alpha = 100;
iBytesTotal = _root.getBytesTotal();
iBytesLoaded = _root.getBytesLoaded();
iBytes = (iBytesLoaded / iBytesTotal) * 100;
if (iBytes < 100) {
this.preloader.gotoAndStop(Math.ceil(iBytes));
this.preloader.percent.text = Math.ceil(iBytes) + "%";
iLastBytes = iBytes;
} else {
gotoAndStop ("loaded");
this._currentframe == this._totalframes;
this.loadFinished();
}
_root.myFeedback.text = "loading conmmenced";
Symbol 273 MovieClip Frame 3
this.gotoAndPlay("loadloop");
Symbol 273 MovieClip Frame 4
stop();
Symbol 281 MovieClip Frame 1
_root.Branditz.activateElement("intro", this);
Symbol 281 MovieClip Frame 11
this.onRelease = function () {
getURL ("http://www.3rdsense.com", "_blank");
};
Symbol 281 MovieClip Frame 130
trace("anim done");
_root.checkPirate();
stop();
Symbol 290 MovieClip Frame 1
stop();
Symbol 290 MovieClip Frame 2
stop();
Symbol 302 MovieClip Frame 1
_root.Branditz.activateElement("pirate", this);
stop();
Instance of Symbol 290 MovieClip in Symbol 302 MovieClip Frame 1
on (rollOver) {
gotoAndStop (2);
}
on (rollOut) {
gotoAndStop (1);
}
on (release) {
getURL ("http://www.3rdsense.com");
}
Instance of Symbol 301 MovieClip in Symbol 302 MovieClip Frame 1
onClipEvent (load) {
this.onRelease = function () {
_root.Stattooz.reportEvent("creditsthrough");
getURL ("http://www.3rdsense.com", "_blank");
};
}
Instance of Symbol 301 MovieClip in Symbol 302 MovieClip Frame 1
onClipEvent (load) {
this.onRelease = function () {
_root.Stattooz.reportEvent("creditsthrough");
getURL ("http://www.3rdsense.com", "_blank");
};
}
Symbol 307 MovieClip Frame 1
stop();
Symbol 307 MovieClip Frame 2
stop();
Symbol 317 MovieClip Frame 1
stop();
Symbol 317 MovieClip Frame 2
stop();
Symbol 321 MovieClip Frame 1
stop();
Symbol 321 MovieClip Frame 2
stop();
Symbol 321 MovieClip Frame 3
stop();
Symbol 322 MovieClip Frame 1
_root.pSound = "on";
_root.toggleSound = function () {
var _local2 = new Sound();
if (_root.pSound == "on") {
_local2.setVolume(0);
_root.pSound = "off";
} else {
_local2.setVolume(100);
_root.pSound = "on";
}
return(_root.pSound);
};
_root.pGraphics = "med";
_root.toggleGraphics = function () {
switch (_root.pGraphics) {
case "high" :
_root.pGraphics = "low";
_root._quality = "LOW";
break;
case "med" :
_root.pGraphics = "high";
_root._quality = "BEST";
break;
case "low" :
_root.pGraphics = "med";
_root._quality = "MEDIUM";
break;
}
return(_root.pGraphics);
};
Instance of Symbol 317 MovieClip in Symbol 322 MovieClip Frame 1
onClipEvent (load) {
var myFrame = _root.pSound;
trace("graphics load = " + myFrame);
this.gotoAndStop(myFrame);
}
on (rollOver) {
var myButColour = new Color(this);
myButColour.setRGB(Number("0x666666"));
}
on (rollOut) {
var myButColour = new Color(this);
myButColour.setRGB(Number("0x24406B"));
}
on (release) {
var myFrame = _root.toggleSound();
trace(myFrame);
this.gotoAndStop(myFrame);
}
Instance of Symbol 321 MovieClip in Symbol 322 MovieClip Frame 1
onClipEvent (load) {
var myFrame = _root.pGraphics;
trace("graphics load = " + myFrame);
this.gotoAndStop(myFrame);
}
on (rollOver) {
var myButColour = new Color(this);
myButColour.setRGB(Number("0x666666"));
}
on (rollOut) {
var myButColour = new Color(this);
myButColour.setRGB(Number("0x24406B"));
}
on (release) {
var myFrame = _root.toggleGraphics();
trace(myFrame);
this.gotoAndStop(myFrame);
}
Symbol 350 MovieClip Frame 1
stop();
Symbol 350 MovieClip Frame 2
stop();
Symbol 351 MovieClip Frame 1
_root.Branditz.activateElement("moregames", this);
Instance of Symbol 350 MovieClip "myButton" in Symbol 351 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
gotoAndStop (1);
};
this.onRelease = function () {
_root.Stattooz.reportEvent("moregames");
getURL ("http://www.3rdsense.com/moregames/index.php");
};
this.onRollOver = function () {
gotoAndPlay (2);
};
}
Symbol 359 MovieClip Frame 103
gotoAndPlay (8);
Symbol 381 MovieClip Frame 29
if ((_level0.citizen_kane == "default") || (_level0.citizen_kane == undefined)) {
} else {
this.myMessage.text = "This game features your Playaholics avatar!\rMatch three in a row to earn bonus points.";
this.myQuestion.text = "";
this.myJoin._x = -3000;
}
stop();
Instance of ? in Symbol 381 MovieClip Frame 29
//component parameters
onClipEvent (construct) {
}
Instance of ? "myJoin" in Symbol 381 MovieClip Frame 29
on (release) {
getURL ("http://www.playaholics.com/members/register/step1/", this);
}
on (rollOver) {
this.gotoAndStop(2);
}
on (rollOut) {
this.gotoAndStop(1);
}
Instance of Symbol 391 MovieClip in Symbol 399 MovieClip Frame 1
on (rollOver) {
if (this._parent.hint_count > 0) {
this.myButton.gotoAndStop(2);
}
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
on (press) {
if ((this._parent.hint_count > 0) && (this._parent.paused != true)) {
var myHintFound = false;
this["star_" + this._parent.hint_count]._alpha = 0;
this._parent.hint_count--;
var grid = this._parent.get_current_grid();
var j = 0;
while (j < this._parent.num_rows) {
var k = 0;
while (k < this._parent.num_columns) {
var neighbors = this._parent.get_neighbors(j, k);
if (this._parent.check_possible_swaps(grid, j, k, neighbors)) {
var _mc = this._parent.piece_holder[(("piece_" + j) + "_") + k];
_mc.pieces.myHint.gotoAndPlay(2);
this._parent.score = this._parent.score - 25;
myHintFound = true;
break;
}
k++;
}
if (myHintFound) {
break;
}
j++;
}
}
trace("My hint count = " + this._parent.hint_count);
if (this._parent.hint_count < 1) {
this._alpha = 60;
}
}
Instance of Symbol 393 MovieClip in Symbol 399 MovieClip Frame 1
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
on (release) {
this._parent.pause_toggle();
}
Instance of Symbol 395 MovieClip in Symbol 399 MovieClip Frame 1
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
on (press) {
_root.gotoAndStop("Instructions");
}
Symbol 412 MovieClip Frame 1
stop();
Symbol 413 MovieClip Frame 1
stop();
Symbol 416 MovieClip Frame 1
this._visible = false;
Symbol 433 Button
on (press) {
_parent._parent.evaluate_answer(this);
}
Symbol 453 MovieClip Frame 1
stop();
Symbol 453 MovieClip Frame 22
stop();
_parent.fill_quiz_form();
Symbol 453 MovieClip Frame 59
this._gotoAndStop(1);
Symbol 453 MovieClip Frame 96
this._gotoAndStop(1);
Symbol 459 MovieClip Frame 42
this._gotoAndStop(1);
Symbol 462 MovieClip Frame 1
stop();
Symbol 462 MovieClip Frame 42
gotoAndStop (1);
Symbol 468 MovieClip Frame 1
stop();
Symbol 468 MovieClip Frame 7
stop();
Symbol 470 MovieClip Frame 1
stop();
Symbol 470 MovieClip Frame 42
gotoAndStop (1);
Symbol 471 MovieClip [DiamondMineComponent] Frame 1
#initclip 10
_root.game_type = "Timer";
_root.myHandle = true;
DiamondMine = function () {
if (this._name != undefined) {
this.initialize();
}
};
DiamondMine.prototype = new MovieClip();
Object.registerClass("DiamondMineComponent", DiamondMine);
DiamondMine.prototype.initialize = function () {
this.initialize_variables();
this.initialize_graphics();
this.initialize_level();
};
DiamondMine.prototype.load_quiz_data = function () {
this.quiz_loader = new LoadVars();
this.quiz_loader.load(this.quiz_data_file);
this.quiz_loader.onLoad = function () {
this.loaded_successfully = arguments[0];
this.num_choices_per_question = Number(this.num_choices_per_question);
this.questions = new Array();
var _local3 = 0;
while (_local3 >= 0) {
if (this[("question" + _local3) + "_text"] == undefined) {
break;
}
this.questions[_local3] = new Object();
this.questions[_local3].text = this[("question" + _local3) + "_text"];
this.questions[_local3].answer = Number(this[("question" + _local3) + "_answer"]);
this.questions[_local3].choices = new Array();
var _local4 = 0;
while (_local4 < this.num_choices_per_question) {
this.questions[_local3].choices[_local4] = this[(("question" + _local3) + "_choice") + _local4];
_local4++;
}
_local3++;
}
this.current_question_list = this.questions.return_copy();
this.questions.shuffle();
this.current_question_list.shuffle();
};
};
DiamondMine.prototype.initialize_variables = function () {
this.hint_count = 3;
this.depth = 0;
this.score = 0;
this.piece_width = 50;
this.piece_height = 50;
this.piece = new Array();
this.current_level = -1;
this.selected_piece0_mc = undefined;
this.selected_piece1_mc = undefined;
var _local2 = this.attachMovie("PieceComponent", "__TEMP__", 123);
this.num_pieces = 4 + this.current_level;
if (this.num_pieces > 10) {
this.num_pieces = 10;
}
_local2.unloadMovie();
this.paused = false;
this.level_questions_maxed = false;
this.num_asked_questions = 0;
};
DiamondMine.prototype.initialize_graphics = function () {
};
DiamondMine.prototype.initialize_level = function () {
_root.myHandle = false;
this.current_level++;
this.num_pieces = 4 + this.current_level;
if (this.num_pieces > 10) {
this.num_pieces = 10;
}
this.time_percentage = 50;
this.level_prompt._play();
this.level_prompt.field = ("Level " + (this.current_level + 1)) + "!";
this.myMascot.myPlaque.myLevel.text = this.current_level + 1;
this.initialize_initial_pieces();
this.piece_holder.backgrounds._play();
this.level_questions_maxed = false;
this.num_asked_questions = 0;
this.paused = false;
};
DiamondMine.prototype.initialize_initial_pieces = function () {
var _local10 = this.calculate_solutionless_grid();
this.pieces = new Array();
var _local4 = this.num_rows - 1;
while (_local4 >= 0) {
var _local3 = 0;
while (_local3 < this.num_columns) {
if (_local4 == (this.num_rows - 1)) {
var _local9 = ((this.piece_holder.play_area._y - this.piece_holder.play_area._height) + (this.num_rows * this.piece_height)) - _global.Math2.randf(0, 50);
} else {
var _local9 = this.piece_holder[(("piece_" + (_local4 + 1)) + "_") + _local3]._y;
}
var _local8 = this.piece_holder.play_area._x + ((_local3 * this.piece_holder.play_area._width) / this.num_columns);
var _local7 = (_local9 - (this.piece_height * 2)) - _global.Math2.randf(50, 100);
var _local6 = this.calculate_final_position(_local4, _local3).x;
var _local5 = this.calculate_final_position(_local4, _local3).y;
this.create_piece(_local4, _local3, _local8, _local7, _local6, _local5, _local10[_local4][_local3]);
_local3++;
}
_local4--;
}
};
DiamondMine.prototype.create_piece = function (index_j, index_k, initial_position_x, initial_position_y, final_position_x, final_position_y, type) {
if (((this.use_quiz == "True") && (this.quiz_loader.loaded_successfully)) && (!this.level_questions_maxed)) {
if (Math.random() <= this.quiz_piece_probability) {
var _local6 = true;
} else {
var _local6 = false;
}
}
var _local2 = this.piece_holder.attachMovie("PieceComponent", (("piece_" + index_j) + "_") + index_k, this.depth++, {type:type, quiz:_local6});
_local2.index_j = index_j;
_local2.index_k = index_k;
_local2._x = initial_position_x;
_local2._y = initial_position_y;
_local2.final_position_x = final_position_x;
_local2.final_position_y = final_position_y;
_local2.acceleration_y = this.piece_acceleration;
};
DiamondMine.prototype.clicked_piece = function (piece_mc) {
if (this.paused) {
trace("paused!");
return(undefined);
}
if (this.check_for_movement()) {
trace("moving!");
return(undefined);
}
if (_root.myHandle) {
trace("handle!");
return(undefined);
}
trace("CLICK");
this.last_clicked_time = getTimer();
if (piece_mc.selector_mc._currentframe != 1) {
this.unselect_piece(piece_mc);
} else if (this.selected_piece0_mc != undefined) {
this.select_piece(piece_mc);
this.evaluate_player_selection();
this.play_sound("egg_move_sound");
} else {
this.select_piece(piece_mc);
}
};
DiamondMine.prototype.unselect_piece = function (piece_mc, custom_animation) {
piece_mc.selector_mc._gotoAndStop(1);
piece_mc.pieces.sub._xscale = 100;
piece_mc.pieces.sub._yscale = 100;
if (piece_mc == this.selected_piece0_mc) {
this.selected_piece0_mc = undefined;
}
if (piece_mc == this.selected_piece1_mc) {
this.selected_piece1_mc = undefined;
}
};
DiamondMine.prototype.select_piece = function (piece_mc) {
piece_mc.selector_mc._gotoAndPlay(2);
piece_mc.pieces.sub._xscale = 115;
piece_mc.pieces.sub._yscale = 115;
if (this.selected_piece0_mc == undefined) {
this.selected_piece0_mc = piece_mc;
} else {
this.selected_piece1_mc = piece_mc;
piece_mc.selector_mc._gotoAndPlay(this.selected_piece0_mc.selector_mc._currentframe);
}
};
DiamondMine.prototype.evaluate_player_selection = function () {
if (this.adjacent_selections()) {
this.selected_adjacent_pieces();
} else {
this.selected_nonadjacent_pieces();
}
};
DiamondMine.prototype.adjacent_selections = function () {
return(((this.selected_piece0_mc.index_j == this.selected_piece1_mc.index_j) && (Math.abs(this.selected_piece0_mc.index_k - this.selected_piece1_mc.index_k) == 1)) || ((this.selected_piece0_mc.index_k == this.selected_piece1_mc.index_k) && (Math.abs(this.selected_piece0_mc.index_j - this.selected_piece1_mc.index_j) == 1)));
};
DiamondMine.prototype.selected_adjacent_pieces = function () {
this.swap_selected_pieces();
this.selected_piece0_mc.selector_mc._gotoAndStop(1);
this.selected_piece1_mc.selector_mc._gotoAndStop(1);
this.selected_piece0_mc.pieces.sub._gotoAndStop("Default");
this.selected_piece1_mc.pieces.sub._gotoAndStop("Default");
};
DiamondMine.prototype.swap_selected_pieces = function () {
this.swap_selected_indices();
this.swap_selected_instance_names();
this.selected_piece0_mc.onEnterFrame = this.selected_piece0_mc.slide_new_position;
this.selected_piece1_mc.onEnterFrame = this.selected_piece1_mc.slide_new_position;
this.selected_piece0_mc.callback = this.piece_sliding_done_before;
this.selected_piece1_mc.callback = undefined;
this.update_final_position(this.selected_piece0_mc);
this.update_final_position(this.selected_piece1_mc);
};
DiamondMine.prototype.swap_selected_pieces_back = function () {
trace("!!! SWAP BACK");
this.myMascot.head.eyes.gotoAndStop("left");
this.myMascot.head.mouth.gotoAndStop("sad");
this.swap_selected_pieces();
this.selected_piece0_mc.callback = this.piece_sliding_done_after;
this.selected_piece1_mc.callback = undefined;
var _local3 = this.selected_piece0_mc;
var _local2 = this.selected_piece1_mc;
_local3.pieces.myWrong._alpha = 100;
_local2.pieces.myWrong._alpha = 100;
this.unselect_piece(this.selected_piece0_mc, true);
this.unselect_piece(this.selected_piece1_mc, true);
};
DiamondMine.prototype.swap_selected_indices = function () {
var _local3 = {a:this.selected_piece0_mc.index_j, b:this.selected_piece1_mc.index_j};
var _local2 = {a:this.selected_piece0_mc.index_k, b:this.selected_piece1_mc.index_k};
_local3.swap("a", "b");
_local2.swap("a", "b");
this.selected_piece0_mc.index_j = _local3.a;
this.selected_piece0_mc.index_k = _local2.a;
this.selected_piece1_mc.index_j = _local3.b;
this.selected_piece1_mc.index_k = _local2.b;
};
DiamondMine.prototype.swap_selected_instance_names = function () {
var _local3 = this.selected_piece0_mc._name;
var _local2 = this.selected_piece1_mc._name;
this.selected_piece0_mc._name = "name0";
this.selected_piece1_mc._name = "name1";
this.selected_piece0_mc._name = _local2;
this.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 = 0;
while (_local3 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
this.piece_holder[(("piece_" + _local3) + "_") + _local2].onEnterFrame = undefined;
_local2++;
}
_local3++;
}
};
DiamondMine.prototype.evaluate_grid = function () {
this.selected_piece0_mc.onEnterFrame = undefined;
this.selected_piece1_mc.onEnterFrame = undefined;
if (this.alreadyHasSolution()) {
this.myMascot.gotoAndPlay("jumping");
this.handle_solutions();
} else {
if (arguments.length == 0) {
this.play_sound("egg_move_sound");
}
if (this.selected_piece0_mc != undefined) {
this.swap_selected_pieces_back();
}
}
this.selected_piece0_mc.pieces.sub._xscale = 100;
this.selected_piece0_mc.pieces.sub._yscale = 100;
this.selected_piece1_mc.pieces.sub._xscale = 100;
this.selected_piece1_mc.pieces.sub._yscale = 100;
this.selected_piece0_mc = undefined;
this.selected_piece1_mc = undefined;
};
DiamondMine.prototype.handle_solutions = function () {
_root.myHandle = true;
var _local3 = this.calculate_remove_list();
_root.removeList = _local3;
this.update_score(_local3);
this.play_remove_animations(_local3);
};
DiamondMine.prototype.handle_solutions_2 = function () {
trace("_root.removeList = " + _root.removeList);
if ((((!this.paused) && (_root.removeList != undefined)) && (_root.removeList != [])) && (_root.removeList != "")) {
trace("I do it");
var _local3 = this.calculate_remove_list();
_root.myHandle = false;
this.shift_pieces_down(_root.removeList);
this.add_new_pieces(_root.removeList);
this.increase_time_percentage(_root.removeList.length);
if (_local3.length > 0) {
this.play_sound(["clear_sound0", "clear_sound1", "clear_sound2"].rande());
}
_root.removeList = undefined;
}
};
DiamondMine.prototype.increase_time_percentage = function (num_collapsed_pieces) {
if (this.game_type == "Timer") {
this.time_percentage = this.time_percentage + (this.collapse_percent_increase + (this.level_collapse_percent_change * num_collapsed_pieces));
} else {
this.time_percentage = this.time_percentage + (this.collapse_percent_increase + Math.max((-this.level_collapse_percent_change) * num_collapsed_pieces, this.minimum_collapse_percent));
}
};
DiamondMine.prototype.calculate_remove_list = function () {
this.avatar_bonus = false;
var _local3 = new Array();
var _local5 = 0;
while (_local5 < this.num_rows) {
var _local4 = 0;
while (_local4 < this.num_columns) {
var _local2 = this.get_neighborhood(_local5, _local4);
if (((_local2.left.type == _local2.middle.type) && (_local2.middle.type == _local2.right.type)) && (_local2.left.type == _local2.right.type)) {
if (((_local2.left.type == 1) && (_level0.citizen_kane != undefined)) && (_level0.citizenkane != "default")) {
this.avatar_bonus = true;
}
_local3._push({j:_local2.left.index_j, k:_local2.left.index_k});
_local3._push({j:_local2.middle.index_j, k:_local2.middle.index_k});
_local3._push({j:_local2.right.index_j, k:_local2.right.index_k});
} else if (((_local2.top.type == _local2.middle.type) && (_local2.middle.type == _local2.bottom.type)) && (_local2.top.type == _local2.bottom.type)) {
if (((_local2.top.type == 1) && (_level0.citizen_kane != undefined)) && (_level0.citizenkane != "default")) {
this.avatar_bonus = true;
}
_local3._push({j:_local2.top.index_j, k:_local2.top.index_k});
_local3._push({j:_local2.middle.index_j, k:_local2.middle.index_k});
_local3._push({j:_local2.bottom.index_j, k:_local2.bottom.index_k});
}
_local4++;
}
_local5++;
}
if ((this.avatar_bonus && (_level0.citizen_kane != undefined)) && (_level0.citizenkane != "default")) {
this.myMascot.myBonusBubble.myBubble._alpha = 100;
}
return(_local3.remove_repeats());
};
DiamondMine.prototype.play_remove_animations = function (remove_list) {
var _local8 = false;
var _local3 = 0;
while (_local3 < remove_list.length) {
var _local6 = remove_list[_local3].j;
var _local5 = remove_list[_local3].k;
var _local4 = this.piece_holder[(("piece_" + _local6) + "_") + _local5];
_local4.IAMDEAD = true;
_local4._name = "__TEMP__" + _global.Math2.randi(0, 10000);
_local4.pieces.myHighlight.gotoAndPlay(2);
_local3++;
}
};
DiamondMine.prototype.create_quiz = function () {
if (this.new_board_prompt.playing) {
return(undefined);
}
if (this.quiz_prompt._currentframe != 1) {
return(undefined);
}
this.paused = true;
this.quiz_prompt._play();
this.quiz_prompt.swapDepths(this.depth + 5000);
this.num_asked_questions++;
if (this.num_asked_questions >= this.max_quiz_per_level) {
this.level_questions_maxed = true;
var _local4 = 0;
while (_local4 < this.num_rows) {
var _local3 = 0;
while (_local3 < this.num_columns) {
var _local2 = this.piece_holder[(("piece_" + _local4) + "_") + _local3];
if (_local2.pieces._currentframe > this.num_pieces) {
_local2.pieces.gotoAndStop(_local2.pieces._currentframe - this.num_pieces);
}
_local3++;
}
_local4++;
}
}
};
DiamondMine.prototype.fill_quiz_form = function () {
if (this.quiz_loader.current_question_list.length == 0) {
this.quiz_loader.current_question_list = this.quiz_loader.questions.return_copy();
this.quiz_loader.current_question_list.shuffle();
}
var _local4 = this.quiz_loader.current_question_list.pop();
this.quiz_prompt.question = _local4.text;
var _local2 = 0;
while (_local2 < this.quiz_loader.num_choices_per_question) {
var _local3 = this.quiz_prompt["choice" + _local2];
_local3.choice = String.fromCharCode("A".charCodeAt(0) + _local2);
_local3.field = _local4.choices[_local2];
if (_local2 == _local4.answer) {
_local3.correct = true;
}
_local2++;
}
};
DiamondMine.prototype.evaluate_answer = function (choice_mc) {
this.paused = false;
if (choice_mc.correct) {
this.correct_answer();
} else {
this.incorrect_answer();
}
};
DiamondMine.prototype.correct_answer = function () {
this.score = this.score + this.correct_points;
this.score_txt.scrollToNumber(Math.round(this.score), 10);
this.quiz_prompt._gotoAndPlay("Correct Answer");
};
DiamondMine.prototype.incorrect_answer = function () {
this.score = this.score + this.incorrect_points;
this.score_txt.scrollToNumber(Math.round(this.score), 10);
this.quiz_prompt._gotoAndPlay("Incorrect Answer");
};
DiamondMine.prototype.shift_pieces_down = function (remove_list) {
var _local6 = this.get_shifted_columns(remove_list);
var _local5 = 0;
while (_local5 < _local6.length) {
var _local4 = this.num_rows - 2;
while (_local4 >= 0) {
var _local2 = this.piece_holder[(("piece_" + _local4) + "_") + _local6[_local5]];
if (_local2 != undefined) {
var _local3 = false;
while (!_local3) {
if ((this.piece_holder[(("piece_" + (_local2.index_j + 1)) + "_") + _local2.index_k] == undefined) && ((_local2.index_j + 1) < this.num_rows)) {
_local2.index_j++;
_local2._name = (("piece_" + _local2.index_j) + "_") + _local2.index_k;
_local2.final_position_x = this.calculate_final_position(_local2.index_j, _local2.index_k).x;
_local2.final_position_y = this.calculate_final_position(_local2.index_j, _local2.index_k).y;
_local2.onEnterFrame = _local2.fall_to_position;
} else {
_local3 = true;
}
}
}
_local4--;
}
_local5++;
}
};
DiamondMine.prototype.get_shifted_columns = function (remove_list) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < remove_list.length) {
_local3._push(remove_list[_local1].k);
_local1++;
}
return(_local3.remove_repeats());
};
DiamondMine.prototype.get_minimum_rows = function (columns, remove_list) {
var _local7 = new Array();
var _local4 = 0;
while (_local4 < columns.length) {
var _local5 = columns[_local4];
var _local3 = Number.MAX_VALUE;
var _local1 = 0;
while (_local1 < remove_list.length) {
if (remove_list[_local1].k == _local5) {
if (remove_list[_local1].j <= _local3) {
_local3 = remove_list[_local1].j;
}
}
_local1++;
}
_local7[_local4] = _local3;
_local4++;
}
return(_local7);
};
DiamondMine.prototype.get_num_column_pieces = function (shift_columns, remove_list) {
var _local4 = new Array();
var _local2 = 0;
while (_local2 < shift_columns.length) {
_local4[_local2] = 0;
var _local1 = 0;
while (_local1 < remove_list.length) {
if (remove_list[_local1].k == shift_columns[_local2]) {
_local4[_local2]++;
}
_local1++;
}
_local2++;
}
return(_local4);
};
DiamondMine.prototype.shift_above_pieces = function (minimum_rows, shift_columns, num_columns_pieces) {
var _local3 = 0;
while (_local3 < shift_columns.length) {
var _local4 = minimum_rows[_local3] - 1;
while (_local4 >= 0) {
var _local2 = this.piece_holder[(("piece_" + _local4) + "_") + shift_columns[_local3]];
_local2.index_j = _local2.index_j + num_columns_pieces[_local3];
_local2._name = (("piece_" + _local2.index_j) + "_") + _local2.index_k;
_local2.final_position_x = this.calculate_final_position(_local2.index_j, _local2.index_k).x;
_local2.final_position_y = this.calculate_final_position(_local2.index_j, _local2.index_k).y;
_local2.onEnterFrame = _local2.fall_to_position;
_local4--;
}
_local3++;
}
};
DiamondMine.prototype.add_new_pieces = function (remove_list) {
var _local5 = 0;
while (_local5 < this.num_rows) {
var _local3 = 0;
while (_local3 < this.num_columns) {
var _local10 = this.piece_holder[(("piece_" + _local5) + "_") + _local3];
if (_local10 == undefined) {
var _local4 = _local5;
while (_local4 < this.num_rows) {
var _local6 = this.piece_holder[(("piece_" + _local4) + "_") + _local3];
if (_local6 != undefined) {
var _local7 = _local4;
break;
}
_local4++;
}
var _local12 = this.piece_holder.play_area._x + (_local3 * this.piece_width);
var _local11 = ((-this.piece_height) * 0) - ((_local7 - _local5) * this.piece_height);
var _local9 = this.calculate_final_position(_local5, _local3).x;
var _local8 = this.calculate_final_position(_local5, _local3).y;
this.create_piece(_local5, _local3, _local12, _local11, _local9, _local8, _global.Math2.randi(1, this.num_pieces + 1));
}
_local3++;
}
_local5++;
}
};
DiamondMine.prototype.selected_nonadjacent_pieces = function () {
this.unselect_piece(this.selected_piece0_mc);
this.unselect_piece(this.selected_piece1_mc);
};
DiamondMine.prototype.hasSolution = function () {
return(this.alreadyHasSolution());
};
DiamondMine.prototype.alreadyHasSolution = function () {
var _local4 = 0;
while (_local4 < this.num_rows) {
var _local3 = 0;
while (_local3 < this.num_columns) {
var _local2 = this.get_neighborhood(_local4, _local3);
if ((((_local2.left.type == _local2.middle.type) && (_local2.middle.type == _local2.right.type)) && (_local2.left.type == _local2.right.type)) || (((_local2.top.type == _local2.middle.type) && (_local2.middle.type == _local2.bottom.type)) && (_local2.top.type == _local2.bottom.type))) {
return(true);
}
_local3++;
}
_local4++;
}
return(false);
};
DiamondMine.prototype.hasPossibleSolution = function () {
var _local5 = this.get_current_grid();
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
var _local4 = this.get_neighbors(_local3, _local2);
if (this.check_possible_swaps(_local5, _local3, _local2, _local4)) {
return(true);
}
_local2++;
}
_local3++;
}
return(false);
};
DiamondMine.prototype.get_neighbors = function (j, k) {
if ((j == 0) && (k == 0)) {
return([[j + 1, k], [j, k + 1]]);
}
if ((j == 0) && (k == (this.num_columns - 1))) {
return([[j + 1, k], [j, k - 1]]);
}
if ((j == (this.num_rows - 1)) && (k == 0)) {
return([[j - 1, k], [j, k + 1]]);
}
if ((j == (this.num_rows - 1)) && (k == (this.num_columns - 1))) {
return([[j - 1, k], [j, k - 1]]);
}
if (j == 0) {
return([[j, k - 1], [j, k + 1], [j + 1, k]]);
}
if (k == 0) {
return([[j - 1, k], [j + 1, k], [j, k + 1]]);
}
if (j == (this.num_rows - 1)) {
return([[j, k - 1], [j, k + 1], [j - 1, k]]);
}
if (k == (this.num_columns - 1)) {
return([[j - 1, k], [j + 1, k], [j, k - 1]]);
}
return([[j - 1, k], [j + 1, k], [j, k - 1], [j, k + 1]]);
};
DiamondMine.prototype.check_possible_swaps = function (grid, j, k, neighbors) {
var _local2 = 0;
while (_local2 < neighbors.length) {
grid.swap2D(j, k, neighbors[_local2][0], neighbors[_local2][1]);
if (this.gridHasNeighborhoodSolution(grid, j, k)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(grid, j + 1, k)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(grid, j - 1, k)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(grid, j, k + 1)) {
return(true);
}
if (this.gridHasNeighborhoodSolution(grid, j, k - 1)) {
return(true);
}
grid.swap2D(j, k, neighbors[_local2][0], neighbors[_local2][1]);
_local2++;
}
return(false);
};
DiamondMine.prototype.get_current_grid = function () {
var _local4 = new Array();
var _local3 = 0;
while (_local3 < this.num_rows) {
_local4[_local3] = new Array();
var _local2 = 0;
while (_local2 < this.num_columns) {
_local4[_local3][_local2] = this.piece_holder[(("piece_" + _local3) + "_") + _local2].type;
_local2++;
}
_local3++;
}
return(_local4);
};
DiamondMine.prototype.gridHasSolution = function (grid) {
var _local4 = 0;
while (_local4 < this.num_rows) {
var _local3 = 0;
while (_local3 < this.num_columns) {
var _local2 = new Object();
_local2.left = grid[_local4][_local3 - 1];
_local2.right = grid[_local4][_local3 + 1];
_local2.top = grid[_local4 - 1][_local3];
_local2.bottom = grid[_local4 + 1][_local3];
_local2.middle = grid[_local4][_local3];
if ((((_local2.left == _local2.middle) && (_local2.middle == _local2.right)) && (_local2.left == _local2.right)) || (((_local2.top == _local2.middle) && (_local2.middle == _local2.bottom)) && (_local2.top == _local2.bottom))) {
return(true);
}
_local3++;
}
_local4++;
}
return(false);
};
DiamondMine.prototype.gridHasNeighborhoodSolution = function (grid, j, k) {
if (grid[j][k] == undefined) {
return(false);
}
var _local1 = new Object();
_local1.left = grid[j][k - 1];
_local1.right = grid[j][k + 1];
_local1.top = grid[j - 1][k];
_local1.bottom = grid[j + 1][k];
_local1.middle = grid[j][k];
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 _local3 = this.calculate_final_position(piece_mc.index_j, piece_mc.index_k);
piece_mc.final_position_x = _local3.x;
piece_mc.final_position_y = _local3.y;
};
DiamondMine.prototype.calculate_final_position = function (j, k) {
var _local2 = {};
_local2.x = this.piece_holder.play_area._x + ((k * this.piece_holder.play_area._width) / this.num_columns);
_local2.y = this.piece_holder.play_area._y + ((j * this.piece_holder.play_area._height) / this.num_rows);
return(_local2);
};
DiamondMine.prototype.calculate_solutionless_grid = function () {
var _local4 = new Array();
var _local3 = 0;
while (_local3 < this.num_rows) {
_local4[_local3] = new Array();
var _local2 = 0;
while (_local2 < this.num_columns) {
var _local10 = _local4[_local3][_local2 - 1];
var _local7 = _local4[_local3][_local2 + 1];
var _local8 = _local4[_local3 - 1][_local2];
var _local6 = _local4[_local3 + 1][_local2];
var _local5 = Array.getIndices(1, this.num_pieces);
var _local11 = [_local10, _local7, _local8, _local6];
var _local9 = Array.negated_intersection(_local5, _local11);
_local4[_local3][_local2] = _local9.rande();
_local2++;
}
_local3++;
}
return(_local4);
};
DiamondMine.prototype.get_neighborhood = function (j, k) {
var _local2 = new Array();
_local2.middle = this.piece_holder[(("piece_" + j) + "_") + k];
_local2.left = this.piece_holder[(("piece_" + j) + "_") + (k - 1)];
_local2.right = this.piece_holder[(("piece_" + j) + "_") + (k + 1)];
_local2.top = this.piece_holder[(("piece_" + (j - 1)) + "_") + k];
_local2.bottom = this.piece_holder[(("piece_" + (j + 1)) + "_") + k];
return(_local2);
};
DiamondMine.prototype.check_for_movement = function () {
var _local4 = 0;
while (_local4 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
var _local3 = this.piece_holder[(("piece_" + _local4) + "_") + _local2];
if (_local3.onEnterFrame != undefined) {
return(true);
}
_local2++;
}
_local4++;
}
return(false);
};
DiamondMine.prototype.check_all_stopped = function () {
if (!this.check_for_movement()) {
this.evaluate_grid(0);
var _local2 = this.hasPossibleSolution();
if (!_local2) {
if (this.game_type == "Timer") {
this.paused = true;
this.new_board();
} else {
this.game_over();
}
} else {
this.paused = false;
}
}
};
DiamondMine.prototype.game_over = function () {
var _local4 = 0;
while (_local4 < this.num_rows) {
var _local3 = 0;
while (_local3 < this.num_columns) {
this.piece_holder[(("piece_" + _local4) + "_") + _local3].game_over = true;
_local3++;
}
_local4++;
}
this.explode_pieces();
this.game_over_prompt._play();
_root._gotoAndStop("Game Over");
};
DiamondMine.prototype.onEnterFrame = function () {
if ((((getTimer() - this.last_clicked_time) > 3000) && (!this.check_for_movement())) && (this.automatic_hint)) {
this.last_clicked_time = getTimer();
var _local6 = this.get_current_grid();
var _local3 = 0;
while (_local3 < this.num_rows) {
var _local2 = 0;
while (_local2 < this.num_columns) {
var _local5 = this.get_neighbors(_local3, _local2);
if (this.check_possible_swaps(_local6, _local3, _local2, _local5)) {
var _local4 = this.piece_holder[(("piece_" + _local3) + "_") + _local2];
_local4.onRollOver();
_local4.onRollOut();
return(undefined);
}
_local2++;
}
_local3++;
}
}
this.update_game_timer();
this.update_game_properties();
};
DiamondMine.prototype.update_game_timer = function () {
if ((this.game_type == "Timer") && (!this.paused)) {
this.time_percentage = this.time_percentage - (this.time_percent_change + (this.level_percent_change_increase * this.current_level));
}
this.render_game_timer();
};
DiamondMine.prototype.render_game_timer = function () {
var _local3 = (this.time_percentage / 100) * this.timer_mc.frame_mc._width;
this.timer_mc.bar_mc._x = this.timer_mc.bar_mc._x + ((_local3 - this.timer_mc.bar_mc._x) / 10);
this.timer_mc.bar_mc._gotoAndStop(Math.round((this.time_percentage / 100) * this.timer_mc.bar_mc._totalframes) + 1);
if (this.time_percentage >= 100) {
this.next_level();
} else if (this.time_percentage <= 0) {
_root._gotoAndStop("Game Over");
}
};
DiamondMine.prototype.next_level = function () {
this.play_sound("level");
for (var _local3 in this.piece_holder) {
var _local2 = this.piece_holder[_local3];
if (typeof(_local2) == "movieclip") {
if ((_local2._name != "backgrounds") && (_local2._name != "play_area")) {
_local2.unloadMovie();
}
}
}
this.paused = true;
this.explode_pieces();
this.time_percentage = 50;
};
DiamondMine.prototype.explode_pieces = function () {
var _local5 = 0;
while (_local5 < this.num_rows) {
var _local4 = 0;
while (_local4 < this.num_columns) {
var _local3 = this.piece_holder[(("piece_" + _local5) + "_") + _local4];
_local3.velocity_x = _global.Math2.randf(-10, 10);
_local3.velocity_y = _global.Math2.randf(-30, -20);
_local3.final_position_y = (this.piece_holder.play_area._y + this.piece_holder.play_area._height) + _local3._height;
_local3._y = _local3.final_position_y + 100;
_local3.remove_piece = true;
_local3.num_wait_frames = _global.Math2.randi(0, 50);
_local3.current_frame = 0;
_local3.swapDepths(this.depth++);
_local3._name = "__TEMP__" + _global.Math2.randi(0, 10000);
_local3.onEnterFrame = _local3.wait_to_fall;
_local4++;
}
_local5++;
}
};
DiamondMine.prototype.update_score = function (remove_list) {
var _local4 = 1;
if (this.avatar_bonus) {
_local4 = 10;
}
var _local5 = (remove_list.length * (this.points_per_piece + (this.level_point_increase * this.current_level))) * _local4;
this.score = this.score + _local5;
this.score_txt.scrollToNumber(Math.round(this.score), 10);
this.depth++;
var _local3 = this.attachMovie("points_animation", "points" + this.depth, this.depth);
var _local2 = remove_list.rande();
_local3._x = this.piece_holder[(("piece_" + _local2.j) + "_") + _local2.k]._x;
_local3._y = this.piece_holder[(("piece_" + _local2.j) + "_") + _local2.k]._y;
_local3.points = "+" + _local5;
};
DiamondMine.prototype.update_game_properties = function () {
_root.score = this.score;
};
DiamondMine.prototype.new_board = function () {
var _local5 = 0;
while (_local5 < this.num_rows) {
var _local3 = 0;
while (_local3 < this.num_columns) {
this.piece_holder[(("piece_" + _local5) + "_") + _local3].regenerate = true;
_local3++;
}
_local5++;
}
this.explode_pieces();
for (_local5 in this.piece_holder) {
var _local4 = this.piece_holder[_local5];
if (typeof(_local4) == "movieclip") {
if (((!_local4.regenerate) && (_local4._name != "backgrounds")) && (_local4._name != "play_area")) {
_local4.unloadMovie();
}
}
}
this.new_board_prompt._play();
_root.myHandle = false;
};
DiamondMine.prototype.pause_toggle = function () {
this.paused = !this.paused;
if (this.paused) {
this.pause_game();
} else {
this.unpause_game();
}
};
DiamondMine.prototype.pause_game = function () {
this.paused = true;
this.paused_prompt.play();
};
DiamondMine.prototype.unpause_game = function () {
this.paused = false;
this.paused_prompt.play();
this.handle_solutions_2();
};
DiamondMine.prototype.play_sound = function (linkage) {
var _local2 = new Sound(this);
_local2.attachSound(linkage);
_local2.start(0, 1);
};
DiamondMine.prototype.onMouseDown = function () {
};
#endinitclip
this._x = 0;
this._y = 0;
Instance of Symbol 391 MovieClip in Symbol 471 MovieClip [DiamondMineComponent] Frame 1
on (rollOver) {
if (this._parent.hint_count > 0) {
this.myButton.gotoAndStop(2);
}
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
on (press) {
if ((this._parent.hint_count > 0) && (this._parent.paused != true)) {
var myHintFound = false;
this["star_" + this._parent.hint_count]._alpha = 0;
this._parent.hint_count--;
var grid = this._parent.get_current_grid();
var j = 0;
while (j < this._parent.num_rows) {
var k = 0;
while (k < this._parent.num_columns) {
var neighbors = this._parent.get_neighbors(j, k);
if (this._parent.check_possible_swaps(grid, j, k, neighbors)) {
var _mc = this._parent.piece_holder[(("piece_" + j) + "_") + k];
_mc.pieces.myHint.gotoAndPlay(2);
this._parent.score = this._parent.score - 25;
myHintFound = true;
break;
}
k++;
}
if (myHintFound) {
break;
}
j++;
}
}
trace("My hint count = " + this._parent.hint_count);
if (this._parent.hint_count < 1) {
this._alpha = 60;
}
}
Instance of Symbol 393 MovieClip in Symbol 471 MovieClip [DiamondMineComponent] Frame 1
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
on (release) {
this._parent.pause_toggle();
}
Instance of Symbol 395 MovieClip in Symbol 471 MovieClip [DiamondMineComponent] Frame 1
on (rollOver) {
this.myButton.gotoAndStop(2);
}
on (rollOut) {
this.myButton.gotoAndStop(1);
}
on (press) {
_root.gotoAndStop("Instructions");
}
Instance of Symbol 417 MovieClip "piece_holder" in Symbol 471 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 475 MovieClip Frame 21
stop();
Symbol 478 MovieClip Frame 1
stop();
Symbol 478 MovieClip Frame 2
play();
Symbol 478 MovieClip Frame 7
stop();
Symbol 481 MovieClip Frame 1
stop();
Instance of Symbol 478 MovieClip in Symbol 481 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
gotoAndStop (1);
};
this.onRelease = function () {
_root.playAgain();
};
this.onRollOver = function () {
gotoAndPlay (2);
};
}
Instance of Symbol 478 MovieClip in Symbol 481 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
gotoAndStop (1);
};
this.onRelease = function () {
getURL (_root.Branditz.pDomain + "/members/login/");
};
this.onRollOver = function () {
gotoAndPlay (2);
};
}
Symbol 481 MovieClip Frame 2
stop();
Symbol 487 MovieClip Frame 1
stop();
Instance of Symbol 478 MovieClip in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
gotoAndStop (1);
};
this.onRelease = function () {
_root.playAgain();
};
this.onRollOver = function () {
gotoAndPlay (2);
};
}
Instance of Symbol 478 MovieClip in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
this.onRollOut = function () {
gotoAndStop (1);
};
this.onRelease = function () {
_root.Stattooz.submitScore();
};
this.onRollOver = function () {
gotoAndPlay (2);
};
}
Symbol 487 MovieClip Frame 2
stop();
Symbol 490 MovieClip Frame 1
_root.Branditz.activateElement("gameover", this);
if ((Number(_root.Stattooz.pGameType) == 2) || (Number(_root.Stattooz.pGameType) == 3)) {
gotoAndStop (2);
} else {
if (_root.score > _root.Stattooz.pThreshold) {
_root.Stattooz.reportEvent("endfail");
} else {
_root.Stattooz.reportEvent("endpass");
}
if (Number(_root.Stattooz.pGameType) == 1) {
myButtons.gotoAndStop(2);
}
stop();
}
Symbol 490 MovieClip Frame 2
if (_root.score > _root.Stattooz.pThreshold) {
myButtons.gotoAndStop("fail");
_root.Stattooz.reportEvent("endfail");
gameover_title.text = "You'll need to try harder then that!";
gameover_text.text = ("you need to score at least " + _root.pStattooz.pThreshold) + " to enter your high score";
} else {
_root.Stattooz.reportEvent("endpass");
}
stop();