Frame 1
stop();
onEnterFrame = function () {
if ((_framesloaded == _totalframes) && (getBytesLoaded() == getBytesTotal())) {
gotoAndStop (3);
}
};
Frame 3
function newgame() {
gamestarted = 1;
dropdelayreset = 60;
combcolorlist = [16711680, 65280, 255];
extendedcolorlist = [26163, 13158, 3368448, 3342438, 6684723, 6697728, 16711935, 65535, 16776960];
score = 0;
newcombdelay = 60;
var combpos = 0;
while (combpos < totalcombs) {
eval ("comb" + combpos).setcolors(0, 0, 0);
combpos++;
}
var combpos = 0;
while (combpos < 14) {
do {
newcolors = [];
newcolors.push(combcolorlist[Math.floor(Math.random() * combcolorlist.length)]);
newcolors.push(combcolorlist[Math.floor(Math.random() * combcolorlist.length)]);
newcolors.push(combcolorlist[Math.floor(Math.random() * combcolorlist.length)]);
} while ((newcolors[0] == newcolors[1]) && (newcolors[2] == newcolors[1]));
eval ("comb" + combpos).setcolors(newcolors[0], newcolors[1], newcolors[2]);
combpos++;
}
}
function losegame() {
gamestarted = 0;
if (!endgamescreen) {
var _local2 = new Sound();
_local2.attachSound("gamelosssound");
_local2.start();
attachMovie("endgamescreen", "endgamescreen", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2});
endgamescreen.bghit.onPress = function () {
endgamescreen.swapDepths(1048575);
endgamescreen.removeMovieClip();
};
} else {
endgamescreen.removeMovieClip();
}
}
function addpoints(points) {
score = score + points;
if (score > topscore) {
topscore = score;
}
}
function showaddedpoints(startx, starty, points) {
attachMovie("shownpoints", "shownpoints" + (++objectcount), this.getNextHighestDepth(), {_x:startx, _y:starty, inpoints:points});
eval ("shownpoints" + objectcount).onEnterFrame = function () {
eval (this._name)._y = eval (this._name)._y - 1;
eval (this._name)._alpha = eval (this._name)._alpha - 3;
if (eval (this._name)._alpha <= 0) {
eval (this._name).removeMovieClip();
}
};
}
function showtricomb(currentcomb) {
attachMovie("tricomb", "tricomb" + (++objectcount), this.getNextHighestDepth(), {_x:eval ("comb" + currentcomb)._x, _y:eval ("comb" + currentcomb)._y, tricolor:eval ("comb" + currentcomb).combcolors[2]});
}
function showmegacomb(currentcomb) {
attachMovie("tricomb", "tricomb" + (++objectcount), this.getNextHighestDepth(), {_x:eval ("comb" + currentcomb)._x, _y:eval ("comb" + currentcomb)._y - 25, tricolor:eval ("comb" + currentcomb).combcolors[2]});
attachMovie("megacomb", "megacomb" + (++objectcount), this.getNextHighestDepth(), {_x:210, _y:200});
}
function showhelp() {
if (!aboutmenu) {
attachMovie("aboutmenu", "aboutmenu", this.getNextHighestDepth(), {_x:Stage.width / 2, _y:Stage.height / 2});
aboutmenu.bghit.onPress = function () {
aboutmenu.swapDepths(1048575);
aboutmenu.removeMovieClip();
};
} else {
aboutmenu.removeMovieClip();
}
}
stop();
var totalcombs = 63;
dropdelayreset = 60;
var objectcount = 0;
pointsthisframe = 0;
pointslastframe = 0;
var combcolorlist = [16711680, 65280, 255];
var extendedcolorlist = [26163, 13158, 3368448, 3342438, 6684723, 6697728, 16711935, 65535, 16776960];
gamestarted = 0;
var combpos = 0;
while (combpos < totalcombs) {
attachMovie("comb", "comb" + combpos, this.getNextHighestDepth());
eval ("comb" + combpos)._x = (37.5 + ((combpos % 7) * 50)) + (25 * Math.floor((combpos % 14) / 7));
eval ("comb" + combpos)._y = 350 - (37.5 * Math.floor(combpos / 7));
eval ("comb" + combpos).pos = combpos;
combpos++;
}
onEnterFrame = function () {
var combpos = 0;
while (combpos < totalcombs) {
if (((eval ("comb" + combpos).combcolors[0] != 0) && (eval ("comb" + combpos).combcolors[0] == eval ("comb" + combpos).combcolors[1])) && (eval ("comb" + combpos).combcolors[1] == eval ("comb" + combpos).combcolors[2])) {
addpoints((combcolorlist.length * 2) + (combcolorlist.length * (pointsthisframe + pointslastframe)));
showmegacomb(combpos);
var megacombsound = new Sound();
megacombsound.attachSound("megacombsound");
megacombsound.start();
showaddedpoints(eval ("comb" + combpos)._x, eval ("comb" + combpos)._y, (combcolorlist.length * 2) + (combcolorlist.length * (pointsthisframe + pointslastframe)));
pointsthisframe++;
eval ("comb" + combpos).setcolors(0, 0, 0);
var filledcombarray = [];
var filledcombcolors = [];
var shufflepos = 0;
while (shufflepos < totalcombs) {
if (eval ("comb" + shufflepos).combcolors[0] != 0) {
filledcombarray.push(shufflepos);
filledcombcolors.push([eval ("comb" + shufflepos).combcolors[0], eval ("comb" + shufflepos).combcolors[1], eval ("comb" + shufflepos).combcolors[2]]);
}
shufflepos++;
}
filledcombarray.shuffle();
var shufflepos = 0;
while (shufflepos < filledcombarray.length) {
eval ("comb" + filledcombarray[shufflepos]).setcolors(filledcombcolors[shufflepos][0], filledcombcolors[shufflepos][1], filledcombcolors[shufflepos][2]);
shufflepos++;
}
}
if ((eval ("comb" + combpos).combcolors[2] != 0) && (combpos > 6)) {
if (((combpos % 14) == 13) || ((combpos % 14) == 0)) {
} else if ((eval ("comb" + combpos).combcolors[2] == eval ("comb" + ((combpos - 7) - Math.floor(((combpos + 7) % 14) / 7))).combcolors[1]) && (eval ("comb" + combpos).combcolors[2] == eval ("comb" + ((combpos - 6) - Math.floor(((combpos + 7) % 14) / 7))).combcolors[0])) {
eval ("comb" + ((combpos - 7) - Math.floor(((combpos + 7) % 14) / 7))).setcolors(eval ("comb" + ((combpos - 7) - Math.floor(((combpos + 7) % 14) / 7))).combcolors[0], eval ("comb" + combpos).combcolors[0], eval ("comb" + ((combpos - 7) - Math.floor(((combpos + 7) % 14) / 7))).combcolors[2]);
eval ("comb" + ((combpos - 6) - Math.floor(((combpos + 7) % 14) / 7))).setcolors(eval ("comb" + combpos).combcolors[1], eval ("comb" + ((combpos - 6) - Math.floor(((combpos + 7) % 14) / 7))).combcolors[1], eval ("comb" + ((combpos - 6) - Math.floor(((combpos + 7) % 14) / 7))).combcolors[2]);
addpoints(combcolorlist.length + (combcolorlist.length * (pointsthisframe + pointslastframe)));
showtricomb(combpos);
var tricombsound = new Sound();
tricombsound.attachSound("tricombsound");
tricombsound.start();
showaddedpoints(eval ("comb" + combpos)._x, eval ("comb" + combpos)._y + 25, combcolorlist.length + (combcolorlist.length * (pointsthisframe + pointslastframe)));
pointsthisframe++;
eval ("comb" + combpos).setcolors(0, 0, 0);
}
}
if (eval ("comb" + combpos).combcolors[2] == 0) {
if (((combpos + 8) < totalcombs) && ((eval ("comb" + ((combpos + 6) + Math.floor((combpos % 14) / 7))).combcolors[0] != 0) || (eval ("comb" + ((combpos + 7) + Math.floor((combpos % 14) / 7))).combcolors[0] != 0))) {
if (((combpos % 14) == 0) || ((combpos % 14) == 13)) {
if (eval ("comb" + (combpos + 7)).combcolors[0] != 0) {
eval ("comb" + combpos).setcolors(eval ("comb" + (combpos + 7)).combcolors[0], eval ("comb" + (combpos + 7)).combcolors[1], eval ("comb" + (combpos + 7)).combcolors[2]);
eval ("comb" + (combpos + 7)).setcolors(0, 0, 0);
}
} else if ((eval ("comb" + ((combpos + 6) + Math.floor((combpos % 14) / 7))).combcolors[0] != 0) && (eval ("comb" + ((combpos + 7) + Math.floor((combpos % 14) / 7))).combcolors[0] != 0)) {
leftorright = Math.floor(Math.random() * 2);
eval ("comb" + combpos).setcolors(eval ("comb" + (((combpos + 6) + leftorright) + Math.floor((combpos % 14) / 7))).combcolors[0], eval ("comb" + (((combpos + 6) + leftorright) + Math.floor((combpos % 14) / 7))).combcolors[1], eval ("comb" + (((combpos + 6) + leftorright) + Math.floor((combpos % 14) / 7))).combcolors[2]);
eval ("comb" + (((combpos + 6) + leftorright) + Math.floor((combpos % 14) / 7))).setcolors(0, 0, 0);
} else if (eval ("comb" + ((combpos + 6) + Math.floor((combpos % 14) / 7))).combcolors[0] != 0) {
eval ("comb" + combpos).setcolors(eval ("comb" + ((combpos + 6) + Math.floor((combpos % 14) / 7))).combcolors[0], eval ("comb" + ((combpos + 6) + Math.floor((combpos % 14) / 7))).combcolors[1], eval ("comb" + ((combpos + 6) + Math.floor((combpos % 14) / 7))).combcolors[2]);
eval ("comb" + ((combpos + 6) + Math.floor((combpos % 14) / 7))).setcolors(0, 0, 0);
} else {
moveover = 0;
if (((combpos % 14) == 6) || ((combpos % 14) == 13)) {
moveover = 0;
} else if (eval ("comb" + (combpos + 1)).combcolors[0] == 0) {
moveover = Math.floor(Math.random() * 2);
}
eval ("comb" + (combpos + moveover)).setcolors(eval ("comb" + ((combpos + 7) + Math.floor((combpos % 14) / 7))).combcolors[0], eval ("comb" + ((combpos + 7) + Math.floor((combpos % 14) / 7))).combcolors[1], eval ("comb" + ((combpos + 7) + Math.floor((combpos % 14) / 7))).combcolors[2]);
eval ("comb" + ((combpos + 7) + Math.floor((combpos % 14) / 7))).setcolors(0, 0, 0);
}
}
}
combpos++;
}
if (gamestarted) {
newcombdelay--;
if (newcombdelay <= 0) {
var newcombsound = new Sound();
newcombsound.attachSound("newcombsound");
newcombsound.start();
dropdelayreset = dropdelayreset - 0.5;
if (dropdelayreset < 30) {
if (extendedcolorlist.length != 0) {
combcolorlist.push(extendedcolorlist.pop());
}
dropdelayreset = 60;
}
newcombdelay = dropdelayreset;
do {
newcolors = [];
newcolors.push(combcolorlist[Math.floor(Math.random() * combcolorlist.length)]);
newcolors.push(combcolorlist[Math.floor(Math.random() * combcolorlist.length)]);
newcolors.push(combcolorlist[Math.floor(Math.random() * combcolorlist.length)]);
} while ((newcolors[0] == newcolors[1]) && (newcolors[2] == newcolors[1]));
newcombpos = (totalcombs - 1) - Math.floor(Math.random() * 7);
if (eval ("comb" + newcombpos).combcolors[0] != 0) {
losegame();
}
eval ("comb" + newcombpos).setcolors(newcolors[0], newcolors[1], newcolors[2]);
}
}
if (pointsthisframe > 0) {
pointslastframe = pointslastframe + pointsthisframe;
} else {
pointslastframe = 0;
}
if (pointslastframe > 1) {
if (combotext) {
combotext.removeMovieClip();
}
attachMovie("combotext", "combotext", this.getNextHighestDepth(), {_x:180, _y:220, inpoints:pointslastframe});
combotext.onEnterFrame = function () {
eval (this._name)._alpha = eval (this._name)._alpha - 3;
if (eval (this._name)._alpha <= 0) {
eval (this._name).removeMovieClip();
}
};
}
pointsthisframe = 0;
};
Array.prototype.shuffle = function () {
i = 0;
while (i < this.length) {
var _local3 = this[i];
var _local2 = random(this.length);
this[i] = this[_local2];
this[_local2] = _local3;
i++;
}
};
Symbol 8 MovieClip [combotext] Frame 1
points = inpoints;
Symbol 11 MovieClip [shownpoints] Frame 1
points = inpoints;
Symbol 14 MovieClip [tricomb] Frame 1
var tricolortransform = new Color("tricombcolor");
tricolortransform.setRGB(tricolor);
var color = tricolor;
var alpha = 1;
var glowsize = 5;
var strength = 2;
var filter = (new flash.filters.GlowFilter(color, alpha, glowsize, glowsize, strength, 2, false, false));
tricombcolor.filters = [filter];
onEnterFrame = function () {
_alpha = (_alpha - 5);
if (_alpha <= 0) {
this.removeMovieClip();
}
glowsize = glowsize + 2;
var _local2 = new flash.filters.GlowFilter(color, alpha, glowsize, glowsize, strength, 2, false, false);
tricombcolor.filters = [_local2];
};
Symbol 23 MovieClip [highscorealert] Frame 1
stop();
Symbol 23 MovieClip [highscorealert] Frame 2
stop();
Symbol 24 MovieClip [endgamescreen] Frame 1
gamescore = _parent.score;
if (gamescore >= _parent.topscore) {
highscorealert.gotoAndStop(2);
}
Symbol 39 MovieClip [comb] Frame 1
function rotatecolors() {
tempcolorholder = combcolors[2];
combcolors[2] = combcolors[1];
combcolors[1] = combcolors[0];
combcolors[0] = tempcolorholder;
refreshcolors();
}
function refreshcolors() {
var _local1 = new Color(combleft);
_local1.setRGB(combcolors[0]);
_local1 = new Color(combright);
_local1.setRGB(combcolors[1]);
_local1 = new Color(combbottom);
_local1.setRGB(combcolors[2]);
}
function setcolors(color0, color1, color2) {
combcolors[0] = color0;
combcolors[1] = color1;
combcolors[2] = color2;
refreshcolors();
}
var combcolors = [0, 0, 0];
onPress = function () {
if (_parent.gamestarted) {
rotatecolors();
}
};
Symbol 41 MovieClip [megacomb] Frame 30
this.removeMovieClip();
Symbol 62 Button
on (press) {
newgame();
}
Symbol 64 Button
on (press) {
showhelp();
}
Symbol 70 Button
on (press) {
getURL ("http://www.swfspot.com", "_blank");
}