Frame 1
function changeFrame(frame) {
var black = 15;
bg_mc.gotoAndPlay(1);
bg_mc.onEnterFrame = function () {
if (this._currentframe == black) {
_root.gotoAndStop(frame);
delete this.onEnterFrame;
}
};
}
Stage.showMenu = false;
var ttl = _root.getBytesTotal();
var ldd = null;
var frame = null;
status_mc.onEnterFrame = function () {
ldd = _root.getBytesLoaded();
frame = Math.round((ldd / ttl) * 100);
this.gotoAndStop(frame);
per1_txt.text = (per2_txt.text = (per3_txt.text = frame + "%"));
if (frame == 100) {
delete this.onEnterFrame;
changeFrame(3);
}
};
Frame 2
stop();
var vol = 40;
var isBgSound = false;
var menuClick_sound = new Sound();
menuClick_sound.attachSound("menuClick");
var menuEnter_sound = new Sound();
menuEnter_sound.attachSound("menuEnter");
var menu_sound = new Sound();
menu_sound.attachSound("menu");
var button_sound = new Sound();
button_sound.attachSound("button");
var fall_sound = new Sound();
fall_sound.attachSound("fall");
var break_sound = new Sound();
break_sound.attachSound("break");
var combo_sound = new Sound();
combo_sound.attachSound("combo");
var drop_sound = new Sound();
drop_sound.attachSound("drop");
var completed_sound = new Sound();
completed_sound.attachSound("completed");
var go_sound = new Sound();
go_sound.attachSound("go");
var gameOver_sound = new Sound();
gameOver_sound.attachSound("gameOver");
Frame 3
stop();
menu_sound.setVolume(vol);
if (!isBgSound) {
menu_sound.start(0, 999999999);
isBgSound = true;
}
if (snd_mc == undefined) {
_root.createEmptyMovieClip("snd_mc", 16161616);
}
snd_mc.onEnterFrame = function () {
menu_sound.setVolume(vol);
menuClick_sound.setVolume(vol);
menuEnter_sound.setVolume(vol);
button_sound.setVolume(vol);
fall_sound.setVolume(vol);
break_sound.setVolume(vol);
combo_sound.setVolume(vol);
drop_sound.setVolume(vol);
completed_sound.setVolume(vol);
go_sound.setVolume(vol);
gameOver_sound.setVolume(vol);
};
if (globalBtn_mc.oldDepth != undefined) {
globalBtn_mc.swapDepths(globalBtn_mc.oldDepth);
}
if (field != undefined) {
field.destructor();
delete field;
}
if (info_mc != undefined) {
info_mc.swapDepths(474747);
info_mc.removeMovieClip();
}
if (listeningField_mc != undefined) {
listeningField_mc.swapDepths(474747);
listeningField_mc.removeMovieClip();
}
if (waitingForBg_mc != undefined) {
waitingForBg_mc.swapDepths(474747);
waitingForBg_mc.removeMovieClip();
}
bg_mc.onEnterFrame = function () {
if (this._currentframe == 1) {
new_btn.enabled = true;
how_btn.enabled = true;
more_mc.enabled = true;
delete this.onEnterFrame;
} else {
new_btn.enabled = false;
how_btn.enabled = false;
more_mc.enabled = false;
}
};
new_btn.onRollOver = function () {
arrow_mc._x = 173;
arrow_mc._y = 162;
menuClick_sound.start(0, 1);
};
new_btn.onPress = function () {
changeFrame(5);
this.enabled = false;
how_btn.enabled = false;
more_mc.enabled = false;
menuEnter_sound.start(0, 1);
};
how_btn.onRollOver = function () {
arrow_mc._x = 155.5;
arrow_mc._y = 210;
menuClick_sound.start(0, 1);
};
how_btn.onPress = function () {
changeFrame(4);
this.enabled = false;
new_btn.enabled = false;
more_mc.enabled = false;
menuEnter_sound.start(0, 1);
};
more_btn.onRollOver = function () {
arrow_mc._x = 135;
arrow_mc._y = 260;
menuClick_sound.start(0, 1);
};
more_btn.onPress = function () {
getURL ("http://www.justfreegames.com?r1=F&r2=MD&WT.mc_id=FlashMagicDrop", "_blank");
menuEnter_sound.start(0, 1);
};
Instance of Symbol 88 MovieClip "mute_btn" in Frame 3
on (press) {
if (_currentframe == 1) {
gotoAndStop (2);
_root.vol = 0;
} else {
gotoAndStop (1);
_root.vol = 50;
}
}
Frame 4
_root.globalBtn_mc.oldDepth = _root.globalBtn_mc.getDepth();
_root.globalBtn_mc.swapDepths(_root.getNextHighestDepth());
_root.globalBtn_mc.useHandCursor = false;
_root.globalBtn_mc.onEnterFrame = function () {
if (bg_mc._currentframe == 1) {
delete this.onEnterFrame;
mute_btn.oldDepth = mute_btn.getDepth();
mute_btn.swapDepths(getNextHighestDepth());
_root.globalBtn_mc.onPress = function () {
mute_btn.swapDepths(mute_btn.oldDepth);
delete mute_btn.oldDepth;
changeFrame(3);
menuEnter_sound.start(0, 1);
delete this.onPress;
};
}
};
Frame 5
function info(info) {
var pauseFr = 45;
switch (info) {
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "10" :
_root.pause_btn.enabled = false;
_root.info_mc.gotoAndPlay("l" + info);
_root.info_mc.onEnterFrame = function () {
pauseFr--;
if (pauseFr == 0) {
delete this.onEnterFrame;
_root.pause_btn.enabled = true;
_root.field.setPause(false);
}
};
break;
case "completed" :
_root.pause_btn.enabled = false;
_root.info_mc.gotoAndPlay(info);
break;
case "gameOver" :
_root.field.setPause(true);
_root.pause_btn.enabled = false;
_root.info_mc.gotoAndPlay(info);
break;
case "youWon" :
_root.field.setPause(true);
_root.pause_btn.enabled = false;
_root.info_mc.gotoAndPlay(info);
break;
case "pause" :
_root.info_mc.gotoAndPlay(info);
break;
case "combo" :
_root.info_mc.gotoAndPlay(info);
}
}
stop();
(parts_mc._visible = false);
(parts_mc._width = (parts_mc._height = 0));
var XSteps = 6;
var YSteps = 10;
var Xstep = 36;
var Ystep = 39;
var x = 200;
var y = 1;
var alpha = 0;
var field = new Field();
field.createField(XSteps, YSteps, Xstep, Ystep, x, y, alpha);
field.generateFieldBottles();
field.createYellowArrows();
field.startGenerate();
globalBtn_mc.useHandCursor = false;
globalBtn_mc.onPress = function () {
if (_root.isCompleted && (!_root.isYouWon)) {
field.destructor();
field.setPause(false);
field.setLevel(field.getLevel() + 1);
field.createField(XSteps, YSteps, Xstep, Ystep, x, y, alpha);
field.generateFieldBottles();
field.createYellowArrows();
field.startGenerate();
field.setNumbOfBottlesInLevel();
field.setPause(true);
info(String(field.getLevel()));
_root.isCompleted = false;
} else if (_root.isCompleted && (_root.isYouWon)) {
field.destructor();
_root.isYouWon = false;
} else if (_root.isGO) {
info_mc.onEnterFrame = function () {
this._alpha = this._alpha - 25;
if (this._alpha == 0) {
field.destructor();
delete this.onEnterFrame;
}
};
changeFrame(3);
_root.isGO = false;
} else if (_root.isPaused) {
_root.isPaused = false;
field.setPause(false);
info_mc.gotoAndStop(1);
} else if (_root.isYouWon) {
info_mc.onEnterFrame = function () {
this._alpha = this._alpha - 25;
if (this._alpha == 0) {
field.destructor();
delete this.onEnterFrame;
}
};
changeFrame(3);
_root.isYouWon = false;
} else if (field.getLocalWaitingFrames() == null) {
field.motionFast(true);
} else {
field.setLocalWaitingFrames(1);
}
};
if (listeningField_mc == undefined) {
createEmptyMovieClip("listeningField_mc", getNextHighestDepth());
}
var isCompleted = false;
var isGO = false;
var isYouWon = false;
var isPaused = false;
listeningField_mc.onEnterFrame = function () {
if (field.getLevel() <= 10) {
level_txt.text = field.getLevel();
}
if ((field.getNumbOfBottlesInLevel() == 0) && (field.getLevel() >= 10)) {
field.setPause(true);
level_txt.text = 10;
field_mc._alpha = 50;
_root.info_mc.swapDepths(_root.getNextHighestDepth());
info("youWon");
isYouWon = true;
delete this.onEnterFrame;
}
if (field.getNumbOfBottlesInLevel() >= 0) {
bottles_txt.text = field.getNumbOfBottlesInLevel();
} else {
bottles_txt.text = 0;
}
points_txt.text = field.getPoints();
if ((field.getNumbOfBottlesInLevel() == 0) && (field.getLevel() <= 9)) {
field.setNumbOfBottlesInLevel(-1);
field.setPause(true);
_root.info_mc.swapDepths(_root.getNextHighestDepth());
info("completed");
_root.isCompleted = true;
}
isGO = field.getGameOver();
if (isGO) {
_root.info_mc.swapDepths(_root.getNextHighestDepth());
info("gameOver");
delete this.onEnterFrame;
}
};
_root.field.setPause(true);
info_mc.swapDepths(getNextHighestDepth());
info_mc.gotoAndStop(1);
info_mc._alpha = 100;
bg_mc.swapDepths(getNextHighestDepth());
createEmptyMovieClip("waitingForBg_mc", 161718);
var waitingForBg = 15;
waitingForBg_mc.onEnterFrame = function () {
waitingForBg--;
if (waitingForBg == 1) {
info(String(field.getLevel()));
}
};
pause_btn.onRollOver = (menu_btn.onRollOver = function () {
button_sound.start(0, 1);
});
pause_btn.onPress = function () {
field.setPause(!field.getPause());
_root.isPaused = !_root.isPaused;
if (field.getPause()) {
info("pause");
} else {
info_mc.gotoAndStop(1);
}
menuEnter_sound.start(0, 1);
};
menu_btn.onPress = function () {
field.setPause(true);
info_mc.onEnterFrame = function () {
this._alpha = this._alpha - 25;
if (this._alpha == 0) {
field.destructor();
delete this.onEnterFrame;
}
};
changeFrame(3);
menuEnter_sound.start(0, 1);
};
Symbol 16 MovieClip Frame 1
stop();
Symbol 25 MovieClip Frame 1
stop();
Symbol 167 MovieClip [__Packages.Field] Frame 0
class Field
{
function Field () {
}
function createField(_XSteps, _YSteps, _Xstep, _Ystep, _Xcoord, _Ycoord, _AlphaField) {
if (_root.field_mc != undefined) {
_root.field_mc.swapDepths(474747);
_root.field_mc.removeMovieClip();
}
XSteps = _XSteps;
YSteps = _YSteps;
Xstep = _Xstep;
Ystep = _Ystep;
x = _Xcoord;
y = _Ycoord;
alpha = _AlphaField;
var placeName = "";
_root.createEmptyMovieClip("field_mc", _root.getNextHighestDepth());
_root.field_mc.setMask(_root.mask_mc);
(_root.field_mc._x = x);
(_root.field_mc._y = y);
var i = 1;
while (i <= YSteps) {
var j = 1;
while (j <= XSteps) {
placeName = (("place_X" + j) + "Y") + i;
_root.field_mc.attachMovie("place", placeName, _root.field_mc.getNextHighestDepth());
placeName = "_root.field_mc." + placeName;
eval (placeName)._height = Ystep;
eval (placeName)._width = Xstep;
eval (placeName)._x = Xstep * (j - 1);
eval (placeName)._y = Ystep * (YSteps - i);
eval (placeName)._alpha = alpha;
eval (placeName).bottle = "none";
eval (placeName).bottleType = 0;
j++;
}
i++;
}
var numbOfGenPlaces = 6;
var alignY = ((YSteps - numbOfGenPlaces) + 1);
var D = 45;
var i = 1;
while (i <= numbOfGenPlaces) {
placeName = "genPlace_Y" + i;
_root.field_mc.attachMovie("place", placeName, _root.field_mc.getNextHighestDepth());
placeName = "_root.field_mc." + placeName;
eval (placeName)._height = Ystep;
eval (placeName)._width = Xstep;
eval (placeName)._x = eval ((("_root.field_mc.place_X" + XSteps) + "Y") + alignY)._x + D;
eval (placeName)._y = eval ((("_root.field_mc.place_X" + XSteps) + "Y") + alignY)._y;
alignY++;
eval (placeName)._alpha = alpha;
eval (placeName).bottle = "none";
eval (placeName).bottleType = 0;
i++;
}
}
function generateFieldBottles() {
if (_root.field_mc == undefined) {
return(undefined);
}
newID = 0;
switch (level) {
case 1 :
numbOfStrings = 0;
numbOfBottles = 6;
break;
case 2 :
numbOfStrings = 1;
numbOfBottles = 7;
break;
case 3 :
numbOfStrings = 2;
numbOfBottles = 8;
break;
case 4 :
numbOfStrings = 3;
numbOfBottles = 9;
break;
case 5 :
numbOfStrings = 3;
numbOfBottles = 9;
break;
case 6 :
numbOfStrings = 3;
numbOfBottles = 9;
break;
case 7 :
numbOfStrings = 4;
numbOfBottles = 9;
break;
case 8 :
numbOfStrings = 4;
numbOfBottles = 9;
break;
case 9 :
numbOfStrings = 4;
numbOfBottles = 9;
break;
case 10 :
numbOfStrings = 5;
numbOfBottles = 9;
}
if (_root.field_mc.bottles_mc != undefined) {
_root.field_mc.bottles_mc.swapDepths(474747);
_root.field_mc.bottles_mc.removeMovieClip();
}
_root.field_mc.createEmptyMovieClip("bottles_mc", _root.field_mc.getNextHighestDepth());
var bottleType = null;
var i = 1;
while (i <= numbOfStrings) {
var j = 1;
while (j <= XSteps) {
bottleType = ((getNumbOfBottles() - 1) * Math.random()) + 1;
bottleType = Math.round(bottleType);
_root.field_mc.bottles_mc.attachMovie("b" + bottleType, "b" + newID, _root.field_mc.bottles_mc.getNextHighestDepth());
eval ((("_root.field_mc.place_X" + j) + "Y") + i).bottleType = bottleType;
eval ((("_root.field_mc.place_X" + j) + "Y") + i).bottle = eval ("_root.field_mc.bottles_mc.b" + newID);
eval ("_root.field_mc.bottles_mc.b" + newID)._x = eval ((("_root.field_mc.place_X" + j) + "Y") + i)._x + ((eval ((("_root.field_mc.place_X" + j) + "Y") + i)._width - eval ("_root.field_mc.bottles_mc.b" + newID)._width) / 2);
eval ("_root.field_mc.bottles_mc.b" + newID)._y = eval ((("_root.field_mc.place_X" + j) + "Y") + i)._y + ((eval ((("_root.field_mc.place_X" + j) + "Y") + i)._height - eval ("_root.field_mc.bottles_mc.b" + newID)._height) / 2);
eval ("_root.field_mc.bottles_mc.b" + newID).X = j;
eval ("_root.field_mc.bottles_mc.b" + newID).Y = i;
eval ("_root.field_mc.bottles_mc.b" + newID).Type = bottleType;
eval ("_root.field_mc.bottles_mc.b" + newID).Height = eval ("_root.field_mc.bottles_mc.b" + newID)._height;
eval ("_root.field_mc.bottles_mc.b" + newID).gotoAndStop(2);
newID++;
j++;
}
i++;
}
}
function createYellowArrows() {
if (_root.field_mc == undefined) {
return(undefined);
}
var placeName = "";
var XStepsLocal = XSteps;
var xLocal = x;
var thisObject = this;
_root.attachMovie("yellow", "yellow_mc", _root.getNextHighestDepth());
placeName = "_root.field_mc.place_X1Y1";
_root.yellow_mc._x = (x + eval (placeName)._x) + ((eval (placeName)._width - _root.yellow_mc._width) / 2);
_root.yellow_mc._y = 30;
_root.yellow_mc.X = 1;
_root.yellow_mc.onMouseMove = function () {
if (thisObject.isPause) {
return(undefined);
}
var i = 1;
while (i <= XStepsLocal) {
placeName = ("_root.field_mc.place_X" + i) + "Y1";
if ((_root.field_mc._xmouse >= eval (placeName)._x) && (_root.field_mc._xmouse <= (eval (placeName)._x + eval (placeName)._width))) {
this.X = i;
this._x = (xLocal + eval (placeName)._x) + ((eval (placeName)._width - this._width) / 2);
updateAfterEvent();
return;
}
i++;
}
};
}
function startGenerate() {
if ((_root.field_mc == undefined) || (_root.field_mc.bottles_mc == undefined)) {
return(undefined);
}
var placeName = "_root.field_mc.genPlace_Y";
var ind = 1;
var curPlace = (placeName + ind);
var bottleType = null;
do {
if (eval (curPlace) == undefined) {
break;
}
bottleType = ((getNumbOfBottles() - 1) * Math.random()) + 1;
bottleType = Math.round(bottleType);
_root.field_mc.bottles_mc.attachMovie("b" + bottleType, "b" + newID, _root.field_mc.bottles_mc.getNextHighestDepth());
eval (curPlace).bottleType = bottleType;
eval (curPlace).bottle = eval ("_root.field_mc.bottles_mc.b" + newID);
eval ("_root.field_mc.bottles_mc.b" + newID)._x = eval (curPlace)._x + ((eval (curPlace)._width - eval ("_root.field_mc.bottles_mc.b" + newID)._width) / 2);
eval ("_root.field_mc.bottles_mc.b" + newID)._y = eval (curPlace)._y + ((eval (curPlace)._height - eval ("_root.field_mc.bottles_mc.b" + newID)._height) / 2);
eval ("_root.field_mc.bottles_mc.b" + newID).X = 0;
eval ("_root.field_mc.bottles_mc.b" + newID).Y = ind;
eval ("_root.field_mc.bottles_mc.b" + newID).Height = eval ("_root.field_mc.bottles_mc.b" + newID)._height;
eval ("_root.field_mc.bottles_mc.b" + newID).gotoAndStop(2);
eval ("_root.field_mc.bottles_mc.b" + newID).Type = bottleType;
newID++;
ind++;
curPlace = placeName + ind;
} while (eval (placeName + (ind + 1)) != undefined);
motionUp();
goNew();
waitingOfFalling();
}
function motionUp() {
if (isPause) {
return(undefined);
}
var placeName = "";
var newPlaceName = "";
var bottle_mc = null;
var thisObject = this;
var ind = 0;
var bottleType = null;
do {
ind++;
placeName = "_root.field_mc.genPlace_Y" + ind;
} while (eval (placeName) != undefined);
ind = ind - 2;
placeName = "_root.field_mc.genPlace_Y" + ind;
eval (placeName).onEnterFrame = function () {
if (thisObject.isPause) {
return(undefined);
}
if (ind == 0) {
delete this.onEnterFrame;
return(undefined);
}
bottle_mc = eval (placeName).bottle;
thisObject.numbOfMovingUpBottles--;
bottle_mc.oldY = bottle_mc._y;
bottle_mc.Y++;
this.bottle = "none";
this.bottleType = 0;
bottle_mc.onEnterFrame = function () {
if (thisObject.isPause) {
return(undefined);
}
this._y = this._y - thisObject.Dup;
if ((this.oldY - this._y) > thisObject.Ystep) {
newPlaceName = "_root.field_mc.genPlace_Y" + this.Y;
eval (newPlaceName).bottle = this;
eval (newPlaceName).bottleType = this.Type;
thisObject.numbOfMovingUpBottles++;
this._y = this.oldY - thisObject.Ystep;
delete this.oldY;
delete this.onEnterFrame;
}
};
ind--;
placeName = "_root.field_mc.genPlace_Y" + ind;
};
}
function goNew() {
var thisObject = this;
var ind = 0;
var placeName = "";
var D = 5;
var bottleType = null;
var newPlaceName = "_root.field_mc.genPlace_Y1";
do {
ind++;
placeName = "_root.field_mc.genPlace_Y" + ind;
} while (eval (placeName) != undefined);
ind--;
placeName = "_root.field_mc.genPlace_Y" + ind;
_root.createEmptyMovieClip("goNew_mc", _root.getNextHighestDepth());
_root.goNew_mc.onEnterFrame = function () {
if (thisObject.isPause) {
return(undefined);
}
if (((thisObject.numbOfMovingUpBottles == 0) && (eval (placeName).bottle != "none")) && (eval (placeName).bottle._x > (_root.yellow_mc._x - thisObject.x))) {
eval (placeName).bottle._x = eval (placeName).bottle._x - (thisObject.Dleft + thisObject.DDleft);
} else if (((thisObject.numbOfMovingUpBottles == 0) && (eval (placeName).bottle != "none")) && (eval (placeName).bottle._x <= (_root.yellow_mc._x - thisObject.x))) {
thisObject.localWaitingFrames = thisObject.waitingFrames;
bottleType = ((thisObject.getNumbOfBottles() - 1) * Math.random()) + 1;
bottleType = Math.round(bottleType);
eval (placeName).bottle._x = _root.yellow_mc._x - thisObject.x;
thisObject.onYellow = eval (placeName).bottle;
thisObject.motionFast(false);
eval (placeName).bottle = "none";
eval (placeName).bottleType = 0;
_root.field_mc.bottles_mc.attachMovie("b" + bottleType, "b" + thisObject.newID, _root.field_mc.bottles_mc.getNextHighestDepth());
eval (newPlaceName).bottleType = bottleType;
eval (newPlaceName).bottle = eval ("_root.field_mc.bottles_mc.b" + thisObject.newID);
eval (newPlaceName).bottle._x = eval (newPlaceName)._x + ((eval (newPlaceName)._width - eval (newPlaceName).bottle._width) / 2);
eval (newPlaceName).bottle._y = eval (newPlaceName)._y + ((eval (newPlaceName)._height - eval (newPlaceName).bottle._height) / 2);
eval (newPlaceName).bottle.X = 0;
eval (newPlaceName).bottle.Y = 1;
eval (newPlaceName).bottle.Height = eval (newPlaceName).bottle._height;
eval (newPlaceName).bottle.gotoAndStop(2);
eval (newPlaceName).bottle.Type = bottleType;
thisObject.newID++;
}
};
}
function waitingOfFalling() {
var thisObject = this;
_root.createEmptyMovieClip("waitingOfFalling_mc", _root.getNextHighestDepth());
_root.waitingOfFalling_mc.onEnterFrame = function () {
if (thisObject.isPause) {
return(undefined);
}
if (thisObject.onYellow != null) {
thisObject.localWaitingFrames--;
thisObject.onYellow._x = _root.yellow_mc._x - thisObject.x;
thisObject.onYellow.X = _root.yellow_mc.X;
thisObject.onYellow.Y = 10;
if (((thisObject.localWaitingFrames <= (thisObject.waitingFrames / 3)) && (thisObject.localWaitingFrames > 0)) && (thisObject.onYellow._currentframe == 2)) {
thisObject.onYellow.gotoAndPlay("justFalling");
} else if (thisObject.localWaitingFrames == 0) {
thisObject.freedom(thisObject.onYellow);
_root.drop_sound.start(0, 1);
thisObject.numbOfBottlesInLevel--;
thisObject.onYellow = null;
thisObject.localWaitingFrames = null;
thisObject.motionUp();
}
}
};
}
function freedom(bottle_mc) {
if (isPause) {
return(undefined);
}
var steps = 0;
var place_mc = null;
var i = bottle_mc.Y;
while (i >= 1) {
place_mc = eval ((("_root.field_mc.place_X" + bottle_mc.X) + "Y") + i);
if (place_mc.bottle == "none") {
steps++;
} else {
break;
}
i--;
}
singleFalling(bottle_mc, steps);
}
function singleFalling(bottle_mc, steps) {
var lastPlace_mc = null;
var thisObject = this;
if ((steps == 0) && (bottle_mc.Y < YSteps)) {
_root.fall_sound.start(0, 1);
lastPlace_mc = eval ((("_root.field_mc.place_X" + bottle_mc.X) + "Y") + (bottle_mc.Y - steps));
bottle_mc._y = lastPlace_mc._y + ((lastPlace_mc._height - bottle_mc.Height) / 2);
lastPlace_mc.bottleType = bottle_mc.Type;
searchAndDissapear(bottle_mc);
return(undefined);
}
if ((steps == 0) && (bottle_mc.Y == YSteps)) {
isPause = true;
delete _root.yellow_mc.onMouseMove;
gameOver = true;
} else if (steps != 0) {
lastPlace_mc = eval ((("_root.field_mc.place_X" + bottle_mc.X) + "Y") + ((bottle_mc.Y - steps) + 1));
}
lastPlace_mc.bottle = bottle_mc;
bottle_mc.Y = (bottle_mc.Y - steps) + 1;
bottle_mc.onEnterFrame = function () {
if (thisObject.isPause) {
return(undefined);
}
this._y = this._y + thisObject.Ddown;
if ((lastPlace_mc._y - this._y) < 0) {
thisObject.freedom(this);
delete this.onEnterFrame;
}
};
}
function falling(bottle_mc, steps) {
_root.fall_sound.start(0, 1);
var lastPlace_mc = null;
var firstPlace_mc = null;
var thisObject = this;
numbOfMovingDownBottles++;
firstPlace_mc = eval ((("_root.field_mc.place_X" + bottle_mc.X) + "Y") + bottle_mc.Y);
lastPlace_mc = eval ((("_root.field_mc.place_X" + bottle_mc.X) + "Y") + (bottle_mc.Y - steps));
firstPlace_mc.bottle = "none";
firstPlace_mc.bottleType = 0;
lastPlace_mc.bottle = bottle_mc;
bottle_mc.Y = bottle_mc.Y - steps;
bottle_mc.onEnterFrame = function () {
var _local2 = lastPlace_mc;
if (thisObject.isPause) {
return(undefined);
}
this._y = this._y + thisObject.Ddown;
if ((_local2._y - this._y) < 0) {
this._y = _local2._y + ((this.Height - _local2._height) / 2);
_local2.bottleType = this.Type;
thisObject.numbOfMovingDownBottles--;
delete this.onEnterFrame;
}
};
}
function searchAndDissapear(bottle_mc) {
var searchPlace_mc = eval ((("_root.field_mc.place_X" + bottle_mc.X) + "Y") + bottle_mc.Y);
var searchBottle_mc = null;
var searchStr = "";
var curType = bottle_mc.Type;
var searchArr = new Array();
searchArr.push(searchPlace_mc.bottle);
var j = 0;
while (j < searchArr.length) {
searchPlace_mc = eval ((("_root.field_mc.place_X" + searchArr[j].X) + "Y") + searchArr[j].Y);
searchStr = searchStr + ((" " + searchArr[j]) + " ");
var i = 1;
while (i <= 4) {
switch (i) {
case 1 :
searchPlace_mc = eval ((("_root.field_mc.place_X" + (searchArr[j].X + 1)) + "Y") + searchArr[j].Y);
if (((searchPlace_mc.bottle != "none") && (searchPlace_mc.bottle != undefined)) && (searchPlace_mc.bottleType == curType)) {
if (searchStr.indexOf((" " + searchPlace_mc.bottle) + " ", 0) == -1) {
searchArr.push(searchPlace_mc.bottle);
}
}
break;
case 2 :
searchPlace_mc = eval ((("_root.field_mc.place_X" + searchArr[j].X) + "Y") + (searchArr[j].Y + 1));
if (((searchPlace_mc.bottle != "none") && (searchPlace_mc.bottle != undefined)) && (searchPlace_mc.bottleType == curType)) {
if (searchStr.indexOf((" " + searchPlace_mc.bottle) + " ", 0) == -1) {
searchArr.push(searchPlace_mc.bottle);
}
}
break;
case 3 :
searchPlace_mc = eval ((("_root.field_mc.place_X" + (searchArr[j].X - 1)) + "Y") + searchArr[j].Y);
if (((searchPlace_mc.bottle != "none") && (searchPlace_mc.bottle != undefined)) && (searchPlace_mc.bottleType == curType)) {
if (searchStr.indexOf((" " + searchPlace_mc.bottle) + " ", 0) == -1) {
searchArr.push(searchPlace_mc.bottle);
}
}
break;
case 4 :
searchPlace_mc = eval ((("_root.field_mc.place_X" + searchArr[j].X) + "Y") + (searchArr[j].Y - 1));
if (!(((searchPlace_mc.bottle != "none") && (searchPlace_mc.bottle != undefined)) && (searchPlace_mc.bottleType == curType))) {
break;
}
if (searchStr.indexOf((" " + searchPlace_mc.bottle) + " ", 0) != -1) {
break;
}
searchArr.push(searchPlace_mc.bottle);
}
i++;
}
j++;
}
if (searchArr.length >= 3) {
_root.break_sound.start(0, 1);
if (isCombo) {
_root.combo_sound.start(0, 1);
_root.info("combo");
isCombo = false;
}
points = points + (searchArr.length * 2);
var minX = Infinity;
var maxX = (-Infinity);
var minY = Infinity;
var i = 0;
while (i < searchArr.length) {
minX = Math.min(minX, searchArr[i].X);
maxX = Math.max(maxX, searchArr[i].X);
minY = Math.min(minY, searchArr[i].Y);
i++;
}
var i = 0;
while (i < searchArr.length) {
searchPlace_mc = eval ((("_root.field_mc.place_X" + searchArr[i].X) + "Y") + searchArr[i].Y);
searchPlace_mc.bottle = "none";
searchPlace_mc.bottleType = 0;
searchArr[i].gotoAndPlay("disappear");
i++;
}
var steps = 0;
var plusArr = new Array();
var j = minY;
while (j <= (YSteps - 1)) {
var i = minX;
while (i <= maxX) {
searchPlace_mc = eval ((("_root.field_mc.place_X" + i) + "Y") + j);
if (searchPlace_mc.bottle == "none") {
steps = 0;
var k = j;
while (k <= YSteps) {
searchPlace_mc = eval ((("_root.field_mc.place_X" + i) + "Y") + k);
if (searchPlace_mc.bottle != "none") {
plusArr.push(searchPlace_mc.bottle);
falling(searchPlace_mc.bottle, steps);
break;
}
steps++;
k++;
}
}
i++;
}
j++;
}
isCombo = false;
if (plusArr.length > 0) {
var thisObject = this;
_root.createEmptyMovieClip("waitingOfPlus_mc", _root.getNextHighestDepth());
_root.waitingOfPlus_mc.onEnterFrame = function () {
if (thisObject.numbOfMovingDownBottles == 0) {
var _local2 = 0;
while (_local2 < plusArr.length) {
if (plusArr[_local2] != undefined) {
thisObject.isCombo = true;
thisObject.searchAndDissapear(plusArr[_local2]);
}
_local2++;
}
this.removeMovieClip();
}
};
}
}
isCombo = false;
}
function motionFast(isFast) {
if (isFast) {
DDup = (DDleft = DD);
} else {
DDup = (DDleft = 0);
}
}
function getLocalWaitingFrames() {
return(localWaitingFrames);
}
function setLocalWaitingFrames(_Numb) {
localWaitingFrames = _Numb;
}
function getNumbOfBottles() {
return(numbOfBottles);
}
function setNumbOfBottles(_Numb) {
numbOfBottles = _Numb;
}
function getLevel() {
return(level);
}
function setLevel(_Level) {
destructor();
level = _Level;
}
function getPause() {
return(isPause);
}
function setPause(_Pause) {
isPause = _Pause;
}
function getGameOver() {
return(gameOver);
}
function getPoints() {
return(points);
}
function getNumbOfBottlesInLevel() {
return(numbOfBottlesInLevel);
}
function setNumbOfBottlesInLevel(_Numb) {
if (_Numb == undefined) {
numbOfBottlesInLevel = 50 + ((level - 1) * 10);
} else {
numbOfBottlesInLevel = _Numb;
}
}
function destructor() {
_root.field_mc.swapDepths(474747);
_root.field_mc.removeMovieClip();
_root.yellow_mc.swapDepths(474747);
_root.yellow_mc.removeMovieClip();
_root.goNew_mc.swapDepths(474747);
_root.goNew_mc.removeMovieClip();
_root.waitingOfFalling_mc.swapDepths(474747);
_root.waitingOfFalling_mc.removeMovieClip();
_root.waitingOfPlus_mc.swapDepths(474747);
_root.waitingOfFalling_mc.removeMovieClip();
}
var fps = 24;
var XSteps = null;
var YSteps = null;
var Xstep = null;
var Ystep = null;
var x = null;
var y = null;
var alpha = null;
var numbOfBottles = null;
var newID = 0;
var numbOfStrings = null;
var level = 1;
var points = 0;
var numbOfBottlesInLevel = 50 + ((Field.prototype.level - 1) * 10);
var isPause = false;
var gameOver = false;
var Dup = 8;
var DDup = 0;
var Dleft = 8;
var DDleft = 0;
var DD = 7;
var Ddown = 13;
var waitingFrames = Field.prototype.fps * 3;
var localWaitingFrames = null;
var numbOfMovingUpBottles = 0;
var numbOfMovingDownBottles = 0;
var onYellow = null;
var isCombo = false;
}
Symbol 88 MovieClip Frame 1
stop();
Symbol 104 MovieClip Frame 18
stop();
Symbol 109 MovieClip [b1] Frame 1
stop();
Symbol 109 MovieClip [b1] Frame 2
stop();
Symbol 109 MovieClip [b1] Frame 26
gotoAndStop (2);
Symbol 109 MovieClip [b1] Frame 32
this.swapDepths(474747);
this.removeMovieClip();
Symbol 113 MovieClip [b2] Frame 1
stop();
Symbol 113 MovieClip [b2] Frame 2
stop();
Symbol 113 MovieClip [b2] Frame 26
gotoAndStop (2);
Symbol 113 MovieClip [b2] Frame 32
this.swapDepths(474747);
this.removeMovieClip();
Symbol 117 MovieClip [b3] Frame 1
stop();
Symbol 117 MovieClip [b3] Frame 2
stop();
Symbol 117 MovieClip [b3] Frame 26
gotoAndStop (2);
Symbol 117 MovieClip [b3] Frame 32
this.swapDepths(474747);
this.removeMovieClip();
Symbol 121 MovieClip [b4] Frame 1
stop();
Symbol 121 MovieClip [b4] Frame 2
stop();
Symbol 121 MovieClip [b4] Frame 26
stop();
Symbol 121 MovieClip [b4] Frame 32
this.swapDepths(474747);
this.removeMovieClip();
Symbol 125 MovieClip [b5] Frame 1
stop();
Symbol 125 MovieClip [b5] Frame 2
stop();
Symbol 125 MovieClip [b5] Frame 26
gotoAndStop (2);
Symbol 125 MovieClip [b5] Frame 32
this.swapDepths(474747);
this.removeMovieClip();
Symbol 129 MovieClip [b6] Frame 1
stop();
Symbol 129 MovieClip [b6] Frame 2
stop();
Symbol 129 MovieClip [b6] Frame 26
gotoAndStop (2);
Symbol 129 MovieClip [b6] Frame 32
this.swapDepths(474747);
this.removeMovieClip();
Symbol 133 MovieClip [b7] Frame 1
stop();
Symbol 133 MovieClip [b7] Frame 2
stop();
Symbol 133 MovieClip [b7] Frame 26
gotoAndStop (2);
Symbol 133 MovieClip [b7] Frame 32
this.swapDepths(474747);
this.removeMovieClip();
Symbol 137 MovieClip [b8] Frame 1
stop();
Symbol 137 MovieClip [b8] Frame 2
stop();
Symbol 137 MovieClip [b8] Frame 26
gotoAndStop (2);
Symbol 137 MovieClip [b8] Frame 32
this.swapDepths(474747);
this.removeMovieClip();
Symbol 141 MovieClip [b9] Frame 1
stop();
Symbol 141 MovieClip [b9] Frame 2
stop();
Symbol 141 MovieClip [b9] Frame 26
gotoAndStop (2);
Symbol 141 MovieClip [b9] Frame 32
this.swapDepths(474747);
this.removeMovieClip();
Symbol 142 MovieClip Frame 1
stop();
Symbol 166 MovieClip Frame 1
stop();
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 65
stop();
Symbol 166 MovieClip Frame 66
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 130
stop();
Symbol 166 MovieClip Frame 131
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 195
stop();
Symbol 166 MovieClip Frame 196
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 260
stop();
Symbol 166 MovieClip Frame 261
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 325
stop();
Symbol 166 MovieClip Frame 326
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 390
stop();
Symbol 166 MovieClip Frame 391
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 455
stop();
Symbol 166 MovieClip Frame 456
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 520
stop();
Symbol 166 MovieClip Frame 521
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 585
stop();
Symbol 166 MovieClip Frame 586
_root.go_sound.start(0, 1);
Symbol 166 MovieClip Frame 650
stop();
Symbol 166 MovieClip Frame 651
_root.completed_sound.start(0, 1);
Symbol 166 MovieClip Frame 660
stop();
Symbol 166 MovieClip Frame 661
_root.gameOver_sound.start(0, 1);
Symbol 166 MovieClip Frame 670
stop();
Symbol 166 MovieClip Frame 671
_root.completed_sound.start(0, 1);
Instance of Symbol 163 MovieClip in Symbol 166 MovieClip Frame 671
on (release) {
getURL ("http://www.justfreegames.com");
}
Symbol 166 MovieClip Frame 680
stop();
Symbol 166 MovieClip Frame 681
stop();
Symbol 166 MovieClip Frame 698
stop();