Frame 1
function f_GetBestScores() {
_root.o_Settings = SharedObject.getLocal("GameSettings");
_root.n_BestScoreNormal = 0;
if (o_Settings.data.n_BestScoreNormal != undefined) {
_root.n_BestScoreNormal = o_Settings.data.n_BestScoreNormal;
}
_root.n_BestScoreEasy = 0;
if (o_Settings.data.n_BestScoreEasy != undefined) {
_root.n_BestScoreEasy = o_Settings.data.n_BestScoreEasy;
}
}
function f_AnyAnimation() {
var _local4 = false;
var _local3 = 0;
while (_local3 < _root.o_PosData.length) {
var _local2 = _root.o_PosData[_local3].length;
while (_local2 > 0) {
if (((_root.o_PosData[_local3][_local2].n_Colour == 0) && (_root.o_PosData[_local3][_local2].n_BonusTypeID == 0)) && (_root.o_PosData[_local3][_local2].b_Animating)) {
_root.o_PosData[_local3][_local2].b_Animating = false;
_root.f_SetCube(_local3, 0, 0, _local2);
}
if (_root.o_PosData[_local3][_local2].d_AnimationStart != undefined) {
if (_root.o_PosData[_local3][_local2].d_AnimationStart.getTime() <= (new Date().getTime() - 500)) {
_root.o_PosData[_local3][_local2].n_Colour = 0;
_root.o_PosData[_local3][_local2].n_BonusTypeID = 0;
_root.o_PosData[_local3][_local2].b_Animating = false;
_root.o_PosData[_local3][_local2].d_AnimationStart = undefined;
_root.f_SetCube(_local3, 0, 0, _local2);
}
}
if (_root.o_PosData[_local3][_local2].b_Animating) {
return(true);
}
_local2--;
}
_local3++;
}
_local3 = 0;
while (_local3 < _root.o_PosArray.length) {
var _local2 = _root.n_GameDepth;
while (_local2 > 0) {
if ((_root.o_PosData[_local3][_local2].n_Colour == 0) && (_root.o_PosData[_local3][_local2 - 1].n_Colour != 0)) {
return(true);
}
_local2--;
}
_local3++;
}
return(false);
}
function f_EndPopping(o_Source, n_Column, n_Y) {
_root.o_PosData[n_Column][n_Y].b_Animating = false;
_root.o_PosData[n_Column][n_Y].n_Colour = 0;
_root.o_PosData[n_Column][n_Y].n_BonusTypeID = 0;
_root.o_PosData[n_Column][n_Y].d_AnimationStart = undefined;
o_Source.gotoAndStop(1);
}
function f_AnimatePop(n_Column, n_Colour, n_Y) {
var _local2;
_root.o_PosData[n_Column][n_Y].b_Animating = true;
if (_root.o_PosData[n_Column][n_Y].b_Back) {
_local2 = _root.o_BackHolder[(("Cube_" + n_Y) + "_") + n_Column];
} else {
_local2 = _root.o_FrontHolder[(("Cube_" + n_Y) + "_") + n_Column];
}
_root.o_PosData[n_Column][n_Y].d_AnimationStart = new Date();
if (n_Colour >= 0) {
_local2.o_Graphics.gotoAndPlay(("Cube_" + n_Colour.toString()) + "_Pop");
} else if (n_Colour == -1) {
_local2.o_Graphics.gotoAndPlay("Cube_Explode");
} else if (n_Colour == -2) {
_local2.o_Graphics.gotoAndPlay("EndGame");
}
_local2.o_Mask._visible = false;
_local2.o_Decal._visible = false;
_local2.o_Bomb._visible = false;
}
function f_SetCube(n_Column, n_Colour, n_BonusTypeID, n_Y) {
var _local2;
if (_root.o_PosData[n_Column][n_Y].b_Back) {
_local2 = _root.o_BackHolder[(("Cube_" + n_Y) + "_") + n_Column];
} else {
_local2 = _root.o_FrontHolder[(("Cube_" + n_Y) + "_") + n_Column];
}
_local2.o_Graphics.gotoAndStop("Cube_" + n_Colour.toString());
_local2.o_Mask._visible = n_Colour != 0;
if (n_BonusTypeID > 0) {
_local2.o_Decal.gotoAndStop(n_BonusTypeID);
_local2.o_Decal._visible = true;
_local2.o_Bomb._visible = true;
_local2.o_Bomb.gotoAndStop(n_BonusTypeID);
} else {
_local2.o_Decal.gotoAndStop(1);
_local2.o_Decal._visible = false;
_local2.o_Bomb._visible = false;
}
}
function f_TryPop(n_Column, n_Y, b_Start, n_Colour) {
var _local6;
var _local3;
var _local11 = false;
var _local10 = false;
var _local13;
var _local4;
var _local5;
if (b_Start) {
_root.o_PopArray = new Array(_root.o_PosData.length);
i = 0;
while (i < _root.o_PopArray.length) {
_root.o_PopArray[i] = new Array(_root.n_GameDepth);
j = 0;
while (j < _root.o_PopArray[j].length) {
_root.o_PopArray[i][j] = false;
j++;
}
i++;
}
_root.o_PopToDo = new Array();
}
if ((((!_root.o_PopArray[n_Column][n_Y]) && (_root.o_PosData[n_Column][n_Y].n_Colour == n_Colour)) && (!_root.o_PopArray[n_Column][n_Y].b_Animating)) && (_root.o_PosData[n_Column][n_Y + 1].n_Colour != 0)) {
_root.o_PopToDo.push(new Object({n_Y:n_Y, n_Column:n_Column}));
_root.o_PopArray[n_Column][n_Y] = true;
if (n_Y > 0) {
_root.f_TryPop(n_Column, Number(n_Y) - 1, false, n_Colour);
}
if (n_Y < _root.n_GameDepth) {
_root.f_TryPop(n_Column, Number(n_Y) + 1, false, n_Colour);
}
if (n_Column == 0) {
_root.f_TryPop(_root.o_PosData.length - 1, n_Y, false, n_Colour);
} else {
_root.f_TryPop(Number(n_Column) - 1, n_Y, false, n_Colour);
}
if (n_Column == (_root.o_PosData.length - 1)) {
_root.f_TryPop(0, n_Y, false, n_Colour);
} else {
_root.f_TryPop(Number(n_Column) + 1, n_Y, false, n_Colour);
}
}
if (b_Start) {
if (o_PopToDo.length >= 3) {
_local13 = 0;
_local4 = new Array();
var i = 0;
while (i < o_PopToDo.length) {
_local4.push(new Object({n_Y:o_PopToDo[i].n_Y, n_Column:o_PopToDo[i].n_Column}));
i++;
}
var i = 0;
while (i < o_PopToDo.length) {
n_Column = o_PopToDo[i].n_Column;
n_Y = o_PopToDo[i].n_Y;
if (_root.o_PosData[n_Column][n_Y].b_Back) {
_local6 = _root.o_BackHolder[(("Cube_" + n_Y) + "_") + n_Column];
} else {
_local6 = _root.o_FrontHolder[(("Cube_" + n_Y) + "_") + n_Column];
}
if ((_root.o_PosData[n_Column][n_Y].n_BonusTypeID == 1) || (_root.o_PosData[n_Column][n_Y].n_BonusTypeID == 2)) {
_local11 = true;
_local3 = _root.f_Bomb(((_root.o_PosData[n_Column][n_Y].n_BonusTypeID == 1) ? "x" : "y"), n_Column, n_Y);
_root.f_ShowMessage(((_root.o_PosData[n_Column][n_Y].n_BonusTypeID == 1) ? "Horizontal" : "Vertical") + " Bomb!");
var _local2 = 0;
while (_local2 < _local3.length) {
if (_root.o_PosData[_local3[_local2].n_Col][_local3[_local2].n_Y].b_Back) {
_local6 = _root.o_BackHolder[(("Cube_" + _local3[_local2].n_Y) + "_") + _local3[_local2].n_Col];
} else {
_local6 = _root.o_FrontHolder[(("Cube_" + _local3[_local2].n_Y) + "_") + _local3[_local2].n_Col];
}
_root.f_AnimatePop(_local3[_local2].n_Col, -1, _local3[_local2].n_Y);
_local5 = false;
j = 0;
while (j < _local4.length) {
if ((_local4[j].n_Column == _local3[_local2].n_Col) && (_local4[j].n_Y == _local3[_local2].n_Y)) {
_local5 = true;
}
j++;
}
if (!_local5) {
_local4.push(new Object({n_Y:_local3[_local2].n_Y, n_Column:_local3[_local2].n_Col}));
}
_local2++;
}
} else if (_root.o_PosData[n_Column][n_Y].n_BonusTypeID == 3) {
_local10 = true;
}
_root.f_AnimatePop(n_Column, n_Colour, n_Y);
i++;
}
if ((_local4.length > 0) && (_root.s_PlayMode != "tutorial")) {
_root.n_CubesNeeded = _root.n_CubesNeeded - _local4.length;
if (_root.n_CubesNeeded < 0) {
_root.n_CubesNeeded = 0;
}
_root.f_ShowMessage(((("(" + _local4.length) + "x) ") + (_local4.length * _root.n_ScoreCube).toString()) + " points");
_root.n_Score = _root.n_Score + Math.floor((_local4.length * _root.n_ScoreCube) * (1 + ((_local4.length - 3) * _root.n_PopMultiplier)));
}
if (_local10) {
_root.f_Randomise();
_root.f_PlaySound("o_Sounds", "Swap");
}
if (_local11) {
_root.f_StartShake();
_root.f_PlaySound("o_Sounds", "Bomb");
} else {
_root.f_PlaySound("o_Sounds", "Pop");
}
}
}
}
function f_Randomise() {
var _local4 = _root.attachMovie("SwapEffect", "SwapEffect_" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:275, _y:275});
_local4.gotoAndPlay(1);
var _local3 = 0;
while (_local3 < _root.o_PosData.length) {
var _local2 = _root.o_PosData[_local3].length;
while (_local2 > 0) {
if ((!_root.o_PosData[_local3][_local2].b_Animating) && (_root.o_PosData[_local3][_local2].n_Colour > 0)) {
_root.o_PosData[_local3][_local2].n_Colour = Math.ceil(Math.random() * _root.n_ColoursNormal);
}
_local2--;
}
_local3++;
}
}
function f_BuildField(n_Depth, n_FillToLevel, n_Level) {
var _local4;
var _local13;
_root.d_Timer = new Date();
_root.d_LastPause = undefined;
_root.b_GameOver = false;
_root.b_Animating = false;
_root.n_Level = n_Level;
_root.n_CubesNeeded = ((_root.s_GameMode == "menu") ? 100 : (_root.o_Levels[n_Level][1]));
_root.n_GameDepth = n_Depth;
_root.o_Timer._visible = (_root.s_GameMode != "menu") && (_root.s_PlayMode != "tutorial");
if ((_root.s_GameMode != "menu") && (_root.s_PlayMode != "tutorial")) {
_root.o_Timer.n_Seconds = _root.o_Levels[n_Level][0];
} else {
_root.o_Timer.n_Seconds = _root.n_GameLength;
}
_root.o_Timer.d_LastTick = new Date();
_root.b_Shaking = false;
_root.b_Paused = false;
_root.d_ShakeStart = new Date();
_root.d_ShakeStart.setTime(new Date().getTime() - n_ShakeTime);
_root.o_FrontHolder._x = _root.n_FieldX;
_root.o_FrontHolder._y = _root.n_FieldY;
_root.o_BackHolder._x = _root.n_FieldX;
_root.o_BackHolder._y = _root.n_FieldY;
_root.a_MessageArray = new Array();
_root.d_MessageLast = undefined;
_root.o_Menu._visible = _root.s_GameMode == "menu";
if (_root.o_Menu._visible) {
if (_root.o_Settings.data.n_BestScore != undefined) {
_root.o_Menu.o_BestScore.text = _root.o_Settings.data.n_BestScore;
}
if (_root.o_Settings.data.n_BestLevel != undefined) {
_root.o_Menu.o_BestLevel.text = _root.o_Settings.data.n_BestLevel;
}
}
_root.o_GameOverlay._visible = _root.s_GameMode != "menu";
if (_root.o_GameOverlay._visible && (_root.s_PlayMode == "tutorial")) {
_root.o_GameOverlay.o_Tutorial.gotoAndStop("Tutorial_1");
_root.b_InstructionsOn = true;
_root.o_GameOverlay.o_Tutorial._visible = true;
} else {
_root.o_GameOverlay.o_Tutorial.gotoAndStop("Tutorial_0");
_root.b_InstructionsOn = false;
_root.o_GameOverlay.o_Tutorial._visible = false;
}
_root.o_Menu._x = 0;
_root.o_GameOverlay._x = 0;
_root.d_LastMove = new Date();
_root.o_ToDrop.o_Progress._visible = _root.s_GameMode != "menu";
if (_root.s_GameMode == "menu") {
_root.o_Progress.n_MaxValue = _root.n_TimerIntervalMenu;
_root.n_IntervalCount = 0;
} else {
_root.n_TimerInterval = ((_root.s_PlayMode == "normal") ? (_root.n_TimerIntervalTop) : (_root.n_TimerIntervalBottom));
_root.o_Progress.n_MaxValue = _root.n_TimerInterval;
_root.n_IntervalCount = 0;
}
_root.o_Progress.n_CurrentValue = 0;
if (n_Level <= 1) {
_root.o_DropData = new Array(o_PosArray.length);
_root.o_PosData = new Array(o_PosArray.length);
var _local2 = 0;
while (_local2 < _root.o_PosArray.length) {
_root.o_PosData[_local2] = new Array(n_Depth);
_local2++;
}
_local2 = 0;
while (_local2 < _root.o_PosArray.length) {
if (_root.o_ToDrop["Cube_" + _root.o_PosArray[_local2][4]]) {
_root.o_ToDrop["Cube_" + _root.o_PosArray[_local2][4]].removeMovieClip();
}
_local4 = _root.o_ToDrop.attachMovie("Cube", "Cube_" + _root.o_PosArray[_local2][4], _root.o_ToDrop.getNextHighestDepth(), {_x:_root.o_PosArray[_local2][0], _y:_root.o_PosArray[_local2][1] + _root.n_PosYSpace});
n_Brightness = _root.o_PosArray[_local2][2];
o_DropData[_root.o_PosArray[_local2][4]] = new Object({n_Brightness:n_Brightness, n_Colour:0, n_BonusTypeID:0, b_Animating:false, b_Back:_root.o_PosArray[_local2][3], d_AnimationStart:undefined});
_local4.o_Mask._visible = false;
_local4.o_Graphics.gotoAndStop(1);
_local4.o_Bomb._visible = false;
_local4.o_Decal.gotoAndStop(1);
_local4.o_Decal._visible = false;
var _local3 = n_Depth;
while (_local3 >= 0) {
if (!_root.o_PosArray[_local2][3]) {
if (_root.o_FrontHolder[(("Cube_" + _local3) + "_") + _root.o_PosArray[_local2][4]]) {
_root.o_FrontHolder[(("Cube_" + _local3) + "_") + _root.o_PosArray[_local2][4]].removeMovieClip();
}
_local4 = _root.o_FrontHolder.attachMovie("Cube", (("Cube_" + _local3) + "_") + _root.o_PosArray[_local2][4], _root.o_FrontHolder.getNextHighestDepth(), {_x:_root.o_PosArray[_local2][0], _y:_root.o_PosArray[_local2][1] + (n_BaseY + (_root.n_PosYSpace * _local3))});
} else {
if (_root.o_BackHolder[(("Cube_" + _local3) + "_") + _root.o_PosArray[_local2][4]]) {
_root.o_BackHolder[(("Cube_" + _local3) + "_") + _root.o_PosArray[_local2][4]].removeMovieClip();
}
_local4 = _root.o_BackHolder.attachMovie("Cube", (("Cube_" + _local3) + "_") + _root.o_PosArray[_local2][4], _root.o_BackHolder.getNextHighestDepth(), {_x:_root.o_PosArray[_local2][0], _y:_root.o_PosArray[_local2][1] + (n_BaseY + (_root.n_PosYSpace * _local3))});
}
_local4.n_Col = _root.o_PosArray[_local2][4];
_local4.n_Y = _local3;
n_Brightness = _root.o_PosArray[_local2][2];
if ((_root.s_PlayMode == "tutorial") || (_local3 < (_root.n_GameDepth - (n_FillToLevel - 1)))) {
o_PosData[_root.o_PosArray[_local2][4]][_local3] = new Object({n_Brightness:n_Brightness, n_Colour:0, n_BonusTypeID:0, b_Animating:false, b_Back:_root.o_PosArray[_local2][3], d_AnimationStart:undefined});
} else {
o_PosData[_root.o_PosArray[_local2][4]][_local3] = new Object({n_Brightness:n_Brightness, n_Colour:Math.ceil(Math.random() * _root.n_ColoursNormal), n_BonusTypeID:0, b_Animating:false, b_Back:_root.o_PosArray[_local2][3], d_AnimationStart:undefined});
}
_root.f_SetCube(_root.o_PosArray[_local2][4], o_PosData[_root.o_PosArray[_local2][4]][_local3].n_Colour, o_PosData[_root.o_PosArray[_local2][4]][_local3].n_BonusTypeID, _local3);
_local3--;
}
_local2++;
}
if (_root.s_PlayMode != "tutorial") {
_root.f_ChooseNextDrop();
}
} else if (!_root.b_GameOver) {
if (n_Level >= _root.o_Levels.length) {
n_Level = _root.o_Levels.length - 1;
_local13 = _root.attachMovie("Finished_Animation", "o_LevelUp_Anim", _root.getNextHighestDepth(), {_x:_root.n_AlertX, _y:_root.n_AlertY});
_root.n_Score = _root.n_Score + 500000;
_root.d_GameOverTimer = new Date();
_root.b_GameOver = true;
} else {
_local13 = _root.attachMovie("LevelUp_Animation", "o_LevelUp_Anim", _root.getNextHighestDepth(), {_x:_root.n_AlertX, _y:_root.n_AlertY});
_local13.o_Display.o_LevelText.text = n_Level;
_local13.o_Display.o_NeededText.text = _root.o_Levels[n_Level][1];
}
}
_root.b_Setup = true;
}
function f_DrawGuideLines() {
var _local4;
var _local5;
var _local2;
var _local3;
_root.o_DropOutline = new Array();
var _local6 = 0;
while (_local6 < _root.o_DropData.length) {
if (_root.o_DropData[_local6].n_Colour != 0) {
_local4 = false;
_local5 = _root.n_GameDepth;
while ((_local5 >= 0) && (!_local4)) {
if (((_local5 < _root.n_GameDepth) && (_root.o_PosData[_local6][_local5].n_Colour == 0)) && (!_root.o_PosData[_local6][_local5].b_Animating)) {
_local2 = _local5;
if (_root.o_PosData[_local6][_local2].b_Back) {
_local3 = _root.o_BackHolder[(("Cube_" + _local2) + "_") + _local6];
} else {
_local3 = _root.o_FrontHolder[(("Cube_" + _local2) + "_") + _local6];
}
_root.o_DropOutline.push(new Object({n_Pos:_local6, n_Y:_local5}));
if (_local5 == 0) {
_local3.o_Graphics.gotoAndPlay("Cube_Outline_Alert");
} else {
_local3.o_Graphics.gotoAndStop("Cube_Outline");
}
_local4 = true;
} else if (((_local5 == _root.n_GameDepth) && (_root.o_PosData[_local6][_local5].n_Colour == 0)) && (!_root.o_PosData[_local6][_local5].b_Animating)) {
_local2 = _local5;
if (_root.o_PosData[_local6][_local2].b_Back) {
_local3 = _root.o_BackHolder[(("Cube_" + _local2) + "_") + _local6];
} else {
_local3 = _root.o_FrontHolder[(("Cube_" + _local2) + "_") + _local6];
}
_root.o_DropOutline.push(new Object({n_Pos:_local6, n_Y:_local5}));
_local3.o_Graphics.gotoAndStop("Cube_Outline");
_local4 = true;
}
_local5--;
}
}
_local6++;
}
}
function f_Bomb(s_Direction, n_Col, n_Y) {
var _local2 = new Array();
s_Direction = s_Direction.toLowerCase();
_local2.push(new Object({n_Col:n_Col, n_Y:n_Y}));
if (s_Direction == "y") {
n_IntY = 0;
while (n_IntY < _root.o_PosData[0].length) {
if (_root.o_PosData[n_Col][n_IntY].n_Colour > 0) {
_local2.push(new Object({n_Col:n_Col, n_Y:n_IntY}));
}
n_IntY++;
}
} else if (s_Direction == "x") {
n_IntCol = 0;
while (n_IntCol < _root.o_PosData.length) {
if (_root.o_PosData[n_IntCol][n_Y].n_Colour > 0) {
_local2.push(new Object({n_Col:n_IntCol, n_Y:n_Y}));
}
n_IntCol++;
}
}
return(_local2);
}
function f_DoDrops() {
var _local2;
var _local6;
var _local4 = new Array();
var _local7;
_local2 = 0;
while (_local2 < _root.o_PosArray.length) {
_local6 = _root.n_GameDepth;
while (_local6 > 0) {
if ((((_root.o_PosData[_local2][_local6].n_Colour == 0) && (_root.o_PosData[_local2][_local6 - 1].n_Colour != 0)) && (!_root.o_PosData[_local2][_local6].b_Animating)) && (!_root.o_PosData[_local2][_local6 - 1].b_Animating)) {
_root.o_PosData[_local2][_local6].n_Colour = _root.o_PosData[_local2][_local6 - 1].n_Colour;
_root.o_PosData[_local2][_local6].n_BonusTypeID = _root.o_PosData[_local2][_local6 - 1].n_BonusTypeID;
_root.o_PosData[_local2][_local6 - 1].n_Colour = 0;
_root.o_PosData[_local2][_local6 - 1].n_BonusTypeID = 0;
if ((_root.o_PosData[_local2][_local6 + 1].n_Colour != 0) || (_local6 == _root.n_GameDepth)) {
_local4.push(new Object({n_Y:_local6, n_Column:_local2}));
}
}
_local6--;
}
_local2++;
}
if (_local4.length > 0) {
var _local3 = 0;
while (_local3 < _local4.length) {
_root.f_TryPop(_local4[_local3].n_Column, _local4[_local3].n_Y, true, _root.o_PosData[_local4[_local3].n_Column][_local4[_local3].n_Y].n_Colour);
_local3++;
}
}
}
function f_Rotate(b_Right) {
var _local5;
var _local4;
var _local3;
if (_root.d_LastMove.getTime() <= (new Date() - ((_root.s_PlayMode == "normal") ? (_root.n_MoveIntervalTop) : (_root.n_MoveIntervalBottom)))) {
_root.d_LastMove = new Date();
_local5 = new Array(_root.o_DropData.length);
var _local2 = 0;
while (_local2 < _local5.length) {
if (!b_Right) {
_local4 = _local2 - 1;
if (_local4 < 0) {
_local4 = _local5.length - 1;
}
} else {
_local4 = _local2 + 1;
if (_local4 == _local5.length) {
_local4 = 0;
}
}
_local5[_local4] = new Object({n_Colour:_root.o_DropData[_local2].n_Colour, n_BonusTypeID:_root.o_DropData[_local2].n_BonusTypeID});
_local2++;
}
_local2 = 0;
while (_local2 < _root.o_DropData.length) {
_root.o_DropData[_local2].n_Colour = _local5[_local2].n_Colour;
_root.o_DropData[_local2].n_BonusTypeID = _local5[_local2].n_BonusTypeID;
_local3 = _root.o_ToDrop["Cube_" + _local2];
if (_local3) {
_local3.o_Mask._visible = false;
_local3.o_Graphics.gotoAndStop(1 + _root.o_DropData[_local2].n_Colour);
if (_root.o_DropData[_local2].n_BonusTypeID > 0) {
_local3.o_Bomb._visible = true;
_local3.o_Bomb.gotoAndStop(_root.o_DropData[_local2].n_BonusTypeID);
_local3.o_Decal.gotoAndStop(_root.o_DropData[_local2].n_BonusTypeID);
_local3.o_Decal._visible = true;
} else {
_local3.o_Bomb._visible = false;
_local3.o_Decal.gotoAndStop(1);
_local3.o_Decal._visible = false;
}
}
_local2++;
}
}
_root.f_DrawGuideLines();
}
function f_GetDropLength() {
var _local3 = 0;
var _local2 = 1;
if (s_GameMode == "menu") {
_local2 = 4;
} else {
_local2 = Math.round(_root.o_Levels[_root.n_Level][2] + (Math.random() * (_root.o_Levels[_root.n_Level][3] - _root.o_Levels[_root.n_Level][2])));
}
return(_local2);
}
function f_ChooseNextDrop() {
var _local5;
var _local2;
var _local6 = _root.n_LastPos;
var _local8 = _root.f_GetDropLength();
var _local3;
var _local7;
var _local4 = 0;
while (_local4 < _root.o_PosArray.length) {
_local2 = _root.o_ToDrop["Cube_" + _local4];
if (_local2) {
_local2.o_Mask._visible = false;
_local2.o_Graphics.gotoAndStop(1);
_local2.o_Decal._visible = false;
_local2.o_Bomb._visible = false;
_root.o_DropData[_local4].n_Colour = 0;
_root.o_DropData[_local4].n_BonusTypeID = 0;
}
_local4++;
}
n_X = _local6;
while (n_X < (_local6 + _local8)) {
_local5 = Math.ceil(Math.random() * _root.n_ColoursNormal);
_local3 = ((n_X >= _root.o_PosArray.length) ? (n_X - _root.o_PosArray.length) : (n_X));
_local2 = _root.o_ToDrop["Cube_" + _local3];
if (_local2) {
_root.o_DropData[_local3].n_Colour = _local5;
if (Math.random() <= _root.n_BombChance) {
_local7 = Math.random();
if (_local7 < 0.5) {
_root.o_DropData[_local3].n_BonusTypeID = 1;
} else {
_root.o_DropData[_local3].n_BonusTypeID = 2;
}
} else {
_root.o_DropData[_local3].n_BonusTypeID = 0;
}
_local2.o_Mask._visible = false;
_local2.o_Graphics.gotoAndStop(1 + _local5);
if (_root.o_DropData[_local3].n_BonusTypeID > 0) {
_local2.o_Bomb._visible = true;
_local2.o_Bomb.gotoAndStop(_root.o_DropData[_local3].n_BonusTypeID);
_local2.o_Decal.gotoAndStop(_root.o_DropData[_local3].n_BonusTypeID);
_local2.o_Decal._visible = true;
} else {
_local2.o_Bomb._visible = false;
_local2.o_Decal.gotoAndStop(1);
_local2.o_Decal._visible = false;
}
}
n_X++;
}
_root.d_Timer = new Date();
}
function f_DropVisibility() {
var _local3 = false;
if (_root.b_GameOver) {
_root.o_FrontHolder._alpha = 100;
} else if (!Key.isDown(32)) {
var _local2 = 0;
while (_local2 < _root.o_DropData.length) {
if (_root.o_DropData[_local2].n_Colour > 0) {
if (!_root.o_PosData[_local2][0].b_Back) {
_local3 = true;
}
}
_local2++;
}
if (_local3 && (_root.o_FrontHolder._alpha < _root.n_FrontAlphaUpper)) {
_root.o_FrontHolder._alpha = _root.o_FrontHolder._alpha + _root.n_FrontAlphaChange;
} else if ((!_local3) && (_root.o_FrontHolder._alpha > _root.n_FrontAlphaLower)) {
_root.o_FrontHolder._alpha = _root.o_FrontHolder._alpha - _root.n_FrontAlphaChange;
}
if ((!_local3) && (_root.o_BackHolder._alpha < _root.n_BackAlphaUpper)) {
_root.o_BackHolder._alpha = _root.o_BackHolder._alpha + _root.n_BackAlphaChange;
} else if (_local3 && (_root.o_BackHolder._alpha > _root.n_BackAlphaLower)) {
_root.o_BackHolder._alpha = _root.o_BackHolder._alpha - _root.n_BackAlphaChange;
}
}
}
function f_StartDrop() {
_root.n_Drops++;
_root.n_LastPos = 1000;
var _local2 = 0;
while (_local2 < _root.o_DropData.length) {
if ((_root.o_DropData[_local2].n_Colour > 0) && (_root.o_PosData[_local2][0].n_Colour == 0)) {
if (_root.n_LastPos >= _local2) {
_root.n_LastPos = _local2;
}
_root.o_PosData[_local2][0].n_Colour = _root.o_DropData[_local2].n_Colour;
_root.o_PosData[_local2][0].n_BonusTypeID = _root.o_DropData[_local2].n_BonusTypeID;
_root.f_TryPop(_local2, 0, true, _root.o_PosData[_local2][0].n_Colour);
}
_local2++;
}
if (_root.s_GameMode != "menu") {
_root.n_IntervalCount++;
if (_root.n_IntervalCount >= _root.n_IntervalReduction) {
_root.n_IntervalCount = 0;
if (_root.n_TimerInterval > ((_root.s_PlayMode == "normal") ? (_root.n_TimerIntervalTopLower) : (_root.n_TimerIntervalBottomLower))) {
_root.n_TimerInterval = _root.n_TimerInterval - n_IntervalReductionTime;
if (_root.n_TimerInterval < ((_root.s_PlayMode == "normal") ? (_root.n_TimerIntervalTopLower) : (_root.n_TimerIntervalBottomLower))) {
_root.n_TimerInterval = ((_root.s_PlayMode == "normal") ? (_root.n_TimerIntervalTopLower) : (_root.n_TimerIntervalBottomLower));
}
} else {
_root.n_TimerInterval = ((_root.s_PlayMode == "normal") ? (_root.n_TimerIntervalTopLower) : (_root.n_TimerIntervalBottomLower));
}
}
}
}
function f_DoGraphics() {
_root.b_Animating = _root.f_AnyAnimation();
_root.f_DoDrops();
var _local3 = 0;
while (_local3 < _root.o_PosData.length) {
var _local2 = 0;
while (_local2 < _root.o_PosData[_local3].length) {
if (!_root.o_PosData[_local3][_local2].b_Animating) {
_root.f_SetCube(_local3, _root.o_PosData[_local3][_local2].n_Colour, _root.o_PosData[_local3][_local2].n_BonusTypeID, _local2);
}
_local2++;
}
_local3++;
}
_root.f_DrawGuideLines();
_root.f_DropVisibility();
}
function f_StartShake() {
_root.b_Shaking = true;
_root.d_ShakeStart = new Date();
}
function f_Shake() {
if (_root.b_Shaking) {
if ((_root.d_ShakeStart.getTime() + _root.n_ShakeTime) <= new Date().getTime()) {
_root.b_Shaking = false;
_root.o_FrontHolder._x = _root.n_FieldX;
_root.o_FrontHolder._y = _root.n_FieldY;
_root.o_BackHolder._x = _root.n_FieldX;
_root.o_BackHolder._y = _root.n_FieldY;
} else {
_root.o_FrontHolder._x = (_root.n_FieldX - _root.n_ShakeAmount) + (Math.random() * (_root.n_ShakeAmount * 2));
_root.o_BackHolder._x = _root.o_FrontHolder._x;
}
}
}
function f_CheckGameOver() {
var _local5;
var _local8;
_local8 = f_AnyAnimation();
if (!_local8) {
if (_root.o_Timer.n_Seconds == 0) {
_root.b_GameOver = true;
_root.d_GameOverTimer = new Date();
if (_root.o_Timer._visible) {
_root.attachMovie("GameOver", "GameOver", _root.getNextHighestDepth(), {_x:_root.n_GameWidth / 2, _y:_root.n_GameHeight / 2});
}
return(true);
}
var _local3 = 0;
while (_local3 < _root.o_PosData.length) {
if (_root.o_PosData[_local3][0].n_Colour > 0) {
_local5 = false;
var _local4 = 0;
while (_local4 < _root.o_PosData[_local3].length) {
if (_root.o_PosData[_local3][_local4].n_Colour == 0) {
_local5 = true;
} else {
_root.f_AnimatePop(_local3, -2, 0);
}
_local4++;
}
if (!_local5) {
if (_root.s_GameMode != "menu") {
_local5 = false;
var _local2 = 0;
while (_local2 < _root.o_PosData.length) {
if (_root.o_PosData[_local2][0].n_Colour > 0) {
_root.f_TryPop(_local2, 0, true, _root.o_PosData[_local2][0].n_Colour);
}
_local2++;
}
_root.attachMovie("GameOver", "GameOver", _root.getNextHighestDepth(), {_x:_root.n_GameWidth / 2, _y:_root.n_GameHeight / 2});
}
_root.b_GameOver = true;
_root.d_GameOverTimer = new Date();
return(true);
}
}
_local3++;
}
}
return(false);
}
function f_ShowMessage(s_Text) {
if (_root.s_GameMode != "menu") {
_root.a_MessageArray.push(s_Text);
}
}
function f_DoMessages() {
var _local2;
var _local3;
if (_root.a_MessageArray.length > 0) {
if (_root.f_TimeDiff(_root.d_MessageLast, new Date()) >= _root.n_MessageDelay) {
_local2 = _root.attachMovie("Messages", "Messages", _root.getNextHighestDepth());
_local3 = _root.a_MessageArray.shift();
_local2._x = _root.n_GameWidth / 2;
_local2._y = (_root.n_GameHeight / 2) - 50;
_local2.o_InnerText.o_Text.text = _local3;
_local2.gotoAndPlay(1);
_root.d_MessageLast = new Date();
}
}
}
function f_ToggleSounds() {
var _local2 = new Date();
var _local3 = SharedObject.getLocal("GameSettings");
if (d_SoundsToggle == undefined) {
d_SoundsToggle = new Date(1999, 12, 31, 23, 59, 59, 0);
}
if (_root.f_OverTimeDiff(_root.d_SoundsToggle, _local2, 100)) {
_root.b_SoundsOn = !_root.b_SoundsOn;
_local3.data.b_SoundsOn = _root.b_SoundsOn;
if (_root.b_SoundsOn) {
_root.f_PlaySound("o_Sounds", "GameMusic");
} else {
stopAllSounds();
}
_root.d_SoundsToggle = _local2;
}
}
function f_PlaySound(s_Group, s_Sound) {
if (_root.b_SoundsOn) {
_root[s_Group].gotoAndPlay(s_Sound);
}
}
function f_OverTimeDiff(d_DateFrom, d_DateTo, n_MillisecondsDiff) {
var _local2 = d_DateFrom.getTime();
var _local1 = d_DateTo.getTime();
if (((_local2 + n_MillisecondsDiff) <= _local1) || (_local2 >= (_local1 + n_MillisecondsDiff))) {
return(true);
}
return(false);
}
function f_TimeDiff(d_DateFrom, d_DateTo) {
var _local2 = d_DateFrom.getTime();
var _local1 = d_DateTo.getTime();
return(_local1 - _local2);
}
function f_TogglePause() {
if ((_root.f_TimeDiff(_root.d_LastPause, new Date()) > 1000) || (_root.d_LastPause == undefined)) {
if (!_root.b_Paused) {
_root.b_PausedMusic = _root.b_SoundsOn;
if (_root.b_PausedMusic) {
_root.f_ToggleSounds();
}
} else if (_root.b_PausedMusic) {
_root.f_ToggleSounds();
}
_root.b_Paused = !_root.b_Paused;
if (!_root.b_Paused) {
_root.d_Timer = new Date();
_root.o_FrontHolder._visible = true;
_root.o_BackHolder._visible = true;
} else {
_root.o_FrontHolder._visible = false;
_root.o_BackHolder._visible = false;
}
_root.d_KeyLast = new Date();
_root.d_LastPause = new Date();
}
}
function f_ToggleSounds() {
var _local2 = new Date();
var _local3 = SharedObject.getLocal("GameSettings");
if (d_SoundsToggle == undefined) {
d_SoundsToggle = new Date(1999, 12, 31, 23, 59, 59, 0);
}
if (_root.f_OverTimeDiff(_root.d_SoundsToggle, _local2, 100)) {
_root.b_SoundsOn = !_root.b_SoundsOn;
_local3.data.b_SoundsOn = _root.b_SoundsOn;
if (_root.b_SoundsOn) {
_root.f_PlaySound("o_Sounds", "GameMusic");
} else {
stopAllSounds();
}
_root.d_SoundsToggle = _local2;
}
}
var o_PosArray = [[0, 0, 50, true, 0], [-30, 15, 60, true, 1], [30, 15, 60, true, 19], [-60, 30, 70, true, 2], [60, 30, 70, true, 18], [-90, 45, 80, true, 3], [90, 45, 80, true, 17], [-120, 60, 90, true, 4], [120, 60, 90, true, 16], [-150, 75, 100, true, 5], [150, 75, 100, true, 15], [-120, 90, 100, false, 6], [120, 90, 100, false, 14], [-90, 105, 100, false, 7], [90, 105, 100, false, 13], [-60, 120, 100, false, 8], [60, 120, 100, false, 12], [-30, 135, 100, false, 9], [30, 135, 100, false, 11], [0, 150, 100, false, 10]];
var o_Levels = [[0, 0, 0, 0], [120, 40, 2, 2], [120, 45, 2, 3], [110, 50, 3, 3], [110, 55, 3, 4], [100, 60, 3, 4], [100, 70, 3, 5], [100, 75, 3, 5], [100, 80, 3, 5], [90, 90, 3, 5], [90, 100, 3, 5], [90, 120, 4, 5], [80, 150, 4, 5]];
var a_MessageArray;
var n_MessageDelay = 750;
var d_MessageLast;
var n_MessageRepeatDelay = 2000;
var b_GameOver;
var d_GameOverTimer;
var n_GameOverPause = 3000;
var n_GameLength = 300;
var b_SoundsOn;
var d_SoundsToggle;
var b_Paused;
var b_PausedMusic;
var d_LastPause;
var b_Animating;
var n_LastPos;
var CPMStarContentSpotID = "997Q7EB36EEC";
var CPMStarInverlevelID = "998Q93E04B84";
var s_TestSiteString = "kdjfldflk";
var s_LockedSite = "yargleslang";
var s_GameAds = "cpmstar";
var d_AdvertStartTime;
var n_CPMWaitTime = 5000;
var n_MessageRepeatDelay = 2000;
var b_InstructionsOn = true;
var n_AlertX = 0;
var n_AlertY = 180;
var b_Shaking;
var n_ShakeTime = 750;
var d_ShakeStart;
var n_ShakeAmount = 3;
var n_FieldX = 325;
var n_FieldY = 532.5;
var o_DropData = new Array();
var o_DropOutline = new Array();
var o_PosData = new Array();
var o_PopArray = new Array();
var o_PopToDo = new Array();
var n_PopLength = 3;
var n_PopMultiplier = 0.25;
var n_GameDepth;
var n_BombChance = 0.025;
var n_PosYSpace = 32;
var n_BaseY = -414;
var n_Brightness;
var b_Pop;
var n_Drops;
var n_MaxDropLength = [[0, 2, 2], [10, 2, 3], [20, 3, 3], [40, 3, 4], [80, 3, 5], [140, 3, 6], [200, 4, 6]];
var n_ColoursHard = 6;
var n_ColoursNormal = 6;
var n_ColoursEasy = 6;
var n_Level = 1;
var n_CubesNeeded = 0;
var n_Score;
var n_ScoreCube = 50;
var n_ScoreMultiplier = 0.5;
var n_ScorePass = -100;
var n_BestScoreNormal;
var n_BestScoreEasy;
var o_Settings = SharedObject.getLocal("GameSettings");
var d_Timer;
var n_TimerInterval;
var n_TimerIntervalTop = 12000;
var n_TimerIntervalTopLower = 8000;
var n_TimerIntervalBottom = 12000;
var n_TimerIntervalBottomLower = 8000;
var n_TimerIntervalMenu = 5000;
var n_IntervalCount = 0;
var n_IntervalReduction = 100;
var n_IntervalReductionTime = 250;
var n_CubeUpperAlpha = 100;
var n_CubeLowerAlpha = 75;
var n_FrontAlphaLower = 20;
var n_FrontAlphaUpper = 100;
var n_FrontAlphaChange = 10;
var n_BackAlphaLower = 80;
var n_BackAlphaUpper = 100;
var n_BackAlphaChange = 10;
var n_TutStage = 0;
var b_Setup;
var b_RunOnce = false;
var s_GameMode = "menu";
var s_PlayMode = "normal";
var n_GameWidth = 550;
var n_GameHeight = 550;
var o_KeyList;
var d_LastMove;
var n_MoveIntervalTop = 100;
var n_MoveIntervalBottom = 200;
var n_MenuRotateChance = 0.2;
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
function postMindJoltAPIConnect(success) {
trace("[MindJoltAPI] service successfully loaded");
}
var MindJoltAPI;
this.KIBA_Logo._visible = false;
_lockroot = true;
__com_mochibot__("3c796e41", this, 10301, true);
mochi.as2.MochiServices.connect("66b44489a4b26627");
this.KIBA_Logo._visible = false;
if (MindJoltAPI == undefined) {
System.security.allowDomain("static.mindjolt.com");
MindJoltAPI = createEmptyMovieClip("MindJoltAPI", getNextHighestDepth());
var apiPath = ((_level0.mjPath != undefined) ? (_level0.mjPath) : "http://static.mindjolt.com/api/as2/api_as2_local.swf");
var apiLoader = new MovieClipLoader();
var apiLoadListener = new Object();
apiLoader.addListener(apiLoadListener);
apiLoadListener.onLoadInit = function () {
MindJoltAPI.service.connect(postMindJoltAPIConnect);
};
apiLoadListener.onLoadError = function () {
trace("[MindJoltAPI] failed to load.");
};
apiLoader.loadClip(apiPath, MindJoltAPI);
}
if ((((((_root._url.toLowerCase().indexOf(_root.s_TestSiteString, 0) > 0) || (_root._url.toLowerCase().indexOf("smileygamer", 0) > 0)) || (_root._url.toLowerCase().indexOf("static.kaisergames.de", 0) > 0)) || (_root._url.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root._url.toLowerCase().indexOf("vo.llnwd.net", 0) > 0)) || (_root._url.toLowerCase().indexOf("kongregate", 0) > 0)) {
if (((_root._url.toLowerCase().indexOf("static.kaisergames.de", 0) > 0) || (_root._url.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root._url.toLowerCase().indexOf("vo.llnwd.net", 0) > 0)) {
this.KIBA_Logo._x = 215;
this.KIBA_Logo._visible = true;
} else {
this.KIBA_Logo._visible = false;
}
} else {
this.KIBA_Logo._visible = false;
this.adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + _root.CPMStarContentSpotID);
o_Loader.gotoAndPlay(2);
}
stop();
Frame 2
stop();
stop();
Frame 3
this.onEnterFrame = function () {
var _local6;
var _local5;
var _local3 = 30;
var _local4;
if (!_root.b_RunOnce) {
_root.b_SoundsOn = true;
_root.f_PlaySound("o_Sounds", "GameMusic");
_root.b_RunOnce = true;
}
if (!_root.b_Setup) {
_root.n_Level = 0;
_root.n_Drops = 0;
_root.n_Score = 0;
_root.n_LastPos = 9;
if (_root.o_KeyList != undefined) {
Key.removeListener(_root.o_KeyList);
_root.o_KeyList = undefined;
}
if (((_root._url.toLowerCase().indexOf("static.kaisergames.de", 0) > 0) || (_root._url.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root._url.toLowerCase().indexOf("vo.llnwd.net", 0) > 0)) {
_root.o_Menu.o_KIBA._visible = true;
_root.o_MoreGames._visible = false;
} else {
_root.o_Menu.o_KIBA._visible = false;
_root.o_MoreGames._visible = true;
}
if (_root.s_GameMode == "menu") {
_root.f_GetBestScores();
_root.o_KeyList = new Object();
_root.o_KeyList.onKeyUp = function () {
if ((Key.getCode() == 77) || (Key.getCode() == 109)) {
_root.f_ToggleSounds();
}
};
Key.addListener(_root.o_KeyList);
_root.f_BuildField(8, 3, n_Level);
} else {
_root.o_KeyList = new Object();
_root.o_KeyList.onKeyDown = function () {
if ((!_root.b_GameOver) && (!_root.b_Paused)) {
if (((Key.getCode() == 37) || (Key.getCode() == 65)) || (Key.getCode() == 97)) {
_root.f_Rotate(false);
}
if (((Key.getCode() == 39) || (Key.getCode() == 68)) || (Key.getCode() == 100)) {
_root.f_Rotate(true);
}
}
};
_root.o_KeyList.onKeyUp = function () {
if ((!_root.b_GameOver) && (!_root.b_Paused)) {
if (((Key.getCode() == 37) || (Key.getCode() == 65)) || (Key.getCode() == 97)) {
_root.d_LastMove.setTime(new Date().getTime() - 100000);
}
if (((Key.getCode() == 39) || (Key.getCode() == 68)) || (Key.getCode() == 100)) {
_root.d_LastMove.setTime(new Date().getTime() - 100000);
}
if ((Key.getCode() == 32) || (Key.getCode() == 40)) {
_root.f_StartDrop();
_root.f_ChooseNextDrop();
_root.d_Timer = new Date();
}
if ((Key.getCode() == 77) || (Key.getCode() == 109)) {
_root.f_ToggleSounds();
}
}
if (Key.getCode() == 27) {
this.onEnterFrame = undefined;
Key.removeListener(_root.o_KeyList);
_root.o_KeyList = undefined;
_root.b_Setup = false;
_root.s_GameMode = "menu";
_root.gotoAndPlay("Game");
}
if ((Key.getCode() == 80) || (Key.getCode() == 112)) {
_root.f_TogglePause();
}
};
Key.addListener(_root.o_KeyList);
if (_root.s_PlayMode == "tutorial") {
_root.f_BuildField(8, 0, 0);
} else {
_root.f_BuildField(8, 3, 1);
}
}
} else {
if (!_root.b_Paused) {
_root.f_DoGraphics();
if (_root.b_GameOver) {
if (_root.f_TimeDiff(_root.d_GameOverTimer, new Date()) >= _root.n_GameOverPause) {
if (_root.s_GameMode == "menu") {
_root.b_Setup = false;
} else {
this.onEnterFrame = undefined;
_root.gotoAndPlay("EndAd");
}
}
} else if ((_root.n_CubesNeeded == 0) && (!_root.b_Animating)) {
_root.n_Level++;
_root.f_BuildField(8, 3, n_Level);
} else {
_root.f_CheckGameOver();
}
}
if (_root.s_GameMode != "menu") {
_root.f_DoMessages();
}
if ((((_root.s_GameMode != "menu") && (!_root.b_InstructionsOn)) && (!_root.b_Paused)) && (_root.d_KeyLast.getTime() <= (new Date().getTime() - _root.n_KeyInterval))) {
} else if (_root.s_GameMode == "menu") {
if (!_root.b_GameOver) {
if (Math.random() <= _root.n_MenuRotateChance) {
_root.f_Rotate(Math.random() > 0.5);
}
}
}
if (((((!_root.b_InstructionsOn) || (_root.s_GameMode == "menu")) && (!_root.b_GameOver)) && (!_root.b_Paused)) && (!_root.b_Animating)) {
_root.f_Shake();
_root.o_Progress.n_CurrentValue = _root.f_TimeDiff(_root.d_Timer, new Date());
if (_root.d_Timer.getTime() <= (new Date().getTime() - ((_root.s_GameMode == "menu") ? (_root.n_TimerIntervalMenu) : (_root.n_TimerInterval)))) {
_root.f_StartDrop();
_root.f_ChooseNextDrop();
}
}
}
};
Frame 4
this.gotoAndPlay("Game");
Frame 5
this.stop();
Frame 6
var o = {n:[15, 4, 11, 7, 12, 0, 2, 8, 8, 5, 6, 4, 6, 14, 9, 5], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
if (_root.o_Settings.data.n_BestScore == undefined) {
_root.o_Settings.data.n_BestScore = _root.n_Score;
} else if (_root.o_Settings.data.n_BestScore < _root.n_Score) {
_root.o_Settings.data.n_BestScore = _root.n_Score;
}
if (_root.o_Settings.data.n_BestLevel == undefined) {
_root.o_Settings.data.n_BestLevel = _root.n_Level;
} else if (_root.o_Settings.data.n_BestLevel < _root.n_Level) {
_root.o_Settings.data.n_BestLevel = _root.n_Level;
}
MindJoltAPI.service.submitScore(_root.n_Score);
_root.HPScoreService.postScore(_root.n_Score, "");
_root.kongregateServices.connect();
_root.kongregateScores.submit(_root.n_Score);
var boardID = o.f(0, "");
if (_root.n_Score == 0) {
mochi.as2.MochiScores.showLeaderboard({boardID:boardID});
} else {
mochi.as2.MochiScores.showLeaderboard({boardID:boardID, score:_root.n_Score});
}
Frame 7
_root.s_GameMode = "menu";
_root.b_Setup = false;
_root.gotoAndPlay("Game");
Symbol 7 MovieClip [Messages] Frame 34
this.removeMovieClip();
Symbol 31 MovieClip [Cube_Graphics] Frame 10
this.stop();
Symbol 31 MovieClip [Cube_Graphics] Frame 20
_root.f_EndPopping(this, _parent.n_Col, _parent.n_Y);
Symbol 31 MovieClip [Cube_Graphics] Frame 30
_root.f_EndPopping(this, _parent.n_Col, _parent.n_Y);
Symbol 31 MovieClip [Cube_Graphics] Frame 40
_root.f_EndPopping(this, _parent.n_Col, _parent.n_Y);
Symbol 31 MovieClip [Cube_Graphics] Frame 50
_root.f_EndPopping(this, _parent.n_Col, _parent.n_Y);
Symbol 31 MovieClip [Cube_Graphics] Frame 60
_root.f_EndPopping(this, _parent.n_Col, _parent.n_Y);
Symbol 31 MovieClip [Cube_Graphics] Frame 70
_root.f_EndPopping(this, _parent.n_Col, _parent.n_Y);
Symbol 31 MovieClip [Cube_Graphics] Frame 80
_root.f_EndPopping(this, _parent.n_Col, _parent.n_Y);
Symbol 31 MovieClip [Cube_Graphics] Frame 98
this.stop();
Symbol 39 MovieClip [Cube] Frame 1
var n_Col;
var n_Y;
Symbol 43 MovieClip [GameOver] Frame 41
this.removeMovieClip();
Symbol 51 MovieClip [Finished_Animation] Frame 68
this.removeMovieClip();
Symbol 58 MovieClip [LevelUp_Animation] Frame 53
this.removeMovieClip();
Symbol 62 MovieClip [SwapEffect] Frame 16
this.removeMovieClip();
Symbol 64 MovieClip [Needed] Frame 1
var s_ScoreString = ("000" + _root.n_CubesNeeded.toString()).toString();
var s_Color;
if (_root.s_PlayMode == "tutorial") {
this.ScoreText.text = "000";
} else if (_root.n_Level != undefined) {
this.ScoreText.text = s_ScoreString.substring(s_ScoreString.length - 3, s_ScoreString.length);
} else {
this.ScoreText.text = "000";
}
Symbol 64 MovieClip [Needed] Frame 2
gotoAndPlay (1);
Symbol 66 MovieClip [Level] Frame 1
var s_ScoreString = ("00" + _root.n_Level.toString()).toString();
var s_Color;
if (_root.s_PlayMode == "tutorial") {
this.ScoreText.text = "00";
} else if (_root.n_Level != undefined) {
my_fmt.color = s_Color;
this.ScoreText.text = s_ScoreString.substring(s_ScoreString.length - 2, s_ScoreString.length);
} else {
this.ScoreText.text = "00";
}
Symbol 66 MovieClip [Level] Frame 2
gotoAndPlay (1);
Symbol 68 MovieClip [Score] Frame 1
var s_ScoreString = ("0000000000" + _root.n_Score.toString()).toString();
var s_Color;
var my_fmt = new TextFormat();
if (_root.n_Score < 0) {
s_Color = 16711680 /* 0xFF0000 */;
} else {
s_Color = 16777215 /* 0xFFFFFF */;
}
if (_root.s_PlayMode == "tutorial") {
this.ScoreText.text = "Tutorial Mode";
} else if (_root.n_Score != undefined) {
my_fmt.color = s_Color;
this.ScoreText.text = s_ScoreString.substring(s_ScoreString.length - 10, s_ScoreString.length);
this.ScoreText.setTextFormat(my_fmt);
} else {
this.ScoreText.text = "0000000000";
}
Symbol 68 MovieClip [Score] Frame 2
gotoAndPlay (1);
Symbol 76 MovieClip [Progress] Frame 1
function f_showProgress() {
if (n_CurrentValue != undefined) {
if (this.n_CurrentValue >= this.n_MaxValue) {
this.gotoAndPlay("Unfinished");
} else {
this.gotoAndPlay("Finished");
}
} else {
this.gotoAndPlay("Unfinished");
}
}
var n_MaxValue;
var n_CurrentValue;
this.onEnterFrame = function () {
if ((n_MaxValue != undefined) and (n_CurrentValue != undefined)) {
if (n_CurrentValue > n_MaxValue) {
o_ProgressBar._width = o_ProgressBorder._width;
} else {
o_ProgressBar._width = (o_ProgressBorder._width / n_MaxValue) * n_CurrentValue;
}
}
};
Symbol 76 MovieClip [Progress] Frame 2
this.f_showProgress();
Symbol 76 MovieClip [Progress] Frame 4
this.f_showProgress();
Symbol 91 Button [ClickToPlayGame]
on (release) {
_root.gotoAndPlay("Splash");
}
Symbol 92 MovieClip [Loader] Frame 2
var siteLoaded = _root.getBytesLoaded();
var siteTotal = _root.getBytesTotal();
var percentage = Math.round((siteLoaded / siteTotal) * 100);
loadingBar._xscale = percentage;
percentClip.percentDisplay.text = percentage + "%";
percentClip._x = loadingBar._x + loadingBar._width;
bytesDisplay.text = ((("loaded " + siteLoaded) + " of ") + siteTotal) + " bytes";
if (siteLoaded >= siteTotal) {
_root.d_AdvertStartTime = new Date();
gotoAndPlay ("End");
}
Symbol 92 MovieClip [Loader] Frame 3
gotoAndPlay ("Looper");
Symbol 92 MovieClip [Loader] Frame 4
if (((((((_root._url.toLowerCase().indexOf(_root.s_TestSiteString, 0) > 0) || (_root._url.toLowerCase().indexOf("addictinggames.com", 0) > 0)) || (_root._url.toLowerCase().indexOf("smileygamer.com", 0) > 0)) || (_root._url.toLowerCase().indexOf("static.kaisergames.de", 0) > 0)) || (_root._url.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root._url.toLowerCase().indexOf("vo.llnwd.net", 0) > 0)) || (_root._url.toLowerCase().indexOf("kongregate.com", 0) > 0)) {
_root.gotoAndPlay("Splash");
} else if (_root.f_TimeDiff(_root.d_AdvertStartTime, new Date()) >= _root.n_CPMWaitTime) {
this.gotoAndPlay("PlayGame");
}
Symbol 92 MovieClip [Loader] Frame 5
this.gotoAndPlay("End");
Symbol 92 MovieClip [Loader] Frame 6
this.stop();
Symbol 287 MovieClip [__Packages.mochi.as2.MochiSync] Frame 0
class mochi.as2.MochiSync
{
var _syncContainer;
function MochiSync () {
_syncContainer = {};
}
function getProp(name) {
return(_syncContainer[name]);
}
function setProp(name, value) {
if (_syncContainer[name] == value) {
return(undefined);
}
_syncContainer[name] = value;
mochi.as2.MochiServices.send("sync_propUpdate", {name:name, value:value});
}
function triggerEvent(eventType, args) {
switch (eventType) {
case SYNC_REQUEST :
mochi.as2.MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY :
_syncContainer[args.name] = args.value;
}
}
static var SYNC_REQUEST = "SyncRequest";
static var SYNC_PROPERTY = "UpdateProperty";
}
Symbol 288 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.2 as2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case "sync" :
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
if (_root.mochiad_options) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var servicesSync = new mochi.as2.MochiSync();
}
Symbol 289 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 290 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
static var gameStart, levelStart;
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function trigger(kind, obj) {
if (obj == undefined) {
obj = {};
} else if (obj.kind != undefined) {
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
obj.kind = kind;
}
mochi.as2.MochiServices.send("events_triggerEvent", {eventObject:obj}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startGame() {
gameStart = new Date().getTime();
trigger("start_game");
}
static function endGame() {
var _local1 = new Date().getTime() - gameStart;
trigger("end_game", {time:_local1});
}
static function startLevel() {
levelStart = new Date().getTime();
trigger("start_level");
}
static function endLevel() {
var _local1 = new Date().getTime() - levelStart;
trigger("end_level", {time:_local1});
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 291 MovieClip [__Packages.mochi.as2.MochiCoins] Frame 0
class mochi.as2.MochiCoins
{
function MochiCoins () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showStore(options) {
mochi.as2.MochiServices.send("coins_showStore", {options:options}, null, null);
}
static function showItem(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showItem call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showItem", {options:options}, null, null);
}
static function showVideo(options) {
if ((options == undefined) || (typeof(options.item) != "string")) {
trace("ERROR: showVideo call must pass an Object with an item key");
return(undefined);
}
mochi.as2.MochiServices.send("coins_showVideo", {options:options}, null, null);
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("coins_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("coins_hideLoginWidget");
}
static function getStoreItems() {
mochi.as2.MochiServices.send("coins_getStoreItems");
}
static function getUserInfo() {
mochi.as2.MochiServices.send("coins_getUserInfo");
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("coins_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var STORE_SHOW = "StoreShow";
static var STORE_HIDE = "StoreHide";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var ITEM_OWNED = "ItemOwned";
static var ITEM_NEW = "ItemNew";
static var STORE_ITEMS = "StoreItems";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 292 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiServices.warnID(boardID, true);
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
options.clip = mochi.as2.MochiServices.clip;
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
trace("WARNING! This application is attempting to connect to MochiServices inside a showLeaderboard call!");
trace("make sure MochiServices.connect is called as early in the application runtime as possible.");
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.as2.MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 293 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 114 Button [SplashButton]
on (release) {
getURL ("http://www.smileygamer.com/?gameref=3486", "_blank");
}
Symbol 115 MovieClip [SplashGraphics] Frame 121
_root.play();
Symbol 130 Button [SponsorMoreGames]
on (release) {
getURL ("http://www.smileygamer.com/?gameref=3486", "_blank");
}
Symbol 132 MovieClip [Timer] Frame 1
var n_Seconds;
var d_LastTick;
this.onEnterFrame = function () {
var _local4 = "00";
var _local3 = "00";
var _local6 = this.o_TimerText.getTextFormat();
var _local5;
if (!_root.b_Paused) {
if ((this.n_Seconds != undefined) && (this.d_LastTick != undefined)) {
if (this.n_Seconds > 0) {
if (_root.f_OverTimeDiff(this.d_LastTick, new Date(), 1000)) {
this.n_Seconds--;
this.d_LastTick = new Date();
}
}
if (this.n_Seconds <= 30) {
_local5 = 16711680 /* 0xFF0000 */;
} else if ((this.n_Seconds > 30) && (this.n_Seconds <= 60)) {
_local5 = 16776960 /* 0xFFFF00 */;
} else {
_local5 = 16777215 /* 0xFFFFFF */;
}
_local6.color = _local5;
_local4 = "00" + Math.floor(this.n_Seconds / 60);
_local4 = _local4.substr(_local4.length - 2, 2);
_local3 = "00" + (this.n_Seconds % 60);
_local3 = _local3.substr(_local3.length - 2, 2);
this.o_TimerText.text = (_local4 + ":") + _local3;
this.o_TimerText.setTextFormat(_local6);
}
}
};
Symbol 168 Button
on (release) {
this.gotoAndStop("Tutorial_2");
}
Symbol 172 Button
on (release) {
this.gotoAndStop("Tutorial_3");
}
Symbol 177 Button
on (release) {
this.gotoAndStop("Tutorial_4");
}
Symbol 188 Button
on (release) {
this.gotoAndStop("Tutorial_5");
}
Symbol 203 Button
on (release) {
this.gotoAndStop("Tutorial_6");
}
Symbol 206 Button
on (release) {
this.gotoAndStop("Tutorial_7");
}
Symbol 215 Button [PlayButton]
on (release) {
_root.b_Setup = false;
_root.s_PlayMode = "normal";
_root.s_GameMode = "game";
}
Symbol 216 MovieClip [TutorialOverlay] Frame 1
this.stop();
Symbol 223 Button [AddGame]
on (release) {
getURL ("http://www.smileygamer.com/freecontent.html?gameref=3486", "_blank");
}
Symbol 230 Button [Highscores]
on (release) {
_root.n_Score = 0;
_root.s_PlayMode = "normal";
_root.gotoAndStop("HiScores");
}
Symbol 235 Button [StartGame_OpenPlay]
on (release) {
_root.b_Setup = false;
_root.s_PlayMode = "tutorial";
_root.s_GameMode = "game";
}
Symbol 239 Button [StartGame_Timed]
on (release) {
_root.b_Setup = false;
_root.s_PlayMode = "normal";
_root.s_GameMode = "game";
}
Symbol 249 Button [Credits_Click]
on (release) {
getURL ("http://www.smileygamer.com/?gameref=3486", "_blank");
}
Symbol 259 Button [KIBA_MenuLink]
on (release) {
getURL ("http://www.kibagames.com", "_blank");
}
Symbol 266 MovieClip [Sounds] Frame 2
gotoAndStop (1);
Symbol 266 MovieClip [Sounds] Frame 4
gotoAndStop (1);
Symbol 266 MovieClip [Sounds] Frame 6
gotoAndStop (1);
Symbol 266 MovieClip [Sounds] Frame 8
gotoAndStop (1);
Symbol 266 MovieClip [Sounds] Frame 10
gotoAndStop (1);
Symbol 274 Button [PreHiScoreGoNext]
on (release) {
this.play();
}
Symbol 275 MovieClip [PreHiScoreAds] Frame 1
if (((((((_root._url.toLowerCase().indexOf(_root.s_TestSiteString, 0) > 0) || (_root._url.toLowerCase().indexOf("smileygamer", 0) > 0)) || (_root._url.toLowerCase().indexOf("static.kaisergames.de", 0) > 0)) || (_root._url.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root._url.toLowerCase().indexOf("vo.llnwd.net", 0) > 0)) || (_root._url.toLowerCase().indexOf("kongregate", 0) > 0)) || (_root._url.toLowerCase().indexOf("mindjolt", 0) > 0)) {
_root.gotoAndPlay("HiScores");
}
Symbol 275 MovieClip [PreHiScoreAds] Frame 7
this.adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + _root.CPMStarInverlevelID);
this.o_Text.text = "You Scored " + _root.n_Score.toString();
this.stop();
Symbol 275 MovieClip [PreHiScoreAds] Frame 14
_root.gotoAndPlay("HiScores");
Symbol 281 Button
on (release) {
_root.b_Setup = false;
_root.s_GameMode = "menu";
_root.gotoAndPlay("Game");
}