Frame 1
var debug = true;
var gameID = 130;
var gameName = "house_of_chocolates";
_global.tryagainflag = 0;
stop();
fscommand ("showmenu", "false");
prel.onEnterFrame = function () {
prel.procent.text = Math.ceil((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
prel.gotoAndStop(prel.procent.text);
if (Number(prel.procent.text) >= 100) {
play();
delete this.onEnterFrame;
}
};
Frame 2
stop();
Frame 3
if (!okToPlay) {
gotoAndStop (3);
}
Frame 4
function startSound() {
my_sound = new Sound(this);
my_sound.attachSound("theme");
my_sound.start(0, 999999);
}
function stopSound() {
my_sound.stop();
}
Stage.showMenu = false;
this._lockroot = true;
var soundin;
var my_sound;
var ctr;
var ctr2;
_global.soundflag = 0;
function fadeIn(pageName) {
fade_mc._alpha = 0;
fade_mc._visible = true;
my_tween = new mx.transitions.Tween(fade_mc, "_alpha", mx.transitions.easing.Strong.easeIn, 0, 100, 0.3, true);
my_tween.onMotionFinished = function () {
fadeOut(pageName);
};
}
function fadeOut(pageName) {
fade_mc._x = (MAP_WIDTH - fade_mc._width) / 2;
fade_mc._y = (MAP_HEIGHT - fade_mc._height) / 2;
fade_mc._alpha = 100;
fade_mc._visible = true;
my_tween = new mx.transitions.Tween(fade_mc, "_alpha", mx.transitions.easing.Strong.easeIn, 100, 0, 0.5, true);
if (pageName != undefined) {
removeMovieClip(currentContent);
delete currentContent;
gotoAndStop(pageName +3);
stopSound();
}
my_tween.onMotionFinished = function () {
fade_mc._visible = false;
removeMovieClip(fade_mc);
};
}
function toggleButton(bool) {
howTo_btn._visible = bool;
highScore_btn._visible = bool;
start_btn._visible = bool;
if (bool) {
openItem("mcLogo");
}
}
function openItem(libItem) {
removeMovieClip(currentContent);
attachMovie(libItem, libItem + "_mc", fade_mc.getDepth() - 1);
currentContent = ref[libItem + "_mc"];
ref[libItem + "_mc"]._x = (MAP_WIDTH - ref[libItem + "_mc"]._width) / 2;
ref[libItem + "_mc"]._y = (MAP_HEIGHT - ref[libItem + "_mc"]._height) / 2;
return(libItem + "_mc");
}
stop();
if (_global.tryagainflag == 1) {
fadeOut();
toggleButton(false);
ref[openItem("mcHowto")].okay_btn.onRelease = function () {
ref.toggleButton(true);
removeMovieClip(currentContent);
gotoAndPlay ("gamePage");
};
}
var MAP_WIDTH = 550;
var MAP_HEIGHT = 400;
var my_tween;
var ref = this;
var currentContent;
fade_mc._visible = false;
stop();
startSound();
start_btn.onRelease = function () {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=211&area=play2", "_blank");
fadeOut();
toggleButton(false);
ref[openItem("mcHowto")].okay_btn.onRelease = function () {
ref.toggleButton(true);
removeMovieClip(currentContent);
gotoAndPlay ("gamePage");
};
};
playmore_btn.onRelease = function () {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=211&area=menu2", "_blank");
};
freegames_btn.onRelease = function () {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=211&area=fgfywmenu2&url=http://www.FreeGamesForYourWebsite.com", "_blank");
};
highScore_btn.onRelease = function () {
fadeOut();
toggleButton(false);
ref[openItem("mcHighscore")].okay_btn.onRelease = function () {
ref.toggleButton(true);
};
};
howTo_btn.onRelease = function () {
fadeOut();
toggleButton(false);
ref[openItem("mcHowto")].okay_btn.onRelease = function () {
ref.toggleButton(true);
};
};
Instance of Symbol 619 MovieClip in Frame 4
on (release) {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=211&area=minilogo2", "_blank");
}
Frame 9
function displayMsg(str) {
status_txt.text = str;
}
function buildMap() {
comp = 0;
this.createEmptyMovieClip("clip_mc", fade_mc.getDepth() - 1);
this.createEmptyMovieClip("clone_mc", getNextHighestDepth());
grid.gameSprite = clip_mc;
grid.gameClone = clone_mc;
var _local2 = 0;
while (_local2 < initialMap.length) {
grid.gameClone.createEmptyMovieClip("row_" + _local2, ((_local2 * 100) + (j * 2)) + 1600);
grid.gameClone.createEmptyMovieClip("mask_" + _local2, ((_local2 * 100) + (j * 2)) + 2400);
grid.gameClone["row_" + _local2].row = _local2;
grid.gameClone["row_" + _local2].isFlying = false;
var j = 0;
while (j < initialMap[0].length) {
var _local5 = (_local2 * 100) + (j * 2);
var _local3 = (("t_" + j) + "_") + _local2;
var _local7 = (("a_" + j) + "_") + _local2;
var _local6 = (("b_" + j) + "_") + _local2;
if (initialMap[_local2][j] > 0) {
grid[_local3] = new Object();
grid[_local3].name = _local3;
grid[_local3].isPlayable = false;
grid.gameSprite.attachMovie("unplayableTile", _local3, _local5, {_x:j * TILE_WIDTH, _y:_local2 * TILE_HEIGHT});
grid.gameClone["row_" + _local2].attachMovie("clone", _local3 + "_clone", (getNextHighestDepth() + (_local2 * j)) + 2000, {_x:j * TILE_WIDTH, _y:_local2 * TILE_HEIGHT, isTemp:true, place:j, row:_local2, isFar:false});
if (j <= 0) {
grid.gameClone["row_" + _local2][_local3 + "_clone"].isTemp = false;
grid.gameClone["row_" + _local2][_local3 + "_clone"].isFar = true;
}
changeTile(grid.gameSprite[_local3], initialMap[_local2][j]);
} else {
grid[_local3] = new Object();
grid[_local3].name = _local3;
grid[_local3].isPlayable = true;
grid[_local3].isActive = false;
grid[_local3].isSelected = false;
grid[_local3].row = _local2;
grid[_local3].col = j;
if (true) {
rand = Math.ceil(Math.random() * maxRange);
grid[_local3].type = rand;
var _local4 = grid[_local3].type;
if (((_local2 > 2) && (_local4 == grid[(("t_" + j) + "_") + (_local2 - 1)].type)) && (_local4 == grid[(("t_" + j) + "_") + (_local2 - 2)].type)) {
// unexpected jump
}
if (((j > 2) && (_local4 == grid[(("t_" + (j - 1)) + "_") + _local2].type)) && (_local4 == grid[(("t_" + (j - 2)) + "_") + _local2].type)) {
// unexpected jump
}
}
grid.gameSprite.attachMovie("sprite", _local3, _local5, {_x:j * TILE_WIDTH, _y:_local2 * TILE_HEIGHT, type:rand, _name:_local3, isSelected:isSelected, superOrig:_local2 * TILE_HEIGHT});
grid.gameSprite.attachMovie("activate", _local7, _local5 - 800);
grid.gameSprite.attachMovie("burst", _local6, _local5 + 800);
grid.gameClone["row_" + _local2].attachMovie("clone", _local3 + "_clone", (getNextHighestDepth() + (_local2 * j)) + 2000, {_x:j * TILE_WIDTH, _y:_local2 * TILE_HEIGHT, isTemp:false, place:j, row:_local2});
grid.gameClone["mask_" + _local2].attachMovie("mask", _local3 + "_mask", (getNextHighestDepth() + (_local2 * j)) + 4000, {_x:j * TILE_WIDTH, _y:_local2 * TILE_HEIGHT});
changeGameTile(grid.gameSprite[_local3], rand);
grid.gameSprite[_local6].cacheAsBitmap = true;
grid.gameSprite[_local3].cacheAsBitmap = true;
comp++;
grid.gameSprite[_local3].onPress = function () {
clickHandler(this);
};
}
grid.gameSprite[_local7]._x = j * TILE_WIDTH;
grid.gameSprite[_local7]._y = _local2 * TILE_HEIGHT;
grid.gameSprite[_local6]._x = j * TILE_WIDTH;
grid.gameSprite[_local6]._y = _local2 * TILE_HEIGHT;
j++;
}
grid.gameClone["row_" + _local2].setMask(grid.gameClone["mask_" + _local2]);
grid.gameClone["row_" + _local2]._visible = false;
_local2++;
}
grid.gameSprite._x = (MAP_WIDTH - (TILE_WIDTH * initialMap[0].length)) / 2;
grid.gameSprite._y = (MAP_HEIGHT - (TILE_HEIGHT * initialMap.length)) / 2;
grid.gameClone._x = (MAP_WIDTH - (TILE_WIDTH * initialMap[0].length)) / 2;
grid.gameClone._y = (MAP_HEIGHT - (TILE_HEIGHT * initialMap.length)) / 2;
if (currentLevel < FINAL_LEVEL) {
level_txt.text = "LEVEL " + currentLevel;
} else {
level_txt.text = "FINAL LEVEL";
}
comp_txt.text = comp;
trickleFluid(trickleRate);
}
function nextLevel() {
toggleHUD(false);
clearInterval(intID);
clearInterval(timerID);
removeMovieClip(clip_mc);
removeMovieClip(clone_mc);
bottle_mc.useHandCursor = false;
delete grid;
grid = new Object();
var _local1 = Math.round((totalSec * 15) * Math.ceil(currentLevel / 2));
fluidPercent = tempPercent;
var _local2 = ref[openDialogue("mcLevelComplete")];
_local2.bonus_txt.text = "+" + _local1;
if (isAdded == false) {
addBonus(_local1);
isAdded = true;
}
_local2.onRelease = function () {
isAdded = false;
currentLevel++;
bg_mc.gotoAndStop(ref["lvl" + currentLevel].world);
initialMap = ref["lvl" + currentLevel].lvlMap;
totalSec = ref["lvl" + currentLevel].timeLimit;
offset = ref["lvl" + currentLevel].tileOffset;
maxRange = ref["lvl" + currentLevel].range;
buildMap();
if (true) {
if (checkBoard() == false) {
buildMap();
// unexpected jump
}
}
countdown();
fluidPercent = tempPercent;
intID = setInterval(trickleFluid, trickleRate * 1000, trickleRate);
timerID = setInterval(countdown, 1000);
isMovePossible = true;
trickleFluid(trickleRate);
toggleHUD(true);
};
}
function toggleHUD(bool) {
score_txt._visible = bool;
status_txt._visible = bool;
bottle_mc._visible = bool;
timer_txt._visible = bool;
pause_btn._visible = bool;
}
function gameStart() {
bottle_mc.useHandCursor = false;
initialMap = ref["lvl" + currentLevel].lvlMap;
totalSec = ref["lvl" + currentLevel].timeLimit;
offset = ref["lvl" + currentLevel].tileOffset;
maxRange = ref["lvl" + currentLevel].range;
bg_mc.gotoAndStop(ref["lvl" + currentLevel].world);
buildMap();
if (true) {
if (checkBoard() == false) {
buildMap();
// unexpected jump
}
}
countdown();
fluidPercent = 0;
intID = setInterval(trickleFluid, trickleRate * 1000, trickleRate);
timerID = setInterval(countdown, 1000);
}
function endGame() {
_root.my_sound.stop();
removeMovieClip(clip_mc);
removeMovieClip(clone_mc);
delete grid;
clearInterval(intID);
clearInterval(timerID);
}
function clickHandler(dispatcher) {
var _local1 = dispatcher._name;
if (firstTile == undefined) {
firstTile = new Object();
firstTile = grid[_local1];
firstMc = dispatcher;
dispatcher.tileSelector_mc._visible = true;
} else if (firstTile == grid[_local1]) {
firstTile = undefined;
firstMc = undefined;
dispatcher.tileSelector_mc._visible = false;
} else {
firstMc.tileSelector_mc._visible = false;
if ((firstTile.row == grid[_local1].row) && (Math.abs(firstTile.col - grid[_local1].col) == 1)) {
animateSwap(firstTile, grid[_local1], "horizontal");
firstMc = undefined;
firstTile = undefined;
} else if ((firstTile.col == grid[_local1].col) && (Math.abs(firstTile.row - grid[_local1].row) == 1)) {
animateSwap(firstTile, grid[_local1], "vertical");
firstMc = undefined;
firstTile = undefined;
} else {
firstMc = dispatcher;
firstTile = grid[_local1];
dispatcher.tileSelector_mc._visible = true;
}
}
}
function animateSwap(tile1, tile2, direction) {
function swap() {
if ((isFirstFinished == true) && (isSecondFinished == true)) {
swapTiles(tile1, tile2);
}
}
var orig1;
var orig2;
var _local1;
var _local2;
var processString = "_x";
var isFirstFinished = false;
var isSecondFinished = false;
if (direction == "vertical") {
orig1 = grid.gameSprite[tile1.name]._y;
orig2 = grid.gameSprite[tile2.name]._y;
_local1 = grid.gameSprite[tile1.name]._y;
_local2 = grid.gameSprite[tile2.name]._y;
processString = "_y";
} else {
orig1 = grid.gameSprite[tile1.name]._x;
orig2 = grid.gameSprite[tile2.name]._x;
_local1 = grid.gameSprite[tile1.name]._x;
_local2 = grid.gameSprite[tile2.name]._x;
processString = "_x";
}
if (grid.gameSprite[tile1.name].getDepth() < grid.gameSprite[tile2.name].getDepth()) {
grid.gameSprite[tile1.name].swapDepths(grid.gameSprite[tile2.name]);
}
var _local4 = new mx.transitions.Tween(grid.gameSprite[tile1.name], processString, mx.transitions.easing.Strong.easeOut, _local1, _local2, 0.3, true);
var _local3 = new mx.transitions.Tween(grid.gameSprite[tile2.name], processString, mx.transitions.easing.Strong.easeOut, _local2, _local1, 0.3, true);
_local4.onMotionFinished = function () {
grid.gameSprite[tile1.name][processString] = orig1;
isFirstFinished = true;
swap();
};
_local3.onMotionFinished = function () {
grid.gameSprite[tile2.name][processString] = orig2;
isSecondFinished = true;
swap();
};
}
function swapTiles(tile1, tile2) {
if ((tile1.type != undefined) && (tile2.type != undefined)) {
var _local3 = new Object();
_local3.type = tile1.type;
tile1.type = tile2.type;
tile2.type = _local3.type;
changeGameTile(grid.gameSprite[tile1.name], tile1.type);
changeGameTile(grid.gameSprite[tile2.name], tile2.type);
clearInterval(delayId);
delayId = setInterval(countDown, 500);
if (searchAndDestroy() && (isDropping == false)) {
} else {
_local3.type = tile1.type;
tile1.type = tile2.type;
tile2.type = _local3.type;
changeGameTile(grid.gameSprite[tile1.name], tile1.type);
changeGameTile(grid.gameSprite[tile2.name], tile2.type);
}
}
}
function searchAndDestroy() {
var _local1 = new Array();
var _local2 = new Array();
_local1 = _local1.concat(getMatchHoriz(), getMatchVert());
if (_local1.length > 0) {
delay(_local1);
return(true);
}
return(false);
}
function delay(arr) {
function countMe() {
eks--;
if (eks <= 0) {
clearInterval(delID);
kill(arr);
redrawSprite();
bottle_mc.useHandCursor = true;
}
}
function kill(uMatch) {
var _local3 = 0;
while (_local3 < uMatch.length) {
var _local4 = 0;
while (_local4 < uMatch[_local3].length) {
grid.gameSprite[(("b_" + grid[uMatch[_local3][_local4]].col) + "_") + grid[uMatch[_local3][_local4]].row].burst(addPoints(uMatch[_local3].length));
if (grid.gameSprite[(("a_" + grid[uMatch[_local3][_local4]].col) + "_") + grid[uMatch[_local3][_local4]].row].indicator_mc._visible) {
grid.gameSprite[(("a_" + grid[uMatch[_local3][_local4]].col) + "_") + grid[uMatch[_local3][_local4]].row].indicator_mc._visible = false;
comp--;
}
_local4++;
}
_local3++;
}
_local3 = 0;
while (_local3 < uMatch.length) {
var _local4 = 0;
while (_local4 < uMatch[_local3].length) {
bringDown(grid[uMatch[_local3][_local4]]);
_local4++;
}
_local3++;
}
var _local4 = 0;
while (_local4 < initialMap.length) {
_local3 = 0;
while (_local3 < initialMap[0].length) {
var _local2 = (("t_" + _local3) + "_") + _local4;
if ((grid[_local2].type == undefined) && (grid[_local2].isPlayable)) {
grid[_local2].type = Math.ceil(Math.random() * maxRange);
changeGameTile(grid.gameSprite[grid[_local2].name], grid[_local2].type);
grid.gameSprite[grid[_local2].name].drop(9);
}
_local3++;
}
_local4++;
}
checkProgress();
}
clearInterval(delID);
delID = setInterval(countMe, 50);
bottle_mc.useHandCursor = false;
eks = 1;
}
function bringDown(tile, num) {
isDropping = true;
var _local5;
var _local1;
tile.type = grid[(("t_" + tile.col) + "_") + (tile.row - 1)].type;
changeGameTile(grid.gameSprite[tile.name], tile.type);
grid.gameSprite[tile.name].drop(num, true);
var _local2 = 1;
while (_local2 < 11) {
_local1 = grid[(("t_" + tile.col) + "_") + (tile.row - _local2)];
_local5 = grid[(("t_" + tile.col) + "_") + _local2];
if (_local1.type == undefined) {
_local1.type = undefined;
changeGameTile(grid.gameSprite[grid[(("t_" + _local1.col) + "_") + _local1.row].name], grid[(("t_" + _local1.col) + "_") + _local1.row].type);
grid.gameSprite[_local1.name].drop(num, true);
break;
}
if (_local1.isPlayable) {
if (grid[(("t_" + _local1.col) + "_") + (_local1.row - _local2)].type != undefined) {
grid[(("t_" + _local1.col) + "_") + _local1.row].type = grid[(("t_" + _local1.col) + "_") + (_local1.row - _local2)].type;
} else {
grid[(("t_" + _local1.col) + "_") + _local1.row].type = grid[(("t_" + _local1.col) + "_") + (_local1.row - _local2)].type;
}
changeGameTile(grid.gameSprite[grid[(("t_" + _local1.col) + "_") + _local1.row].name], grid[(("t_" + _local1.col) + "_") + _local1.row].type);
grid.gameSprite[_local1.name].drop(num, true);
} else {
grid.gameSprite[_local1.name].drop(num, true);
break;
}
_local2++;
}
}
function getMatchHoriz() {
var _local3;
var _local2 = new Array();
var _local6 = new Array();
var _local5 = 0;
while (_local5 < initialMap.length) {
var _local4 = 0;
while (_local4 < initialMap[0].length) {
var _local1 = (("t_" + _local4) + "_") + _local5;
if ((grid[_local1].isPlayable == true) && (grid[_local1].type != undefined)) {
if (_local3 == undefined) {
_local3 = grid[_local1].type;
_local2.push(grid[_local1].name);
} else if (_local3 == grid[_local1].type) {
_local2.push(grid[_local1].name);
} else {
if (_local2.length > 2) {
_local6.push(_local2);
}
_local2 = [];
_local2.push(grid[_local1].name);
_local3 = grid[_local1].type;
}
} else {
if (_local2.length > 2) {
_local6.push(_local2);
}
_local2 = [];
_local3 = undefined;
}
_local4++;
}
_local5++;
}
return(_local6);
}
function getMatchVert() {
var _local3;
var _local2 = new Array();
var _local6 = new Array();
var _local5 = 0;
while (_local5 < initialMap[0].length) {
var _local4 = 0;
while (_local4 < initialMap.length) {
var _local1 = (("t_" + _local5) + "_") + _local4;
if ((grid[_local1].isPlayable == true) && (grid[_local1].type != undefined)) {
if (_local3 == undefined) {
_local3 = grid[_local1].type;
_local2.push(grid[_local1].name);
} else if (_local3 == grid[_local1].type) {
_local2.push(grid[_local1].name);
} else {
if (_local2.length > 2) {
_local6.push(_local2);
}
_local2 = [];
_local2.push(grid[_local1].name);
_local3 = grid[_local1].type;
}
} else {
if (_local2.length > 2) {
_local6.push(_local2);
}
_local2 = [];
_local3 = undefined;
}
_local4++;
}
_local5++;
}
return(_local6);
}
function changeTile(mc, type) {
if (type == undefined) {
type = 1;
}
mc.gotoAndStop(type);
}
function changeGameTile(mc, type) {
if (type == undefined) {
type = 0;
}
mc.gotoAndStop((type + 1) + offset);
if (mc.myTween.onMotionFinished == undefined) {
mc.myTween.onMotionFinished = function () {
_root.isDropping = false;
_root.aftermath();
};
}
}
function cloneTile(mc, clone) {
clone.gotoAndStop(mc._currentframe);
}
function aftermath() {
if (isDropping == false) {
searchAndDestroy();
isMovePossible = checkBoard();
}
}
function checkBoard() {
var _local3 = 0;
while (_local3 < initialMap.length) {
var _local1 = 0;
while (_local1 < initialMap[0].length) {
var _local2 = (("t_" + _local1) + "_") + _local3;
if (grid[_local2].isPlayable == true) {
var _local4 = new Array();
if ((grid[_local2].type == grid[(("t_" + (_local1 + 1)) + "_") + _local3].type) && (grid[(("t_" + (_local1 + 1)) + "_") + _local3].type != undefined)) {
_local4 = [[-2, 0], [-1, -1], [-1, 1], [2, -1], [2, 1], [3, 0]];
if (matcher(_local1, _local3, _local4, grid[_local2].type, 1)) {
return(true);
}
}
if ((grid[_local2].type == grid[(("t_" + (_local1 + 2)) + "_") + _local3].type) && (grid[(("t_" + (_local1 + 2)) + "_") + _local3].type != undefined)) {
_local4 = [[1, -1], [1, 1]];
if (matcher(_local1, _local3, _local4, grid[_local2].type, 2)) {
return(true);
}
}
if ((grid[_local2].type == grid[(("t_" + _local1) + "_") + (_local3 + 1)].type) && (grid[(("t_" + _local1) + "_") + (_local3 + 1)].type != undefined)) {
_local4 = [[0, -2], [-1, -1], [1, -1], [-1, 2], [1, 2], [0, 3]];
if (matcher(_local1, _local3, _local4, grid[_local2].type, 3)) {
return(true);
}
}
if ((grid[_local2].type == grid[(("t_" + _local1) + "_") + (_local3 + 2)].type) && (grid[(("t_" + _local1) + "_") + (_local3 + 2)].type != undefined)) {
_local4 = [[-1, 1], [1, 1]];
if (matcher(_local1, _local3, _local4, grid[_local2].type, 4)) {
return(true);
}
}
}
_local1++;
}
_local3++;
}
fluidPercent = 100;
trickleFluid(100);
return(false);
}
function matcher(col, row, arr, type, matchType) {
var _local1 = 0;
while (_local1 < arr.length) {
if ((grid[(("t_" + (col + arr[_local1][0])) + "_") + (row + arr[_local1][1])].type == type) && (grid[(("t_" + (col + arr[_local1][0])) + "_") + (row + arr[_local1][1])].type != undefined)) {
if (matchType == 1) {
if (col > arr[_local1][0]) {
if (grid[(("t_" + (col - 1)) + "_") + row].isPlayable == true) {
return(true);
}
} else if (grid[(("t_" + (col + 2)) + "_") + row].isPlayable == true) {
return(true);
}
} else if (matchType == 2) {
if (grid[(("t_" + (col + 1)) + "_") + row].isPlayable == true) {
return(true);
}
} else if (matchType == 3) {
if (row > arr[_local1][1]) {
if (grid[(("t_" + col) + "_") + (row - 1)].isPlayable == true) {
return(true);
}
} else if (grid[(("t_" + col) + "_") + (row + 2)].isPlayable == true) {
return(true);
}
} else if (matchType == 4) {
if (grid[(("t_" + col) + "_") + (row + 1)].isPlayable == true) {
return(true);
}
}
}
_local1++;
}
return(false);
}
function trickleFluid(num) {
num = Math.round(num / trickleRate);
if (((num + fluidPercent) > 100) || (fluidPercent == 100)) {
fluidPercent = 100;
fluidMode = true;
if (isMovePossible == true) {
displayMsg("Milk Bottle Full! Click to Use!");
} else if (isMovePossible == false) {
displayMsg("No Moves Left! Use Milk Bottle");
} else {
displayMsg("");
}
bottle_mc.useHandCursor = true;
}
if (fluidPercent < 100) {
displayMsg("");
fluidPercent = fluidPercent + num;
bottle_mc.useHandCursor = false;
}
bottle_mc.gotoAndStop(fluidPercent);
fluid_txt.text = fluidPercent + "%";
}
function addPoints(num) {
var _local2 = num;
var _local3 = (num - 3) * 5;
num = (num * (10 + _local3)) / _local2;
gameScore = gameScore + num;
score_txt.text = gameScore;
trickleFluid(_local2);
return(10 + _local3);
}
function addBonus(num) {
gameScore = gameScore + num;
score_txt.text = gameScore;
}
function pauseGame() {
function hidePlayables() {
var _local2 = 0;
while (_local2 < initialMap.length) {
var _local1 = 0;
while (_local1 < initialMap[0].length) {
if (grid[(("t_" + _local1) + "_") + _local2].isPlayable) {
grid.gameSprite[(("t_" + _local1) + "_") + _local2]._visible = false;
}
_local1++;
}
_local2++;
}
}
pause_btn.paused_mc.gotoAndStop(2);
isPaused = true;
grid.gameClone._visible = false;
fade = this.attachMovie("faderMc", fader_mc, getNextHighestDepth());
fade.onRelease = function () {
resumeGame();
};
clearInterval(intID);
clearInterval(timerID);
hidePlayables();
}
function resumeGame() {
function showPlayables() {
var _local2 = 0;
while (_local2 < initialMap.length) {
var _local1 = 0;
while (_local1 < initialMap[0].length) {
if (grid[(("t_" + _local1) + "_") + _local2].isPlayable) {
grid.gameSprite[(("t_" + _local1) + "_") + _local2]._visible = true;
}
_local1++;
}
_local2++;
}
}
pause_btn.paused_mc.gotoAndStop(1);
removeMovieClip(fade);
grid.gameClone._visible = true;
isPaused = false;
intID = setInterval(trickleFluid, trickleRate * 1000, trickleRate);
timerID = setInterval(countdown, 1000);
showPlayables();
}
function countdown() {
if (totalSec > 0) {
totalSec = totalSec - 1;
var _local3 = Math.floor(totalSec / 60);
var _local1 = Math.floor(totalSec) % 60;
if (_local1 < 10) {
_local1 = "0" + _local1;
}
timer_txt.text = (_local3 + ":") + _local1;
} else {
toggleHUD(false);
removeMovieClip(clip_mc);
removeMovieClip(clone_mc);
clearInterval(intID);
clearInterval(timerID);
var _local2 = ref[openDialogue("mcTimeUp")];
_local2.score_txt.text = gameScore;
_local2.submitScore.Score = gameScore;
_local2.endplaymore_btn.onRelease = function () {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=211&area=gameover2", "_blank");
};
_local2.tryagain_btn.onRelease = function () {
endGame();
gotoAndStop ("mainmenu");
};
}
}
function checkProgress() {
if (comp <= 0) {
if (currentLevel < FINAL_LEVEL) {
tempPercent = fluidPercent;
nextLevel();
} else {
toggleHUD(false);
var _local2 = Math.round((totalSec * 15) * Math.ceil(currentLevel / 2));
var _local1 = ref[openDialogue("mcGameComplete")];
clearInterval(intID);
clearInterval(timerID);
bottle_mc.useHandCursor = false;
_local1.bonus_txt.text = "+" + _local2;
if (isAdded == false) {
addBonus(_local2 * 1.5);
isAdded = true;
}
_local1.score_txt.text = gameScore;
_local1.submitScore.Score = gameScore;
mcDialogue_mc.endplaymore_btn.onRelease = function () {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=211&area=gameover2", "_blank");
};
mcDialogue_mc.tryagain_btn.onRelease = function () {
endGame();
gotoAndStop ("mainmenu");
};
}
}
comp_txt.text = comp;
}
function getLastCol(row) {
var _local3 = 0;
var _local1 = 0;
while (_local1 < initialMap[0].length) {
if (grid[(("t_" + _local1) + "_") + row].isPlayable) {
_local3 = grid[(("t_" + _local1) + "_") + row].col;
}
_local1++;
}
return(_local3);
}
function getFirstCol(row) {
var _local2 = 0;
var _local1 = 0;
while (_local1 < initialMap[0].length) {
if (grid[(("t_" + _local1) + "_") + row].isPlayable) {
_local2 = grid[(("t_" + _local1) + "_") + row].col;
return(_local2);
}
_local1++;
}
}
function isFirstFake(col, row) {
if ((grid.gameClone[(("t_" + j) + "_") + row].isTemp && (col == j)) && (grid.gameClone[(("t_" + (j + 1)) + "_") + row].isTemp == false)) {
return(true);
}
return(false);
}
function getSingleFakes(row) {
var _local4 = new Array();
var _local2 = 0;
while (_local2 < initialMap[0].length) {
var _local3 = ((("t_" + _local2) + "_") + row) + "_clone";
if (((grid.gameClone["row_" + row][((("t_" + _local2) + "_") + row) + "_clone"].isTemp == true) && (grid.gameClone["row_" + row][((("t_" + (_local2 + 1)) + "_") + row) + "_clone"].isTemp == false)) && (grid.gameClone["row_" + row][((("t_" + (_local2 - 1)) + "_") + row) + "_clone"].isFar == true)) {
if (!grid.gameSprite[(("a_" + getLastCol(row)) + "_") + row].indicator_mc._visible) {
grid.gameClone["row_" + row][_local3].activated_mc._visible = true;
} else {
grid.gameClone["row_" + row][_local3].activated_mc._visible = false;
}
} else if (((grid.gameClone["row_" + row][((("t_" + _local2) + "_") + row) + "_clone"].isTemp == true) && (grid.gameClone["row_" + row][((("t_" + (_local2 + 1)) + "_") + row) + "_clone"].isTemp == false)) && (grid.gameClone["row_" + row][((("t_" + (_local2 - 1)) + "_") + row) + "_clone"].isTemp == false)) {
_local4.push(grid.gameClone["row_" + row][((("t_" + _local2) + "_") + row) + "_clone"]);
}
_local2++;
}
return(_local4);
}
function dragRow(row) {
var _local8 = new Array();
var _local2 = 0;
while (_local2 < initialMap.length) {
var _local7;
var _local4;
var _local6;
var _local5;
var _local3 = 0;
while (_local3 < initialMap[0].length) {
var _local9 = ((("t_" + _local3) + "_") + _local2) + "_clone";
var _local10 = (("t_" + _local3) + "_") + _local2;
if (grid[_local10].isPlayable) {
cloneTile(grid.gameSprite[_local10], grid.gameClone["row_" + _local2][_local9]);
_local8.push(grid.gameClone["row_" + _local2][_local9]);
if (!grid.gameSprite[(("a_" + _local3) + "_") + _local2].indicator_mc._visible) {
grid.gameClone["row_" + _local2][_local9].activated_mc._visible = true;
} else {
grid.gameClone["row_" + _local2][_local9].activated_mc._visible = false;
}
}
_local3++;
}
_local3 = 0;
while (_local3 < initialMap[0].length) {
var _local9 = ((("t_" + _local3) + "_") + _local2) + "_clone";
var _local10 = (("t_" + _local3) + "_") + _local2;
if (grid.gameClone["row_" + _local2][((("t_" + (_local3 + 1)) + "_") + _local2) + "_clone"].isTemp != grid.gameClone["row_" + _local2][_local9].isTemp) {
if (grid.gameClone["row_" + _local2][_local9].isTemp == true) {
_local5 = grid.gameClone["row_" + _local2][_local9];
_local7 = grid.gameClone["row_" + _local2][((("t_" + (_local3 + 1)) + "_") + _local2) + "_clone"];
} else {
_local6 = grid.gameClone["row_" + _local2][_local9];
_local4 = grid.gameClone["row_" + _local2][((("t_" + (_local3 + 1)) + "_") + _local2) + "_clone"];
}
}
if ((((_local5 != undefined) && (_local4 != undefined)) && (_local6 != undefined)) && (_local7 != undefined)) {
cloneTile(_local7, _local4);
cloneTile(_local6, _local5);
if (grid.gameSprite[(("a_" + _local7.place) + "_") + _local7.row].indicator_mc._visible == false) {
grid.gameClone["row_" + _local2][((("t_" + _local4.place) + "_") + _local4.row) + "_clone"].activated_mc._visible = true;
} else {
grid.gameClone["row_" + _local2][((("t_" + _local4.place) + "_") + _local4.row) + "_clone"].activated_mc._visible = false;
}
if (grid.gameSprite[(("a_" + _local6.place) + "_") + _local6.row].indicator_mc._visible == false) {
grid.gameClone["row_" + _local2][((("t_" + _local5.place) + "_") + _local5.row) + "_clone"].activated_mc._visible = true;
} else {
grid.gameClone["row_" + _local2][((("t_" + _local5.place) + "_") + _local5.row) + "_clone"].activated_mc._visible = false;
}
_local5 = undefined;
_local4 = undefined;
_local6 = undefined;
_local7 = undefined;
}
_local3++;
}
grid.gameClone["row_" + _local2]._visible = true;
cloneTile(grid.gameSprite[(("t_" + getLastCol(_local2)) + "_") + _local2], grid.gameClone["row_" + _local2][((("t_" + (_local8[0].place - 1)) + "_") + _local2) + "_clone"]);
if (grid.gameSprite[(("a_" + getLastCol(_local2)) + "_") + _local2].indicator_mc._visible == false) {
grid.gameClone["row_" + _local2][((("t_" + (_local8[0].place - 1)) + "_") + _local2) + "_clone"].activated_mc._visible = true;
} else {
grid.gameClone["row_" + _local2][((("t_" + (_local8[0].place - 1)) + "_") + _local2) + "_clone"].activated_mc._visible = false;
}
cloneTile(grid.gameSprite[(("t_" + getFirstCol(_local2)) + "_") + _local2], grid.gameClone["row_" + _local2][((("t_" + (_local8[_local8.length - 1].place + 1)) + "_") + _local2) + "_clone"]);
if (grid.gameSprite[(("a_" + getFirstCol(_local2)) + "_") + _local2].indicator_mc._visible == false) {
grid.gameClone["row_" + _local2][((("t_" + (_local8[_local8.length - 1].place + 1)) + "_") + _local2) + "_clone"].activated_mc._visible = true;
} else {
grid.gameClone["row_" + _local2][((("t_" + (_local8[_local8.length - 1].place + 1)) + "_") + _local2) + "_clone"].activated_mc._visible = false;
}
_local8 = [];
grid.gameClone["row_" + _local2].onRollOver = function () {
for (var _local2 in this) {
this[_local2].cloneSelect_mc._visible = true;
}
};
grid.gameClone["row_" + _local2].onRollOut = function () {
for (var _local2 in this) {
this[_local2].cloneSelect_mc._visible = false;
}
};
grid.gameClone["row_" + _local2].onPress = function () {
if (this.isFlying == false) {
curRow = this.row;
currentMagicRow = this.row;
mouseListen(this, this._x);
this.isFlying = true;
startDrag (this, false, this._x - 35, this._y, this._x + 35, this._y);
} else {
this.stopDrag();
this.isFlying = false;
}
};
grid.gameClone["row_" + _local2].onReleaseOutside = function () {
if (this.isFlying == false) {
currentMagicRow = this.row;
mouseListen(this, this._x);
startDrag (this, false, this._x - 35, this._y, this._x + 35, this._y);
} else {
this.stopDrag();
this.isFlying = false;
}
};
_local2++;
}
}
function transformClones(arr, direction) {
var _local1 = 0;
while (_local1 < arr.length) {
if (direction == "left") {
cloneTile(grid.gameSprite[(("t_" + (arr[_local1].place + 1)) + "_") + arr[_local1].row], arr[_local1]);
if (grid.gameSprite[(("a_" + (arr[_local1].place + 1)) + "_") + arr[_local1].row].indicator_mc._visible == false) {
arr[_local1].activated_mc._visible = true;
} else {
arr[_local1].activated_mc._visible = false;
}
} else {
cloneTile(grid.gameSprite[(("t_" + (arr[_local1].place - 1)) + "_") + arr[_local1].row], arr[_local1]);
if (grid.gameSprite[(("a_" + (arr[_local1].place - 1)) + "_") + arr[_local1].row].indicator_mc._visible == false) {
arr[_local1].activated_mc._visible = true;
} else {
arr[_local1].activated_mc._visible = false;
}
}
_local1++;
}
}
function mouseListen(_mc, origX) {
var isLeft = false;
var isRight = false;
var mouseListener = new Object();
mouseListener.onMouseMove = function () {
if (_mc._x > (origX + 12.5)) {
isRight = true;
isLeft = false;
transformClones(getSingleFakes(curRow), "right");
} else if (_mc._x < (origX - 12.5)) {
isLeft = true;
isRight = false;
transformClones(getSingleFakes(curRow), "left");
} else {
isLeft = false;
isRight = false;
transformClones(getSingleFakes(curRow), "j");
}
};
mouseListener.onMouseDown = function () {
if (isRight) {
applyChanges(_mc.row, "right");
} else if (isLeft) {
applyChanges(_mc.row, "left");
} else {
applyChanges(_mc.row, "no");
}
_mc._x = origX;
_mc.stopDrag();
Mouse.removeListener(mouseListener);
};
Mouse.addListener(mouseListener);
}
function openDialogue(libItem) {
attachMovie(libItem, libItem + "_mc", fade_mc.getDepth() - 1);
currentContent = ref[libItem + "_mc"];
ref[libItem + "_mc"]._x = (MAP_WIDTH - ref[libItem + "_mc"]._width) / 2;
ref[libItem + "_mc"]._y = (MAP_HEIGHT - ref[libItem + "_mc"]._height) / 2;
return(libItem + "_mc");
}
function applyChanges(row, dir) {
var _local1 = new Array();
var _local4 = 0;
while (_local4 < initialMap[0].length) {
if (grid[(("t_" + _local4) + "_") + row].type != undefined) {
_local1.push(grid[(("t_" + _local4) + "_") + row].name);
}
_local4++;
}
var _local6;
var _local3 = false;
if (dir == "left") {
_local6 = 0;
var _local2 = 0;
while (_local2 < _local1.length) {
if (_local2 == 0) {
_local6 = grid[_local1[_local2]].type;
grid[_local1[_local2]].type = grid[_local1[_local2 + 1]].type;
if (grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible == true) {
_local3 = true;
} else {
_local3 = false;
}
if (grid.gameSprite[(("a_" + grid[_local1[_local2 + 1]].col) + "_") + grid[_local1[_local2 + 1]].row].indicator_mc._visible == true) {
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = true;
} else {
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = false;
}
} else if (_local2 == (_local1.length - 1)) {
grid[_local1[_local2]].type = _local6;
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = _local3;
} else {
grid[_local1[_local2]].type = grid[_local1[_local2 + 1]].type;
if (grid.gameSprite[(("a_" + grid[_local1[_local2 + 1]].col) + "_") + grid[_local1[_local2 + 1]].row].indicator_mc._visible == true) {
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = true;
} else {
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = false;
}
}
changeGameTile(grid.gameSprite[grid[_local1[_local2]].name], grid[_local1[_local2]].type);
_local2++;
}
deminishMilk();
isMovePossible = checkBoard();
} else if (dir == "right") {
_local6 = grid[_local1[0]].type;
var _local2 = _local1.length - 1;
while (0 <= _local2) {
if (_local2 == 0) {
grid[_local1[_local2]].type = _local6;
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = _local3;
} else if (_local2 == (_local1.length - 1)) {
_local6 = grid[_local1[_local2]].type;
grid[_local1[_local2]].type = grid[_local1[_local2 - 1]].type;
if (grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible == true) {
_local3 = true;
} else {
_local3 = false;
}
if (grid.gameSprite[(("a_" + grid[_local1[_local2 - 1]].col) + "_") + grid[_local1[_local2 - 1]].row].indicator_mc._visible == true) {
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = true;
} else {
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = false;
}
} else {
grid[_local1[_local2]].type = grid[_local1[_local2 - 1]].type;
if (grid.gameSprite[(("a_" + grid[_local1[_local2 - 1]].col) + "_") + grid[_local1[_local2 - 1]].row].indicator_mc._visible == true) {
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = true;
} else {
grid.gameSprite[(("a_" + grid[_local1[_local2]].col) + "_") + grid[_local1[_local2]].row].indicator_mc._visible = false;
}
}
changeGameTile(grid.gameSprite[grid[_local1[_local2]].name], grid[_local1[_local2]].type);
_local2--;
}
deminishMilk();
isMovePossible = checkBoard();
} else {
displayMsg("No Change Made!");
}
var _local5 = 0;
while (_local5 < initialMap.length) {
grid.gameClone["row_" + _local5]._visible = false;
_local5++;
}
searchAndDestroy();
}
function deminishMilk() {
bottle_mc.useHandCursor = false;
bottle_mc.gotoAndPlay(101);
fluidPercent = 0;
displayMsg("");
}
function redrawSprite() {
var _local1 = 0;
while (_local1 < initialMap.length) {
var _local2 = 0;
while (_local2 < initialMap[0].length) {
var _local3 = ((("t_" + _local2) + "_") + _local1) + "_clone";
var _local4 = (("t_" + _local2) + "_") + _local1;
if (grid[_local4].isPlayable) {
cloneTile(grid.gameSprite[_local4], grid.gameClone["row_" + _local1][_local3]);
trueCopy_array.push(grid.gameClone["row_" + _local1][_local3]);
if (!grid.gameSprite[(("a_" + _local2) + "_") + _local1].indicator_mc._visible) {
grid.gameClone["row_" + _local1][_local3].activated_mc._visible = true;
} else {
grid.gameClone["row_" + _local1][_local3].activated_mc._visible = false;
}
}
_local2++;
}
_local1++;
}
}
stop();
var grid = new Object();
var isDropping = false;
var firstTile;
var intialMap = new Array();
var curRow;
var currentContent;
var isAdded = false;
var delID;
var eks = 0;
var isMovePossible = true;
var firstMc;
var fluidMode = false;
var ref = this;
var currentMagicRow = 0;
var level1_array;
var level2_array;
var level3_array;
var level4_array;
var level5_array;
var level6_array;
var level7_array;
var level8_array;
var level9_array;
var level10_array;
var lvl1 = new Object();
var lvl2 = new Object();
var lvl3 = new Object();
var lvl4 = new Object();
var lvl5 = new Object();
var lvl6 = new Object();
var lvl7 = new Object();
var lvl8 = new Object();
var lvl9 = new Object();
var lvl10 = new Object();
var TILE_WIDTH = 35;
var TILE_HEIGHT = 35;
var MAP_WIDTH = 550;
var MAP_HEIGHT = 400;
level_txt.embedFonts = true;
score_txt.embedFonts = true;
timer_txt.embedFonts = true;
status_txt.embedFonts = true;
var currentLevel = 1;
var gameScore = 0;
var fluidPercent = 0;
var FINAL_LEVEL = 10;
var comp = 0;
var offset = 0;
var maxRange = 0;
var trickleRate = 3.5;
var intID;
var timerID;
var totalSec = 600;
level1_array = [[7, 6, 6, 6, 5, 1, 7, 6, 6, 6, 5], [8, 0, 0, 0, 21, 6, 20, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 24, 0, 0, 0, 0, 9], [4, 3, 18, 0, 0, 0, 0, 0, 19, 3, 2], [1, 1, 4, 3, 3, 3, 3, 3, 2, 1, 1]];
level3_array = [[7, 6, 5, 1, 7, 6, 5, 1, 7, 6, 17, 6, 5], [8, 0, 25, 6, 26, 0, 25, 6, 26, 0, 12, 0, 9], [8, 0, 12, 0, 12, 0, 12, 0, 13, 0, 12, 0, 9], [8, 0, 13, 0, 13, 0, 13, 0, 0, 0, 13, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2]];
level2_array = [[7, 6, 6, 6, 5, 1, 7, 6, 6, 6, 5], [8, 0, 0, 0, 21, 6, 20, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [27, 14, 14, 16, 0, 0, 0, 15, 14, 14, 28], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 19, 3, 18, 0, 0, 0, 9], [4, 3, 3, 3, 2, 1, 4, 3, 3, 3, 2]];
level4_array = [[7, 6, 5, 1, 7, 6, 6, 6, 6, 5, 1], [8, 0, 21, 17, 20, 0, 0, 0, 0, 21, 5], [8, 0, 0, 13, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 23, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 30, 16, 0, 0, 9], [8, 0, 0, 23, 0, 0, 0, 0, 0, 0, 9], [8, 0, 19, 29, 18, 0, 0, 0, 0, 19, 2], [4, 3, 2, 1, 4, 3, 3, 3, 3, 2, 1]];
level5_array = [[1, 1, 7, 6, 6, 6, 6, 6, 5, 1, 1], [1, 7, 20, 0, 0, 0, 0, 0, 21, 5, 1], [7, 20, 0, 0, 0, 0, 0, 0, 0, 21, 5], [8, 0, 0, 0, 0, 23, 0, 0, 0, 0, 11], [8, 0, 0, 0, 15, 22, 16, 0, 0, 0, 11], [8, 0, 0, 0, 0, 13, 0, 0, 0, 0, 11], [4, 18, 0, 0, 0, 0, 0, 0, 0, 19, 2], [1, 4, 18, 0, 0, 0, 0, 0, 19, 2, 1], [1, 1, 4, 3, 3, 3, 3, 3, 2, 1, 1]];
level6_array = [[1, 1, 1, 1, 1, 7, 6, 6, 6, 6, 6, 6, 5], [1, 1, 1, 1, 1, 8, 0, 0, 0, 0, 0, 0, 9], [7, 6, 6, 6, 6, 26, 0, 24, 0, 0, 24, 0, 9], [8, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 9], [27, 16, 0, 0, 0, 0, 0, 24, 0, 0, 24, 0, 9], [8, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 9], [4, 3, 3, 3, 3, 32, 0, 24, 0, 0, 24, 0, 9], [1, 1, 1, 1, 1, 8, 0, 0, 0, 0, 0, 0, 9], [1, 1, 1, 1, 1, 4, 3, 3, 3, 3, 3, 3, 2]];
level7_array = [[7, 6, 5, 7, 6, 6, 6, 6, 5, 7, 6, 5], [8, 0, 25, 20, 0, 0, 0, 0, 21, 26, 0, 9], [8, 0, 13, 0, 0, 0, 0, 0, 0, 13, 0, 9], [8, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 9], [8, 0, 24, 0, 0, 0, 0, 0, 0, 24, 0, 9], [8, 0, 0, 0, 0, 15, 16, 0, 0, 0, 0, 9], [8, 0, 23, 0, 0, 0, 0, 0, 0, 23, 0, 9], [8, 0, 31, 18, 0, 0, 0, 0, 19, 32, 0, 9], [4, 3, 2, 4, 3, 3, 3, 3, 2, 4, 3, 2]];
level8_array = [[1, 7, 6, 17, 6, 6, 6, 6, 17, 6, 5, 1], [7, 20, 0, 12, 0, 0, 0, 0, 12, 0, 21, 5], [8, 0, 0, 13, 0, 19, 18, 0, 13, 0, 0, 11], [8, 0, 0, 0, 0, 21, 20, 0, 0, 0, 0, 11], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11], [8, 0, 0, 15, 16, 0, 0, 15, 16, 0, 0, 11], [4, 18, 0, 0, 0, 0, 0, 0, 0, 0, 19, 2], [1, 4, 18, 0, 0, 0, 0, 0, 0, 19, 2, 1], [1, 1, 4, 3, 3, 3, 3, 3, 3, 2, 1, 1]];
level9_array = [[7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 15, 16, 0, 15, 16, 0, 23, 0, 23, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 13, 0, 13, 0, 9], [8, 0, 15, 16, 0, 15, 16, 0, 0, 0, 0, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 23, 0, 23, 0, 9], [8, 0, 15, 16, 0, 15, 16, 0, 13, 0, 13, 0, 9], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2]];
level10_array = [[1, 1, 7, 6, 6, 6, 6, 6, 6, 5, 1, 1], [1, 1, 8, 0, 0, 0, 0, 0, 0, 9, 1, 1], [7, 6, 20, 0, 15, 14, 14, 16, 0, 21, 6, 5], [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [8, 0, 0, 23, 0, 0, 0, 0, 23, 0, 0, 9], [8, 0, 0, 30, 16, 0, 0, 15, 33, 0, 0, 9], [4, 18, 0, 0, 0, 0, 0, 0, 0, 0, 19, 2], [1, 4, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1]];
lvl1.lvlMap = level1_array;
lvl1.timeLimit = 180;
lvl1.range = 3;
lvl1.tileOffset = 0;
lvl1.world = 1;
lvl2.lvlMap = level2_array;
lvl2.timeLimit = 180;
lvl2.range = 3;
lvl2.tileOffset = 3;
lvl2.world = 1;
lvl3.lvlMap = level3_array;
lvl3.timeLimit = 192;
lvl3.range = 3;
lvl3.tileOffset = 4;
lvl3.world = 1;
lvl4.lvlMap = level4_array;
lvl4.timeLimit = 180;
lvl4.range = 3;
lvl4.tileOffset = 6;
lvl4.world = 1;
lvl5.lvlMap = level5_array;
lvl5.timeLimit = 210;
lvl5.range = 4;
lvl5.tileOffset = 7;
lvl5.world = 1;
lvl6.lvlMap = level6_array;
lvl6.timeLimit = 240;
lvl6.range = 4;
lvl6.tileOffset = 8;
lvl6.world = 2;
lvl7.lvlMap = level7_array;
lvl7.timeLimit = 180;
lvl7.range = 4;
lvl7.tileOffset = 3;
lvl7.world = 2;
lvl8.lvlMap = level8_array;
lvl8.timeLimit = 240;
lvl8.range = 4;
lvl8.tileOffset = 0;
lvl8.world = 2;
lvl9.lvlMap = level9_array;
lvl9.timeLimit = 282;
lvl9.range = 4;
lvl9.tileOffset = 3;
lvl9.world = 2;
lvl10.lvlMap = level10_array;
lvl10.timeLimit = 330;
lvl10.range = 5;
lvl10.tileOffset = 7;
lvl10.world = 2;
gameStart();
toggleHUD(true);
audio_mc.onRelease = function () {
if (_global.soundflag == 0) {
_global.soundflag = 1;
_root.my_sound.stop();
audio_mc.gotoAndStop(2);
} else {
_global.soundflag = 0;
_root.my_sound.start(0, 99999);
audio_mc.gotoAndStop(1);
}
};
bottle_mc.onRelease = function () {
if (fluidPercent == 100) {
dragRow();
}
};
var tempPercent;
var fade;
pause_btn.onRelease = function () {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=211&area=paused2", "_blank");
pauseGame();
};
Symbol 89 MovieClip Frame 1
stop();
var tagctr = (random(55) + 1);
gotoAndStop(tagctr);
Symbol 90 MovieClip Frame 105
stop();
Symbol 95 Button
on (release) {
getURL ("http://www.freegamesforyourwebsite.com/click.php?gid=211&area=loader2", "_blank");
}
Instance of Symbol 108 MovieClip "mcNotice" in Symbol 145 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 145 MovieClip Frame 150
stop();
if ((_url.indexOf("freeonlinegames.com") >= 0) && (_url.indexOf("file:") == -1)) {
_root.okToPlay = true;
_root.play();
} else if (_root.debug) {
_root.okToPlay = true;
_root.play();
} else {
_root.mcTaglines._visible = false;
mcNotice._visible = true;
}
Symbol 146 MovieClip Frame 71
stop();
var fogsound = new Sound();
fogsound.attachSound("fogaudio");
fogsound.start(0, 1);
Symbol 149 MovieClip Frame 1
_root.earl223 = function (val) {
var _local3 = new Array("_", "Z", "y", "x", "W", "v", "u", "T", "s", "r", "Q", "P", "O", "n", "m", "L", "K", "j", "i", "H", "g", "F", "e", "d", "C", "B", "a");
var _local2 = "";
val1 = 0;
while (val1 < val.length) {
if (val.substr(val1, 1) == ":") {
_local2 = _local2 + ":";
} else if (Number(val.substr(val1, 2)) > 26) {
_local2 = _local2 + _local3[Number(val.substr(val1, 1))];
} else if (Number(val.substr(val1, 1)) == 0) {
_local2 = _local2 + "_";
} else {
_local2 = _local2 + _local3[Number(val.substr(val1, 2))];
val1++;
}
val1++;
}
return(_local2);
};
Symbol 156 MovieClip Frame 1
stop();
Symbol 659 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 660 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 661 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 662 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return((((((c * t) * t) * t) * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = (t / d) - 1;
return((c * (((((t * t) * t) * t) * t) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return(((((((c / 2) * t) * t) * t) * t) * t) + b);
}
t = t - 2;
return(((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 162 MovieClip Frame 1
stop();
Symbol 204 MovieClip [clone] Frame 1
stop();
cloneSelect_mc._visible = false;
activated_mc._visible = false;
Symbol 208 MovieClip [activate] Frame 1
stop();
Symbol 214 MovieClip [sprite] Frame 1
function toggleSelected() {
if (tileSelector_mc._visible) {
tileSelector_mc._visible = false;
return(false);
}
tileSelector_mc._visible = true;
return(true);
}
function drop(num) {
ref._y = superOrig;
tempNum = superOrig - 35;
myTween = new mx.transitions.Tween(this, "_y", mx.transitions.easing.Strong.easeOut, tempNum, superOrig, 0.6, true);
_root.isDropping = true;
}
stop();
var tempNum;
var origY;
var myTween;
var ref = this;
var superOrig;
tileSelector_mc._visible = false;
mouseOver_mc._visible = false;
this.myTween.onMotionFinished = function () {
_root.isDropping = false;
_root.aftermath();
};
this.onRollOver = function () {
mouseOver_mc._visible = true;
};
this.onRollOut = function () {
mouseOver_mc._visible = false;
};
this.onReleaseOutside = function () {
mouseOver_mc._visible = false;
};
Symbol 218 MovieClip [burst] Frame 1
function burst(pts) {
point_txt.text = pts;
gotoAndPlay (2);
}
function toggleSelected() {
this.select_mc._visible = true;
}
stop();
this.select_mc._visible = false;
point_txt.embedFonts = true;
Symbol 218 MovieClip [burst] Frame 22
point_txt.text = "";
gotoAndStop (1);
Symbol 372 Button
on (press) {
sboard.dir = "up";
}
on (release) {
sboard.dir = "stop";
}
Symbol 373 Button
on (press) {
sboard.dir = "down";
}
on (release) {
sboard.dir = "stop";
}
Symbol 380 MovieClip Frame 1
stop();
Symbol 380 MovieClip Frame 2
stop();
Symbol 390 MovieClip [TMP6pbk6uzm9i] Frame 1
var arrScore = new Array();
mcScoreboard.sboard.dir = "stop";
mcScoreboard.sboard.mcScoreHolder.mcScore._visible = false;
mcLabel._visible = false;
var main = this;
xmlPlayer = new XML();
xmlPlayer.ignoreWhite = true;
xmlPlayer.onLoad = function (success) {
if (success) {
myPlayer = xmlPlayer.firstChild.childNodes;
ctr2 = 0;
while (ctr2 < myPlayer.length) {
thisPlayer = main.mcScoreboard.sboard.mcScoreHolder.mcScore.duplicateMovieClip("mcScore" + ctr2, ctr2);
thisPlayer._y = ctr2 * thisPlayer._height;
thisPlayer._visible = true;
if ((ctr2 % 2) > 0) {
thisPlayer.gotoAndStop(2);
}
thisPlayer.txtNumber.text = (ctr2 + 1) + ")";
thisPlayer.txtNickname.text = myPlayer[ctr2].attributes.player;
thisPlayer.txtScore.text = myPlayer[ctr2].attributes.score;
ctr2++;
}
main.mcScoreboard.mcLoading._visible = false;
main.mcScoreboard.sboard.mcScoreHolder.item = myPlayer.length;
main.mcScoreboard.sboard.mcScoreHolder.speedy = 0;
main.mcScoreboard.sboard.mcScoreHolder.desty = 0;
main.mcScoreboard.sboard.mcScoreHolder.onEnterFrame = function () {
if ((this.desty < 0) && (this._parent.dir == "up")) {
this.desty = this.desty + 10;
if (this.desty > 0) {
this.desty = 0;
}
}
if ((this.desty > (this._parent.mcBlock._height - (this.mcScore._height * this.item))) && (this._parent.dir == "down")) {
this.desty = this.desty - 10;
if (this.desty < (this._parent.mcBlock._height - (this.mcScore._height * this.item))) {
this.desty = this._parent.mcBlock._height - (this.mcScore._height * this.item);
}
}
this.speedy = (this.desty - this._y) + (this.speedy * 0.4);
this._y = this._y + this.speedy;
};
}
};
xmlPlayer.load(((("http://www.freeonlinegames.com/scoreboard/getTopPlayer.php?id=" + gameID) + "&rand=") + random(999999)) + "&filt=1");
Instance of Symbol 390 MovieClip [TMP6pbk6uzm9i] in Symbol 392 MovieClip [mcHighscore] Frame 1
//component parameters
onClipEvent (construct) {
gameID = 130;
}
Symbol 456 MovieClip [TMPd4lzhusf84] Frame 1
function earl223(val) {
var _local3 = new Array("_", "Z", "y", "x", "W", "v", "u", "T", "s", "r", "Q", "P", "O", "n", "m", "L", "K", "j", "i", "H", "g", "F", "e", "d", "C", "B", "a");
var _local2 = "";
val1 = 0;
while (val1 < val.length) {
if (val.substr(val1, 1) == ":") {
_local2 = _local2 + ":";
} else if (Number(val.substr(val1, 2)) > 26) {
_local2 = _local2 + _local3[Number(val.substr(val1, 1))];
} else if (Number(val.substr(val1, 1)) == 0) {
_local2 = _local2 + "_";
} else {
_local2 = _local2 + _local3[Number(val.substr(val1, 2))];
val1++;
}
val1++;
}
return(_local2);
}
mcButtonMain.mcButton.FOG.swapDepths(0);
mcButtonMain.mcButton.attachMovie(btnMC, "btnMC", 0);
mcButtonMain.mcButton.btnMC.onRelease = function () {
var _local2 = new LoadVars();
_local2.onLoad = function () {
getURL ("http://www.freeonlinegames.com/scoreboard.php?", "_blank");
};
_local2.score = Score;
_local2.score2 = earl223(String(Score));
_local2.gamer = gameID;
_local2.id = random(9999999);
_local2.toString();
_local2.sendAndLoad("http://www.freeonlinegames.com/scoreboard/score_c.php", _local2, "POST");
delete this.onRelease;
};
Instance of Symbol 456 MovieClip [TMPd4lzhusf84] "submitScore" in Symbol 457 MovieClip [mcTimeUp] Frame 1
//component parameters
onClipEvent (construct) {
btnMC = "submitscore_btn";
gameID = 130;
}
Instance of Symbol 456 MovieClip [TMPd4lzhusf84] "submitScore" in Symbol 508 MovieClip [mcGameComplete] Frame 1
//component parameters
onClipEvent (construct) {
btnMC = "submitscore_btn";
gameID = 130;
}
Symbol 539 MovieClip [unplayableTile] Frame 1
stop();
Symbol 622 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 100
stop();
Symbol 634 MovieClip Frame 100
gotoAndPlay (1);
Symbol 634 MovieClip Frame 101
stop();
Symbol 641 MovieClip Frame 1
stop();
Symbol 641 MovieClip Frame 2
stop();
Symbol 657 MovieClip Frame 1
stop();
Symbol 657 MovieClip Frame 2
stop();