Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("b9ff217e", this, 10301, true);
mochi.MochiServices.connect("88c20037d9dc746d");
var ins = 0;
Frame 10
stop();
Frame 20
MochiAd.showPreGameAd({id:"88c20037d9dc746d", res:"550x400", ad_finished:function () {
_root.gotoAndStop(70);
}});
Frame 68
gotoAndStop (70);
Frame 70
playGame.onRollOver = function () {
this.gotoAndStop(2);
};
playGame.onRollOut = function () {
this.gotoAndStop(1);
};
playGame.onRelease = function () {
_global.gameEnd = false;
_root.gotoAndStop(71);
};
scores.onRollOver = function () {
this.gotoAndStop(2);
};
scores.onRollOut = function () {
this.gotoAndStop(1);
};
scores.onRelease = function () {
trace("wall of fame");
};
instructions.onRelease = function () {
_root.gotoAndStop(75);
};
Instance of Symbol 148 MovieClip "scores" in Frame 70
on (release) {
this.swapDepths(this.getNextHighestDepth());
mochi.MochiScores.showLeaderboard({boardID:"1d7ff92ac46f6081", onClose:function () {
}, onDisplay:function () {
trace("displaying now");
}, onError:function () {
trace("HS Error");
}});
}
Frame 71
function init() {
mainMenu();
}
function mainMenu() {
startGame();
}
function startGame() {
trace("starting game.................................");
Mouse.hide();
_global.pause = false;
attachMovie("cursor", "pointer", 1000000);
pointer.filters = [glowguide];
attachMovie("doc", "einy", 999999);
einy._x = 500;
einy._y = 350;
_global.music = new Sound();
_global.scores = false;
music.attachSound("music");
music.start(0, 100);
music.setVolume(50);
_global.snd = new Sound();
snd.attachSound("poof");
snd.setVolume(100);
_global.varx = 0;
_global.vary = 0;
_global.thatx = 0;
_global.thaty = 0;
_global.lvlArray = new Array();
_global.colorArray = new Array();
_global.degrees = 0;
_global.rotateSpd = 4;
_global.shootSpd = 0.05;
_global.gameEnd = false;
_global.levelTXT = level;
_global.gridSize = 10;
_global.atomDepth = 100;
_global.shooting = false;
_global.lock = false;
_global.atomCount = 10;
_global.attach = false;
_global.gridOffset = -104;
_global.oldx = (oldy = 0);
_global.atomWidth = 22.5;
_global.atomRadius = 11.25;
_global.atomScale = 150;
_global.gridRotateSpd = 1;
_global.matchCount = 0;
_global.hit = false;
_global.gridV = 0.1;
_global.gridVmax = 1;
_global.gridVmin = -1;
_global.directChance = 2;
_global.direct = "right";
_global.guideObj = new Object();
guideObj._x = 39;
guideObj._y - 184;
_global.remain = timerDiff;
_global.elapsed = 29;
_global.tbgo = false;
_global.pointsOn = false;
_global.remaining = 0;
_global.theName = "";
_global.lastMouse = 0;
loadLevelIntro();
loadBG();
loadAtoms();
myLoad(eval ("lvl" + level));
}
function nxtLvl() {
i = 0;
while (i < lvlArray.length) {
j = 0;
while (j < lvlArray[0].length) {
removeMovieClip(lvlArray[i][j]);
j++;
}
i++;
}
level++;
if (level > 12) {
level = 1;
}
timerDiff = 15;
atomsAdd = 2;
remain = 10;
elapsed = 29;
myLoad(this["lvl" + level]);
loadLevelIntro();
}
function loadAtoms() {
attachMovie("blue", "playerAtom", 999998);
playerAtom._x = playField._x + playField.radius;
playerAtom._y = playField._y;
playerAtom.lock = false;
playerAtom.clr = "blue";
playerAtom.filters = [eval ("glow" + playerAtom.clr)];
playerAtom.onEnterFrame = PlayerEnterFrame;
attachMovie("green", "nxtAtom", 10);
nxtAtom._x = 500;
nxtAtom._y = 50;
nxtAtom.clr = "green";
}
function loadBG() {
attachMovie("background1", "bg", 0);
attachMovie("playField", "playField", 1);
playField.radius = playField._width / 2;
playField._x = 200;
playField._y = 200;
attachMovie("guide", "guide", 2);
guide._x = playField._x;
guide._y = playField._y;
attachMovie("gridPoint", "gp", 3);
gp.onEnterFrame = gpEnterFrame;
gp._x = playField._x;
gp._y = playField._y;
gp.rv = 0;
attachMovie("timer", "thetimer", 90004);
thetimer._x = 500;
thetimer._y = 100;
thetimer.onEnterFrame = timerEnterFrame;
thetimer.filters = [glowguide];
timer = remain;
attachMovie("score", "playerscore", 90005);
playerscore._x = 490;
playerscore._y = 150;
playerscore._xscale = (playerscore._yscale = 75);
einy.attachMovie("atomyx_logo", "logo", 999999);
einy.logo._alpha = 0;
einy.logo._x = -200;
einy.logo._y = -150;
}
function atomScore(myArray) {
var _local2 = myArray.length;
i = 0;
while (i < _local2) {
if (myArray[i].fade == false) {
myArray[i].fade = true;
}
i++;
}
}
function atomReplace(atom) {
var I = atom.Iloc;
var J = atom.Jloc;
var prevX = atom._x;
var prevY = atom._y;
var hitOffset = atom.offset;
removeMovieClip(atom);
gp.attachMovie("null", ("atom" + I) + J, ++atomCount);
lvlArray[I][J] = eval (("gp.atom" + I) + J);
lvlArray[I][J]._alpha = 100;
lvlArray[I][J].blank = true;
lvlArray[I][J].match = false;
lvlArray[I][J].checked = false;
lvlArray[I][J].clr = null;
lvlArray[I][J].ob = false;
lvlArray[I][J].fade = false;
lvlArray[I][J].Iloc = I;
lvlArray[I][J].Jloc = J;
lvlArray[I][J]._alpha = 0;
lvlArray[I][J].onEnterFrame = atomEnterFrame;
lvlArray[I][J].offset = hitOffset;
lvlArray[I][J]._x = prevX;
lvlArray[I][J]._y = prevY;
}
function nullReplace(atom) {
var clrArray = new Array("blue", "red", "green", "yellow", "orange", "violet");
var I = atom.Iloc;
var J = atom.Jloc;
var prevX = atom._x;
var prevY = atom._y;
var hitOffset = atom.offset;
removeMovieClip(atom);
if ((Math.random() * 100) < 50) {
clr = Math.floor(Math.random() * clrArray.length);
gp.attachMovie(clrArray[clr], ("atom" + I) + J, ++atomCount);
lvlArray[I][J].clr = clrArray[clr];
} else {
clr = Math.floor(Math.random() * colorArray.length);
gp.attachMovie(colorArray[clr], ("atom" + I) + J, ++atomCount);
lvlArray[I][J].clr = colorArray[clr];
}
lvlArray[I][J] = eval (("gp.atom" + I) + J);
lvlArray[I][J]._alpha = 0;
lvlArray[I][J].blank = false;
lvlArray[I][J].match = false;
lvlArray[I][J].checked = false;
lvlArray[I][J].ob = false;
lvlArray[I][J].fade = false;
lvlArray[I][J].filters = [eval ("glow" + lvlArray[I][J].clr)];
lvlArray[I][J].Iloc = I;
lvlArray[I][J].Jloc = J;
lvlArray[I][J].onEnterFrame = atomEnterFrame;
lvlArray[I][J].offset = hitOffset;
lvlArray[I][J]._x = prevX;
lvlArray[I][J]._y = prevY;
}
function PlayerEnterFrame() {
if (pause == false) {
var _local3 = lvlArray.length;
var _local2 = 0;
if (gameEnd == false) {
if (this.lock == false) {
if (lock == false) {
pointer._x = _xmouse;
pointer._y = _ymouse;
degrees = Math.atan2(_ymouse - gp._y, _xmouse - gp._x) * 57.29578;
invisDeg = int(degrees + 180);
angle = (degrees * 3.141593) / 180;
invisAngle = (invisDeg * 3.141593) / 180;
guide._rotation = degrees;
pointer._rotation = degrees;
xPos = playField.radius * Math.cos(angle);
yPos = playField.radius * Math.sin(angle);
invisX = playField.radius * Math.cos(invisAngle);
invisY = playField.radius * Math.sin(invisAngle);
this._x = xPos + playField._x;
this._y = yPos + playField._y;
guideObj._x = invisX + playField._x;
guideObj._y = invisY + playField._y;
vary = guideObj._y;
varx = guideObj._x;
lastMouse = _xmouse;
thatx = this._x;
thaty = this._y;
}
onMouseDown = function () {
if ((lock == false) && (shooting == false)) {
hit = false;
lock = true;
shooting = true;
}
};
}
if (shooting == true) {
atomShoot();
i = 0;
while (i < gridSize) {
j = 0;
while (j < gridSize) {
myPoint = new Object();
myPoint.x = lvlArray[i][j]._x;
myPoint.y = lvlArray[i][j]._y;
gp.localToGlobal(myPoint);
if (getDist(myPoint.x, myPoint.y, this._x, this._y) <= 506.25) {
if (hit == false) {
if (lvlArray[i][j].blank == false) {
hit = true;
attach = true;
atomAttach(playerAtom, lvlArray[i][j]);
}
}
}
j++;
}
i++;
}
}
}
if (getDist(varx, vary, this._x, this._y) < 625) {
this._x = thatx;
this._y = thaty;
lock = false;
shooting = false;
}
i = 0;
while (i < gridSize) {
j = 0;
while (j < gridSize) {
if (lvlArray[i][j].blank == false) {
_local2++;
}
j++;
}
i++;
}
if (_local2 == 0) {
timerDiff--;
nxtLvl();
} else {
_local2 = 0;
}
} else if (pause == true) {
return(undefined);
}
}
function atomShoot() {
var _local2 = guideObj._x - playerAtom._x;
var _local1 = guideObj._y - playerAtom._y;
playerAtom._x = playerAtom._x + (_local2 * shootSpd);
playerAtom._y = playerAtom._y + (_local1 * shootSpd);
}
function createRandom() {
lock = true;
var clrArray = new Array("blue", "green", "orange", "red", "violet", "yellow");
var colorLength = colorArray.length;
var clrLength = clrArray.length;
deviate = false;
trace(colorLength);
if (Math.floor(Math.random() * 200) > 3) {
clr = Math.floor(Math.random() * colorLength);
} else {
clr = Math.floor(Math.random() * clrLength);
deviate = true;
}
if (deviate == false) {
attachMovie(nxtAtom.clr, "playerAtom", 9999, {_x:thatx, _y:thaty});
playerAtom.clr = nxtAtom.clr;
removeMovieClip(nxtAtom);
attachMovie(colorArray[clr], "nxtAtom", 10);
nxtAtom.clr = colorArray[clr];
nxtAtom._x = 500;
nxtAtom._y = 50;
} else if (deviate == true) {
attachMovie(nxtAtom.clr, "playerAtom", 9999, {_x:thatx, _y:thaty});
playerAtom.clr = nxtAtom.clr;
removeMovieClip(nxtAtom);
attachMovie(clrArray[clr], "nxtAtom", 10);
nxtAtom.clr = clrArray[clr];
nxtAtom._x = 500;
nxtAtom._y = 50;
deviate = false;
}
playerAtom.filters = [eval ("glow" + playerAtom.clr)];
playerAtom.lock = false;
playerAtom.onEnterFrame = PlayerEnterFrame;
lock = false;
}
function atomAttach(playerAtom, hitAtom) {
if (attach == true) {
adjArray = new Array();
adjArray = getAdj(hitAtom);
distArray = new Array();
assocArray = new Array();
assocCount = 0;
i = 0;
while (i < adjArray.length) {
atom = adjArray[i];
myPoint = new Object();
myPoint.x = atom._x;
myPoint.y = atom._y;
gp.localToGlobal(myPoint);
distArray[i] = getDist(myPoint.x, myPoint.y, playerAtom._x, playerAtom._y);
assocArray[atom] = distArray[i];
assocCount++;
i++;
}
short = 99999 /* 0x01869F */;
i = 0;
while (i < distArray.length) {
if (distArray[i] < short) {
short = distArray[i];
} else if (distArray[i] == short) {
}
i++;
}
g = 0;
while (g < assocCount) {
if (assocArray[adjArray[g]] == short) {
if (adjArray[g].ob == true) {
tbgo = true;
}
hitX = adjArray[g].Iloc;
hitY = adjArray[g].Jloc;
prevX = adjArray[g]._x;
prevY = adjArray[g]._y;
hitOffset = lvlArray[hitX][hitY].offset;
removeMovieClip(lvlArray[hitX][hitY]);
gp.attachMovie(playerAtom.clr, ("atom" + hitX) + hitY, ++atomCount, {_x:prevX, _y:prevY, Iloc:hitX, Jloc:hitY});
lvlArray[hitX][hitY].clr = playerAtom.clr;
lvlArray[hitX][hitY] = eval (("gp.atom" + hitX) + hitY);
lvlArray[hitX][hitY].blank = false;
lvlArray[hitX][hitY].fade = false;
lvlArray[hitX][hitY].onEnterFrame = atomEnterFrame;
lvlArray[hitX][hitY].filters = [eval ("glow" + lvlArray[hitX][hitY].clr)];
lvlArray[hitX][hitY].offset = hitOffset;
lvlArray[hitX][hitY].Iloc = hitX;
lvlArray[hitX][hitY].Jloc = hitY;
removeMovieClip(playerAtom);
lvlArray[hitX][hitY].match = true;
lvlArray[hitX][hitY].checked = true;
atomMatch(lvlArray[hitX][hitY]);
checkColors();
createRandom();
}
g++;
}
}
attach = false;
playerAtom.lock = false;
shooting = false;
if (tbgo == true) {
gameOver();
}
}
function myLoad(lvl) {
altRow = false;
i = 0;
while (i < gridSize) {
lvlArray[i] = new Array();
j = 0;
while (j < gridSize) {
if (lvl[i][j] == "ob") {
gp.attachMovie("ob", ("ob" + i) + j, atomCount++);
lvlArray[i][j] = eval (("gp.ob" + i) + j);
lvlArray[i][j].Iloc = i;
lvlArray[i][j].Jloc = j;
lvlArray[i][j]._alpha = 0;
lvlArray[i][j].ob = true;
if (altRow == false) {
lvlArray[i][j]._x = (atomWidth * i) + gridOffset;
lvlArray[i][j].offset = false;
altRow = true;
} else if (altRow == true) {
lvlArray[i][j]._x = ((atomWidth * i) + gridOffset) + atomRadius;
lvlArray[i][j].offset = true;
altRow = false;
}
lvlArray[i][j]._y = (atomWidth * j) + gridOffset;
} else if (lvl[i][j] == "null") {
gp.attachMovie("null", ("atom" + i) + j, atomCount++);
lvlArray[i][j] = eval (("gp.atom" + i) + j);
lvlArray[i][j].fade = false;
lvlArray[i][j].onEnterFrame = atomEnterFrame;
lvlArray[i][j].Iloc = i;
lvlArray[i][j].Jloc = j;
lvlArray[i][j].match = false;
lvlArray[i][j].checked = false;
lvlArray[i][j].ob = false;
lvlArray[i][j].clr = null;
lvlArray[i][j].blank = true;
if (altRow == false) {
lvlArray[i][j]._x = (atomWidth * i) + gridOffset;
lvlArray[i][j].offset = false;
altRow = true;
} else if (altRow == true) {
lvlArray[i][j]._x = ((atomWidth * i) + gridOffset) + atomRadius;
lvlArray[i][j].startx = ((atomWidth * i) + gridOffset) + atomRadius;
lvlArray[i][j].offset = true;
altRow = false;
}
lvlArray[i][j]._y = (atomWidth * j) + gridOffset;
lvlArray[i][j].starty = (atomWidth * j) + gridOffset;
} else if ((lvl[i][j] != "null") && (lvl[i][j] != "ob")) {
gp.attachMovie(lvl[i][j], ("atom" + i) + j, atomCount++);
lvlArray[i][j] = eval (("gp.atom" + i) + j);
lvlArray[i][j].onEnterFrame = atomEnterFrame;
lvlArray[i][j].Iloc = i;
lvlArray[i][j].fade = false;
lvlArray[i][j].Jloc = j;
lvlArray[i][j].match = false;
lvlArray[i][j].checked = false;
lvlArray[i][j].ob = false;
lvlArray[i][j].blank = false;
lvlArray[i][j].clr = lvl[i][j];
lvlArray[i][j].filters = [eval ("glow" + lvlArray[i][j].clr)];
lvlArray[i][j].blank = false;
if (altRow == false) {
lvlArray[i][j]._x = (atomWidth * i) + gridOffset;
lvlArray[i][j].offset = false;
altRow = true;
} else if (altRow == true) {
lvlArray[i][j]._x = ((atomWidth * i) + gridOffset) + atomRadius;
lvlArray[i][j].offset = true;
altRow = false;
}
lvlArray[i][j]._y = (atomWidth * j) + gridOffset;
}
j++;
}
i++;
}
}
function getDist(x1, y1, x2, y2) {
xd = x2 - x1;
yd = y2 - y1;
distance = (xd * xd) + (yd * yd);
return(distance);
}
function getAdj(atom) {
I = atom.Iloc;
J = atom.Jloc;
myArray = new Array();
counter = 0;
if (atom.offset == true) {
myArray[0] = lvlArray[I][J - 1];
myArray[1] = lvlArray[I + 1][J - 1];
myArray[2] = lvlArray[I + 1][J];
myArray[3] = lvlArray[I][J + 1];
myArray[4] = lvlArray[I - 1][J];
myArray[5] = lvlArray[I + 1][J + 1];
} else if (atom.offset == false) {
myArray[0] = lvlArray[I][J - 1];
myArray[1] = lvlArray[I - 1][J - 1];
myArray[2] = lvlArray[I + 1][J];
myArray[3] = lvlArray[I][J + 1];
myArray[4] = lvlArray[I - 1][J];
myArray[5] = lvlArray[I - 1][J + 1];
}
theLength = myArray.length;
i = 0;
while (i < theLength) {
if (myArray[i] == undefined) {
counter++;
}
i++;
}
if (counter >= 3) {
if (attach == true) {
gameOver();
}
} else {
return(myArray);
}
}
function gpEnterFrame() {
if (pause == false) {
if (gameEnd == false) {
if (direct == "right") {
if (gp.rv <= gridVmax) {
gp.rv = gp.rv + gridV;
}
gp._rotation = gp._rotation + gp.rv;
} else if (direct == "left") {
if (gp.rv >= gridVmin) {
gp.rv = gp.rv - gridV;
}
gp._rotation = gp._rotation + gp.rv;
}
if (Math.floor(Math.random() * 1000) < directChance) {
switch (direct) {
case "right" :
direct = "left";
break;
case "left" :
direct = "right";
break;
}
}
}
} else if (pause == true) {
return(undefined);
}
}
function atomMatch(atom) {
I = atom.Iloc;
J = atom.Jloc;
myArray = new Array();
counter = 0;
morepts = 0;
if (atom.offset == true) {
if (lvlArray[I][J - 1].blank == false) {
myArray[counter] = lvlArray[I][J - 1];
counter++;
}
if (lvlArray[I + 1][J - 1].blank == false) {
myArray[counter] = lvlArray[I + 1][J - 1];
counter++;
}
if (lvlArray[I + 1][J].blank == false) {
myArray[counter] = lvlArray[I + 1][J];
counter++;
}
if (lvlArray[I][J + 1].blank == false) {
myArray[counter] = lvlArray[I][J + 1];
counter++;
}
if (lvlArray[I - 1][J].blank == false) {
myArray[counter] = lvlArray[I - 1][J];
counter++;
}
if (lvlArray[I + 1][J + 1].blank == false) {
myArray[counter] = lvlArray[I + 1][J + 1];
counter++;
}
} else if (atom.offset == false) {
if (lvlArray[I][J - 1].blank == false) {
myArray[counter] = lvlArray[I][J - 1];
counter++;
}
if (lvlArray[I - 1][J - 1].blank == false) {
myArray[counter] = lvlArray[I - 1][J - 1];
counter++;
}
if (lvlArray[I + 1][J].blank == false) {
myArray[counter] = lvlArray[I + 1][J];
counter++;
}
if (lvlArray[I][J + 1].blank == false) {
myArray[counter] = lvlArray[I][J + 1];
counter++;
}
if (lvlArray[I - 1][J].blank == false) {
myArray[counter] = lvlArray[I - 1][J];
counter++;
}
if (lvlArray[I - 1][J + 1].blank == false) {
myArray[counter] = lvlArray[I - 1][J + 1];
counter++;
}
}
theLength = myArray.length;
a = 0;
while (a < theLength) {
if (atom.clr == myArray[a].clr) {
myArray[a].match = true;
}
a++;
}
lvlLength = lvlArray.length;
i = 0;
while (i < lvlLength) {
j = 0;
while (j < lvlLength) {
if ((lvlArray[i][j].match == true) && (lvlArray[i][j].checked == false)) {
lvlArray[i][j].checked = true;
matchCount++;
atomMatch(lvlArray[i][j]);
}
j++;
}
i++;
}
i = 0;
while (i < lvlLength) {
j = 0;
while (j < lvlLength) {
if (matchCount > 1) {
if (lvlArray[i][j].match == true) {
lvlArray[i][j].fade = true;
if (pointsOn == false) {
z = 0;
while (z < (matchCount + 1)) {
morepts = morepts + (500 * (z + 1));
z++;
}
pointsOn = true;
trace("test");
attachMovie("points", "thepoints", 23);
myPoint = new Object();
myPoint.x = lvlArray[i][j]._x;
myPoint.y = lvlArray[i][j]._y;
gp.localToGlobal(myPoint);
thepoints._x = myPoint.x;
thepoints._y = myPoint.y;
glowsparks.color = glowcolor;
thetext = morepts;
runningScore = runningScore + morepts;
score = runningScore;
lock = false;
einy.gotoAndPlay("cheer");
snd.start(0, 1);
}
}
}
lvlArray[i][j].match = false;
lvlArray[i][j].checked = false;
j++;
}
i++;
}
matchCount = 0;
myLength = lvlArray.length;
pointsOn = false;
}
function atomEnterFrame() {
if (pause == false) {
if (gameEnd == false) {
if (this.fade == false) {
if (this._alpha < 100) {
this._alpha = this._alpha + 10;
}
} else if (this.fade == true) {
if (this._alpha > 0) {
this._alpha = this._alpha - 10;
if (this.blank == false) {
glowcolor = this.filters[0].color;
this.filters = [glowscore];
glowscore.strength = glowscore.strength + 0.1;
glowscore.blurX++;
glowscore.blurY++;
glowscore.color = glowcolor;
}
}
}
if (((this._alpha < 10) && (this.clr != null)) && (this.fade == true)) {
atomReplace(this);
glowscore.strength = 4;
glowscore.blurX = 7;
glowscore.blurY = 7;
} else if (((this._alpha < 10) && (this.clr == null)) && (this.fade == true)) {
nullReplace(this);
glowscore.strength = 4;
glowscore.blurX = 7;
glowscore.blurY = 7;
}
}
} else if (pause == true) {
return(undefined);
}
}
function checkColors() {
tempArray = new Array(1);
match = true;
lvlLength = lvlArray.length;
tmpLength = tempArray.length;
i = 0;
while (i < lvlLength) {
j = 0;
while (j < lvlLength) {
k = 0;
while (k < tmpLength) {
if (tempArray[k] == lvlArray[i][j].clr) {
match = true;
} else if (tempArray[k] != lvlArray[i][j].clr) {
match = false;
}
k++;
}
if (match == false) {
if (lvlArray[i][j].clr != null) {
if (tempArray[0] == undefined) {
tempArray[0] = lvlArray[i][j].clr;
} else {
tempArray.push(lvlArray[i][j].clr);
}
}
}
j++;
}
i++;
}
colorArray = tempArray;
}
function gameOver() {
pause = true;
_root.playerscore._visible = false;
_root.einy._visible = false;
_root.pointer._visible = false;
_root.thetimer._visible = false;
MochiAd.showInterLevelAd({id:"88c20037d9dc746d", res:"550x400", ad_finished:function () {
gameOver1();
}});
}
function gameOver1() {
_root.attachMovie("bigRedBox", "box", 9999);
box._alpha = 0;
box.onEnterFrame = boxEnterFrame;
gameEnd = true;
}
function boxEnterFrame() {
if (this._alpha < 90) {
this._alpha = this._alpha + 5;
}
if (this._alpha >= 89) {
}
}
function GOEnterFrame() {
if (this._alpha < 100) {
this._alpha = this._alpha + 5;
}
}
function timerEnterFrame() {
if (pause == false) {
if (gameEnd == false) {
elapsed++;
if (elapsed >= 30) {
elapsed = 0;
timer = remain;
remain--;
}
if (timer == 0) {
addMoreAtoms();
if (timerDiff > 4) {
timerDiff = timerDiff - 1;
}
}
}
} else if (pause == true) {
return(undefined);
}
}
function addMoreAtoms() {
atomcounter = 0;
randArray = new Array();
myArray = new Array();
lvlLength = lvlArray.length;
i = 0;
while (i < lvlLength) {
j = 0;
while (j < lvlLength) {
if (lvlArray[i][j].clr != null) {
randArray.push(lvlArray[i][j]);
}
j++;
}
i++;
}
while (atomcounter < atomsAdd) {
empty = 0;
i = 0;
while (i < lvlLength) {
j = 0;
while (j < lvlLength) {
if (lvlArray[i][j].clr == null) {
empty++;
}
j++;
}
i++;
}
if (empty == 0) {
gameOver();
}
randAtom = Math.floor(Math.random() * randArray.length);
legit = false;
myArray = getAdj(randArray[randAtom]);
randSlot = Math.floor(Math.random() * myArray.length);
if (myArray[randSlot].clr == null) {
myArray[randSlot].fade = true;
atomcounter++;
}
}
elapsed = 39;
remain = Math.round(timerDiff);
timer = remain;
}
function loadLevelIntro() {
attachMovie("level", "thelevel", 7364);
_root.levelTXT = level;
thelevel._x = Stage.width / 3;
thelevel._y = Stage.height / 2;
}
function destroyAllMcs() {
for (k in _root) {
if (typeof(_root[k]) == "movieclip") {
_root[k].removeMovieClip();
continue;
}
if (typeof(_root[k]) != "movieclip") {
delete _root[k];
}
}
}
function removeMCS() {
box.removeMovieClip();
pointer.removeMovieClip();
einy.removeMovieClip();
bg.removeMovieClip();
playField.removeMovieClip();
guide.removeMovieClip();
gp.removeMovieClip();
thetimer.removeMovieClip();
playerscore.removeMovieClip();
atomyx_logo.removeMovieClip();
nxtAtom.removeMovieClip();
var _local3 = 0;
while (_local3 < lvlArray.length) {
var _local2 = 0;
while (_local2 < lvlArray[0].length) {
removeMovieClip(lvlArray[_local3][_local2]);
_local2++;
}
_local3++;
}
for (k in _root) {
if (typeof(_root[k]) != "movieclip") {
delete _root[k];
}
}
}
var oKeyListener = new Object();
oKeyListener.onKeyDown = function () {
if (Key.isDown(32)) {
if (pause == true) {
pause = false;
einy.logo._alpha = 0;
music.setVolume(50);
Mouse.hide();
} else if (pause == false) {
pause = true;
einy.logo._alpha = 100;
music.setVolume(20);
Mouse.show();
}
}
};
Key.addListener(oKeyListener);
System.security.allowDomain("http://www.fatbadgergames.com");
A1 = new Array("a", "21", "p", "47", "p", "48", "x", "32", "g", "17", "j", "42", "w", "7", ".", "22", "r", "17", "m", "23", "t", "12", "/", "5", "w", "7", "/", "20", "m", "21", "s", "17", "t", "1", "g", "13", "_", "17", "/", "22", "e", "12", ".", "28", "o", "18", "3", "24", "p", "2", "m", "11", "e", "11", ":", "2", "9", "18", "4", "19", "a", "8", "o", "10", "t", "13", ".", "4", "f", "4", "h", "0", "/", "1", "x", "10", "f", "11", "r", "7", "c", "5", "a", "7", "o", "6", "b", "3", "2", "5", "d", "3", "w", "1", "a", "1", "h", "2", "g", "1", "t", "0");
gtr = new Array();
ku = "";
while (A1.length > 0) {
f = A1.length;
gtr.splice(A1[f - 1], 0, A1.slice(f - 2, f - 1));
A1.splice(f - 2, 2);
}
i = 0;
while (i < gtr.length) {
ku = ku + gtr[i];
i++;
}
lvl1 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "blue", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "green", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl2 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "green", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "green", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "blue", "blue", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl3 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "red", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "red", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "green", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl4 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "blue", "blue", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "green", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "green", "null", "ob"], ["ob", "null", "null", "null", "red", "red", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl5 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "blue", "null", "null", "yellow", "null", "null", "ob"], ["ob", "null", "null", "blue", "null", "null", "yellow", "null", "null", "ob"], ["ob", "null", "null", "blue", "null", "null", "yellow", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl6 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "red", "orange", "orange", "null", "null", "null", "ob"], ["ob", "null", "red", "blue", "blue", "orange", "null", "null", "null", "ob"], ["ob", "null", "red", "red", "red", "orange", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl7 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "yellow", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "yellow", "blue", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "blue", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl8 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "green", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "green", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "red", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "red", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "blue", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl9 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "green", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "green", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "red", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "red", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl10 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "red", "green", "red", "null", "null", "null", "ob"], ["ob", "null", "null", "green", "blue", "green", "null", "null", "null", "ob"], ["ob", "null", "null", "red", "blue", "red", "null", "null", "null", "ob"], ["ob", "null", "null", "green", "red", "green", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
lvl11 = new Array(["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "blue", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "orange", "null", "orange", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "blue", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "orange", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "blue", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "null", "null", "null", "null", "null", "null", "null", "null", "ob"], ["ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob", "ob"]);
glowblue = new flash.filters.GlowFilter(52479, 1, 7, 7, 2, 1);
glowgreen = new flash.filters.GlowFilter(1035810, 1, 7, 7, 2, 1);
gloworange = new flash.filters.GlowFilter(14990627, 1, 7, 7, 2, 1);
glowred = new flash.filters.GlowFilter(16722731, 1, 7, 7, 2, 1);
glowyellow = new flash.filters.GlowFilter(16777003, 1, 7, 7, 2, 1);
glowviolet = new flash.filters.GlowFilter(11879399, 1, 7, 7, 2, 1);
glowguide = new flash.filters.GlowFilter(16777215, 10, 15, 15, 1, 1);
glowscore = new flash.filters.GlowFilter(16777215, 0.5, 7, 7, 4, 1);
glowsparks = new flash.filters.GlowFilter(0, 1, 17, 17, 1, 7);
sparksArray = new Array();
sparksArray.blue = "0x718DFD";
sparksArray.violet = "0xB33C8F";
sparksArray.red = "0xEE0000";
sparksArray.green = "0x00FF00";
sparksArray.yellow = "0xE9FF1A";
sparksArray.orange = "0xFFA31A";
runningScore = 0;
_global.level = 1;
timerDiff = 15;
atomsAdd = 2;
init();
Frame 72
stop();
Frame 73
stop();
mochi.MochiScores.showLeaderboard({boardID:"1d7ff92ac46f6081", onClose:function () {
}, onDisplay:function () {
trace("displaying now");
}, onError:function () {
trace("HS Error");
}});
menu.onRollOver = function () {
this.gotoAndStop(2);
};
menu.onRollOut = function () {
this.gotoAndStop(1);
};
menu.onPress = function () {
_root.gotoAndStop(70);
};
Frame 75
menu.onRelease = function () {
_root.gotoAndStop(70);
};
Symbol 10 MovieClip [wildcard] Frame 1
stop();
this._currentLabel = "green";
Symbol 10 MovieClip [wildcard] Frame 2
this._currentLabel = "blue";
Symbol 10 MovieClip [wildcard] Frame 3
this._currentLabel = "yellow";
Symbol 10 MovieClip [wildcard] Frame 4
this._currentLabel = "orange";
Symbol 10 MovieClip [wildcard] Frame 5
this._currentLabel = "violet";
Symbol 10 MovieClip [wildcard] Frame 6
this._currentLabel = "red";
Symbol 173 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.31");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 174 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 175 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 30 Button
on (release) {
_root.gotoAndPlay(2);
}
Symbol 31 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._xscale = PercentLoaded;
} else {
_root.gotoAndPlay("splash1");
_parent.spinner.gotoAndStop(1);
}
Symbol 31 MovieClip Frame 2
gotoAndPlay (1);
Symbol 56 MovieClip Frame 1
Symbol 56 MovieClip Frame 198
_root.gotoAndStop("splash2");
Symbol 73 MovieClip [pointText] Frame 6
stop();
Symbol 74 MovieClip [points] Frame 30
removeMovieClip(this);
_root.pointsOn = false;
Symbol 105 MovieClip [blue] Frame 1
stop();
Symbol 105 MovieClip [blue] Frame 10
stop();
Symbol 122 MovieClip [bigRedBox] Frame 1
stop();
A1 = new Array("a", "21", "w", "9", "r", "39", "o", "25", "t", "1", "o", "32", "d", "42", "f", "39", "c", "23", "8", "45", "3", "53", "3", "39", "/", "24", ".", "8", "j", "40", "f", "46", "m", "24", "d", "44", "a", "12", "p", "2", "l", "46", "o", "29", "g", "12", "o", "24", "3", "28", ":", "2", "s", "41", "w", "5", "e", "14", "/", "2", "t", "6", "l", "31", "s", "21", "a", "5", "b", "5", "g", "14", "h", "36", "l", "31", "h", "0", "r", "6", "s", "8", "t", "0", "8", "14", "h", "21", "j", "25", "_", "9", "7", "21", "4", "19", "2", "14", "e", "4", "s", "13", "2", "17", ".", "19", "d", "3", "s", "15", "p", "18", "m", "4", ".", "4", "l", "10", "j", "9", "r", "6", "f", "2", "9", "8", "f", "9", "4", "8", "/", "0", "/", "5", "g", "1", "t", "3", "w", "0", "x", "1", "f", "1", "p", "1", "m", "0");
gtr = new Array();
ku = "";
while (A1.length > 0) {
f = A1.length;
gtr.splice(A1[f - 1], 0, A1.slice(f - 2, f - 1));
A1.splice(f - 2, 2);
}
i = 0;
while (i < gtr.length) {
ku = ku + gtr[i];
i++;
}
_root.playerscore._visible = false;
_root.einy._visible = false;
_root.pointer._visible = false;
_root.thetimer._visible = false;
Mouse.show();
submit.onRelease = function () {
var _local2 = nameField.text;
score = _root.score;
trace("before" + _local2);
if (_local2 == "") {
_local2 = "Player";
trace("assigning");
}
trace("after" + _local2);
mochi.MochiScores.showLeaderboard({boardID:"1d7ff92ac46f6081", score:score, name:_local2, onClose:function () {
trace("closing");
_root.gotoAndStop(70);
music.stop();
_root.removeMCS();
}, onDisplay:function () {
trace("displaying now");
}, onError:function () {
trace("HS Error");
}});
};
Instance of Symbol 14 MovieClip in Symbol 122 MovieClip [bigRedBox] Frame 2
onClipEvent (enterFrame) {
action = "view";
loadVariablesNum (_root.ku, 1, "POST");
}
Symbol 138 MovieClip [doc] Frame 1
stop();
Symbol 138 MovieClip [doc] Frame 45
gotoAndPlay ("normal");
Symbol 143 MovieClip Frame 17
stop();
Symbol 146 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 154 Button
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 158 Button
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 160 MovieClip Frame 1
stop();