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;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
function postMindJoltAPIConnect(success) {
trace("[MindJoltAPI] service successfully loaded");
}
_lockroot = true;
var b_Testing = false;
var s_TestURL = "";
var s_URL = (_root.b_Testing ? (_root.s_TestURL) : (_root._url));
var n_GameWidth = 550;
var n_GameHeight = 550;
_root.scrollRect = new flash.geom.Rectangle(0, 0, _root.n_GameWidth, _root.n_GameHeight);
var s_SmileyID = "5684";
var CPMStarContentSpotID = "2300Q5DE590E7";
var CPMStarContentInterlevelID = "2301QAEA28790";
var s_GameAds = "";
var d_AdvertStartTime;
var n_CPMWaitTime = 5000;
var b_Debugging = false;
__com_mochibot__("1f789965", this, 10301, true);
mochi.as2.MochiServices.connect("3bc254019d933cb2");
var kongregate = _global.kongregate;
kongregate.services.connect();
if (MindJoltAPI == undefined) {
System.security.allowDomain("static.mindjolt.com");
MindJoltAPI = createEmptyMovieClip("MindJoltAPI", getNextHighestDepth());
var apiPath = ((_level0.mjPath != undefined) ? (_level0.mjPath) : "http://static.mindjolt.com/api/as2/api_as2_local.swf");
var apiLoader = new MovieClipLoader();
var apiLoadListener = new Object();
apiLoader.addListener(apiLoadListener);
apiLoadListener.onLoadInit = function () {
MindJoltAPI.service.connect(postMindJoltAPIConnect);
};
apiLoadListener.onLoadError = function () {
trace("[MindJoltAPI] failed to load.");
};
apiLoader.loadClip(apiPath, MindJoltAPI);
}
this.KIBA_Logo._visible = false;
this.GamesGames_Logo._visible = false;
this.Smiley_Logo._visible = false;
if ((((((((((_root.s_URL.toLowerCase().indexOf("addictinggames", 0) > 0) || (_root.s_URL.toLowerCase().indexOf("smileygamer", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("static.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("kongregate", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("gamesclub.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("armorgames.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("media.jaludo.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("agame.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("freeonlinegames.com", 0) > 0)) {
if (_root.s_URL.toLowerCase().indexOf("agame.com", 0) > 0) {
this.GamesGames_Logo._visible = true;
this.GamesGames_Logo._x = 275;
}
if ((_root.s_URL.toLowerCase().indexOf("static.kaisergames.de", 0) > 0) || (_root.s_URL.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) {
this.KIBA_Logo._visible = true;
this.KIBA_Logo._x = 275;
}
if (_root.s_URL.toLowerCase().indexOf("smileygamer.com", 0) > 0) {
this.Smiley_Logo._visible = true;
this.Smiley_Logo._x = 275;
}
} else {
this.Smiley_Logo._visible = true;
this.Smiley_Logo._x = 275;
_root.d_AdvertStartTime = new Date();
System.security.allowDomain("server.cpmstar.com");
this.adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + _root.CPMStarContentSpotID);
}
this.o_Loader.gotoAndPlay(2);
stop();
Frame 2
function f_ShowIE8Problem() {
var _local2 = _root.o_MenuOverlay.o_IE8Problem;
if (_local2._name == undefined) {
_local2 = _root.o_MenuOverlay.attachMovie("IE8Problem", "o_IE8Problem", _root.getNextHighestDepth(), {_x:150, _y:180});
}
}
function f_SaveLevel() {
o_Settings.data.n_LastScore = _root.n_Score;
o_Settings.data.n_LastLevel = _root.n_Level;
o_Settings.data.o_LastPops = _root.n_Pops;
}
function f_GetLevel() {
if (o_Settings.data.n_LastLevel != undefined) {
_root.n_LastScore = o_Settings.data.n_LastScore;
_root.n_LastLevel = o_Settings.data.n_LastLevel;
if (o_Settings.data.o_LastPops != undefined) {
_root.o_LastPops = o_Settings.data.o_LastPops;
} else {
_root.o_LastPops = new Array(0, 0, 0, 0, 0, 0, 0);
}
} else {
_root.n_LastScore = 0;
_root.n_LastLevel = 1;
_root.o_LastPops = new Array(0, 0, 0, 0, 0, 0, 0);
}
}
function f_DoScores() {
_root.onEnterFrame = undefined;
_root.gotoAndPlay("HiScores");
}
function f_StartGame(b_Continue) {
_root.b_Setup = false;
_root.n_Drops = 0;
_root.f_GetLevel();
if (_root.s_GameMode == "menu") {
_root.n_Level = 1;
} else {
_root.n_Level = (b_Continue ? (_root.n_LastLevel) : 1);
}
if (b_Continue) {
if (_root.n_Level == 1) {
_root.o_Background._y = 0;
} else {
_root.o_Background._y = 150 * (_root.n_Level - 2);
}
_root.n_Score = _root.n_LastScore;
_root.n_Pops = _root.o_LastPops;
} else {
_root.o_Background._y = 0;
_root.n_Score = 0;
_root.n_Pops = new Array(0, 0, 0, 0, 0, 0, 0);
}
_root.f_BuildField(8, 2, _root.n_Level);
if (_root.n_Offset == undefined) {
_root.n_Offset = 0;
}
_root.b_Left = false;
_root.b_Right = false;
_root.n_MoveDirection = 0;
if (_root.o_MList != undefined) {
Mouse.removeListener(_root.o_MList);
_root.o_MList = undefined;
}
_root.o_MList = new Object();
_root.o_MList.onMouseDown = function () {
};
_root.o_MList.onMouseUp = function () {
if (((_root._xmouse > 100) && (_root._xmouse < (_root.n_GameWidth - 100))) && (_root.s_InputMethod == "mouse")) {
_root.b_DoDrop = true;
}
};
_root.o_MList.onMouseMove = function () {
};
Mouse.addListener(_root.o_MList);
if (_root.o_KeyList != undefined) {
Key.removeListener(_root.o_KeyList);
_root.o_KeyList = undefined;
}
_root.o_KeyList = new Object();
_root.o_KeyList.onKeyUp = function () {
if (((Key.getCode() == 80) || (Key.getCode() == 112)) && (_root.s_GameMode.toLowerCase() != "menu")) {
_root.f_TogglePause();
}
if ((Key.getCode() == 77) || (Key.getCode() == 109)) {
_root.f_ToggleSounds();
}
if (_root.s_GameMode.toLowerCase() != "menu") {
if ((Key.getCode() == 27) && (!_root.b_GameOver)) {
_root.f_ShowMessage("Quiting Game");
_root.f_DoMessages();
_root.f_EndGame(false);
}
if ((!_root.b_AnimatingDrop) && (_root.s_InputMethod == "keyboard")) {
if ((((Key.getCode() == 32) || (Key.getCode() == 40)) || (Key.getCode() == 83)) || (Key.getCode() == 115)) {
_root.b_DoDrop = true;
}
}
}
};
_root.o_KeyList.onKeyDown = function () {
};
Key.addListener(_root.o_KeyList);
_root.onEnterFrame = function () {
var _local2 = ((s_GameMode == "menu") ? (_root.n_MenuRotateMax) : (_root.n_RotateMax));
if (!_root.b_SoundsStarted) {
_root.f_PlaySound("o_Sounds", "GameMusic");
_root.b_SoundsStarted = true;
}
if (_root.b_Paused) {
_root.o_LevelContainers._visible = false;
_root.o_ToDrop.o_Graphics._visible = false;
} else {
_root.o_LevelContainers._visible = true;
if (_root.s_GameMode.toLowerCase() != "menu") {
_root.o_ToDrop.o_Graphics._visible = true;
}
if (_root.s_GameMode.toLowerCase() == "menu") {
if (((new Date().getTime() >= _root.d_MenuDropNext.getTime()) && (!_root.b_AnimatingDrop)) && (!_root.b_Animating)) {
_root.n_RotateSpeed = 0;
_root.b_Left = false;
_root.b_Right = false;
_root.b_DoDrop = true;
_root.d_MenuDropNext = new Date();
_root.d_MenuDropNext.setTime(new Date().getTime() + (_root.n_MenuDropIntervalLower + (Math.random() * (_root.n_MenuDropIntervalUpper - _root.n_MenuDropIntervalLower))));
_root.n_MenuMoveDirection = ((Math.random() > 0.5) ? 1 : -1);
} else if (_root.n_MenuMoveDirection == 1) {
_root.b_Left = true;
_root.b_Right = false;
} else if (_root.n_MenuMoveDirection == -1) {
_root.b_Left = false;
_root.b_Right = true;
}
} else if (_root.s_InputMethod == "keyboard") {
_root.b_Left = false;
_root.b_Right = false;
if ((Key.isDown(37) || (Key.isDown(65))) || (Key.isDown(97))) {
_root.b_Right = true;
} else if ((Key.isDown(39) || (Key.isDown(68))) || (Key.isDown(100))) {
_root.b_Left = true;
}
} else if (_root._xmouse > ((_root.n_GameWidth / 2) + 50)) {
_root.n_RotateSpeed = -1 * (((_root.n_GameWidth / 2) - (_root._xmouse - 50)) / 22);
} else if (_root._xmouse < ((_root.n_GameWidth / 2) - 50)) {
_root.n_RotateSpeed = ((_root._xmouse - 50) - (_root.n_GameWidth / 2)) / 22;
} else {
_root.n_RotateSpeed = 0;
}
if (_root.s_InputMethod != "mouse") {
if ((!((_root.n_RotateMin > (_root.n_BallSepDegree * -1)) && (_root.n_RotateMin < 0))) && (_root.b_Left || ((_root.n_RotateMin > 0) && (_root.n_RotateMin < _root.n_BallSepDegree)))) {
if (_root.n_RotateSpeed < 0) {
_root.n_RotateSpeed = 0;
}
_root.n_RotateSpeed = _root.n_RotateSpeed + _root.n_RotateIncrease;
if (_root.n_RotateSpeed > _local2) {
_root.n_RotateSpeed = _local2;
}
} else if ((!((_root.n_RotateMin > 0) && (_root.n_RotateMin < _root.n_BallSepDegree))) && (_root.b_Right || ((_root.n_RotateMin > (_root.n_BallSepDegree * -1)) && (_root.n_RotateMin < 0)))) {
if (_root.n_RotateSpeed > 0) {
_root.n_RotateSpeed = 0;
}
_root.n_RotateSpeed = _root.n_RotateSpeed - _root.n_RotateIncrease;
if (_root.n_RotateSpeed < (_local2 * -1)) {
_root.n_RotateSpeed = _local2 * -1;
}
} else {
_root.n_RotateMin = 0;
_root.n_RotateSpeed = 0;
}
}
if (_root.s_GameMode == "game") {
_root.o_GameOverlay.o_Progress.n_CurrentValue = _root.f_TimeDiff(_root.d_Timer, new Date());
if (_root.d_Timer.getTime() <= (new Date().getTime() - ((_root.s_GameMode == "menu") ? (_root.n_TimerIntervalMenu) : (_root.n_TimerInterval)))) {
_root.b_DoDrop = true;
}
}
if (_root.b_DoDrop) {
_root.f_StartDrop();
_root.f_ChooseNextDrop();
_root.b_DoDrop = false;
}
_root.n_Offset = _root.n_Offset + _root.n_RotateSpeed;
if (_root.n_RotateSpeed != 0) {
_root.n_RotateMin = _root.n_RotateMin + _root.n_RotateSpeed;
}
_root.f_DoGraphics();
if (_root.b_GameOver) {
if (_root.f_TimeDiff(_root.d_GameOverTimer, new Date()) >= _root.n_GameOverPause) {
if (_root.s_GameMode == "menu") {
_root.b_Setup = false;
} else {
_root.f_EndGame(false);
}
}
} else {
if (((_root.n_BallsNeeded <= 0) && (!_root.b_Animating)) && (_root.s_PlayMode != "survival")) {
_root.n_Level++;
_root.f_BuildField(8, 2, _root.n_Level);
}
_root.f_CheckGameOver();
}
}
if (_root.s_GameMode.toLowerCase() != "menu") {
_root.f_DoMessages();
}
if ((((_root.s_GameMode.toLowerCase() != "menu") && (!_root.b_InstructionsOn)) && (!_root.b_Paused)) && (_root.d_KeyLast.getTime() <= (new Date().getTime() - _root.n_KeyInterval))) {
} else if (_root.s_GameMode == "menu") {
if (!_root.b_GameOver) {
if (Math.random() <= _root.n_MenuRotateChance) {
_root.f_Rotate(Math.random() > 0.5);
}
}
}
_root.f_Shake();
if (!_root.b_GameOver) {
_root.gotoAndPlay("Game");
} else if (_root.s_GameMode == "menu") {
_root.b_GameOver = false;
_root.n_Level = 1;
_root.f_BuildField(8, 2, 1);
_root.gotoAndPlay("Game");
} else {
_root.f_EndGame(b_Won);
}
};
_root.b_Setup = true;
}
function f_EndGame(b_Win) {
var _local3 = _root.attachMovie("GameOver_Animation", "o_GameOver", _root.getNextHighestDepth(), {_x:0, _y:0});
_root.b_GameOver = true;
_local3.gotoAndPlay("GameOver_" + (b_Win ? "Win" : "Lose"));
_root.o_GameOverlay._visible = false;
_root.onEnterFrame = undefined;
this.stop();
}
function f_ColumnHeight(n_x) {
var _local3 = -1;
var _local2 = 0;
while (_local2 < _root.o_PosData[n_x].length) {
if (_root.o_PosData[n_x][_local2]._color == 0) {
if (_local3 < _local2) {
_local3 = _local2;
}
}
_local2++;
}
return(_local3);
}
function f_DrawToDrop() {
var _local15 = _root.n_Offset / 57.2957795130823;
var _local13 = _root.n_BallSepDegree / 57.2957795130823;
var _local3;
var _local6;
var _local17;
var _local16;
var _local10 = _root.o_ToDrop.o_Graphics;
var _local4;
var _local2;
var _local22 = _root.n_Level == 1;
var _local23;
var _local24;
var _local14 = 0;
var _local12 = -1;
var _local21;
var _local9;
var _local11;
var _local7 = 0;
while (_local7 < _root.o_PosData.length) {
_local6 = Math.floor(((_local13 * _local7) * 57.2957795130823) - _root.n_Offset);
if (_local6 < 0) {
_local6 = 360 - _local6;
}
_local6 = _local6 % 360;
if (_local6 > 180) {
_local6 = 360 - _local6;
}
if (_local12 == -1) {
_local14 = _local6;
_local12 = _local7;
} else if (_local14 > _local6) {
_local14 = _local6;
_local12 = _local7;
}
_local17 = _root.n_XCenter + (Math.sin((_local13 * _local7) - _local15) * _root.n_RowPerspectiveWidth);
_local16 = (Math.cos((_local13 * _local7) - _local15) * _root.n_RowPerspectiveHeight) + 70;
if (_local10["o_Ball_" + _local7.toString()]._name == undefined) {
_local3 = _local10.attachMovie("ToDrop_Ball", "o_Ball_" + _local7.toString(), _local10.getNextHighestDepth(), {_x:0, _y:n_y * _root.n_BallWidth});
} else {
_local3 = _local10["o_Ball_" + _local7.toString()];
}
_local3._x = _local17;
_local3._y = _local16;
_local3.o_Graphics.gotoAndStop("Ball_0");
_local3.o_GraphicsBottom.gotoAndStop("Ball_0");
_local3.o_Guide._visible = false;
_local3.o_Cross._visible = false;
_local7++;
}
_local21 = Math.floor(_local12 - (_root.o_DropChoice.length / 2));
_local21 = ((_local21 < 0) ? (_local21 + _root.o_PosData.length) : (_local21));
_root.o_DropData = new Array(_root.o_PosData.length);
n_o = 0;
while (n_o < _root.o_DropData.length) {
_root.o_DropData[n_o] = new Object({_color:0});
n_o++;
}
n_i = 0;
while (n_i < _root.o_DropChoice.length) {
_local9 = n_i + _local21;
if (_local9 >= _root.o_PosData.length) {
_local9 = _local9 - _root.o_PosData.length;
}
_local3 = _local10["o_Ball_" + _local9.toString()];
if (_local3._name != undefined) {
_local3.o_Graphics.gotoAndStop("Ball_" + _root.o_DropChoice[n_i]._color);
_local11 = _root.f_ColumnHeight(_local9);
_local3.o_Guide._visible = ((_root.n_RotateSpeed == 0) ? (_local11 != -1) : false);
_local3.o_GraphicsBottom._visible = _local11 != -1;
_local3.o_Cross._visible = _local11 == 0;
if (_local3.o_Guide._visible) {
_local3.o_Guide._height = (_local3.o_GraphicsBottom._y - 20) - _local3.o_Guide._y;
}
if (_local3.o_GraphicsBottom._visible) {
_local3.o_GraphicsBottom._y = ((_local11 + 1) * 40) + 30;
_local3.o_GraphicsBottom.gotoAndStop("Ball_" + _root.o_DropChoice[n_i]._color);
}
_root.o_DropData[_local9] = new Object({_color:_root.o_DropChoice[n_i]._color});
}
n_i++;
}
n_Swaps = 999;
while (n_Swaps > 0) {
n_Swaps = 0;
var _local8 = 0;
while (_local8 < _root.o_DropData.length) {
_local4 = o_Cylinder["o_BallContainer_" + _local8.toString()];
var _local5 = 0;
while (_local5 < _root.o_DropData.length) {
_local2 = o_Cylinder["o_BallContainer_" + _local5.toString()];
if (_local4._name != _local2._name) {
if ((_local4._x >= (_local2._x - 40)) && (_local4._x <= (_local2._x + 40))) {
if ((_local4._y < _local2._y) && (_local4.getDepth() > _local2.getDepth())) {
_local4.swapDepths(_local2);
n_Swaps++;
}
}
}
_local5++;
}
_local8++;
}
}
_root.n_MoveFront = _local12;
}
function f_ToggleQuality() {
var _local10 = _root.o_LevelContainers.o_ContainerPlay;
var _local3;
if (_root.s_Quality != "HIGH") {
_root.s_Quality = "HIGH";
_root._quality = "HIGH";
} else {
_root.s_Quality = "LOW";
_root._quality = "LOW";
var _local2 = 0;
while (_local2 < _root.o_PosData.length) {
_local3 = _local10["o_BallContainer_" + _local2.toString()];
_root.f_Tint(_local3, {rb:0, gb:0, bb:0, ra:100, ga:100, ba:100});
_local2++;
}
}
_root.o_MenuOverlay.o_ToggleQuality.gotoAndStop(_root.s_Quality);
_root.o_GameOverlay.o_ToggleQuality.gotoAndStop(_root.s_Quality);
}
function f_DrawCylinder(o_Cylinder) {
var _local18 = _root.n_Offset / 57.2957795130823;
var _local16 = (360 / _root.n_BallsPerRow) / 57.2957795130823;
var _local8;
var _local10;
var _local13;
var _local17;
var _local12;
var _local7;
var _local5;
var _local4;
var _local26 = _root.n_Level == 1;
var _local27;
var _local28;
var _local19 = (_root.o_PosData[0].length - 1) * _root.n_BallWidth;
if (o_Cylinder._name != undefined) {
var _local3 = 0;
while (_local3 < _root.o_PosData.length) {
_local10 = Math.floor(((_local16 * _local3) * 57.2957795130823) - _root.n_Offset);
if (_local10 < 0) {
_local10 = 360 - _local10;
}
_local10 = _local10 % 360;
if (_local10 > 180) {
_local10 = 360 - _local10;
}
_local13 = _root.n_XCenter + (Math.sin((_local16 * _local3) - _local18) * _root.n_RowPerspectiveWidth);
_local17 = _root.n_YBase + (Math.cos((_local16 * _local3) - _local18) * _root.n_RowPerspectiveHeight);
if (o_Cylinder["o_BallContainer_" + _local3.toString()]._name == undefined) {
_local7 = o_Cylinder.attachMovie("Ball_Column", "o_BallContainer_" + _local3.toString(), 180 - (_local10 + ((_local13 > _root.n_XCenter) ? 1 : 0)), {_x:_local13, _y:_local17});
} else {
_local7 = o_Cylinder["o_BallContainer_" + _local3.toString()];
_local7._x = _local13;
_local7._y = _local17;
}
if (_root.s_Quality == "HIGH") {
_local12 = 120 - (0.555555555555556 * _local10);
_root.f_Tint(_local7, {rb:0, gb:0, bb:0, ra:_local12, ga:_local12, ba:_local12});
}
var _local2 = 0;
while (_local2 < _root.o_PosData[_local3].length) {
if (_local7["o_Ball_" + _local2.toString()]._name == undefined) {
_local8 = _local7.attachMovie("Ball", "o_Ball_" + _local2.toString(), _local7.getNextHighestDepth(), {_x:0, _y:(_local2 * _root.n_BallWidth) - _local19});
if ((o_Cylinder._name == "o_ContainerLast") && (_root.o_PosData[_local3][_local2]._color == 0)) {
_local8.o_Graphics.gotoAndStop("Ball_Filler");
} else {
_local8.o_Graphics.gotoAndStop("Ball_" + _root.o_PosData[_local3][_local2]._color);
}
} else {
_local8 = _local7["o_Ball_" + _local2.toString()];
if (!_root.o_PosData[_local3][_local2]._animating) {
if ((o_Cylinder._name == "o_ContainerLast") && (_root.o_PosData[_local3][_local2]._color == 0)) {
_local8.o_Graphics.gotoAndStop("Ball_Filler");
} else {
_local8.o_Graphics.gotoAndStop("Ball_" + _root.o_PosData[_local3][_local2]._color);
}
}
}
_local2++;
}
_local3++;
}
n_Swaps = 999;
while (n_Swaps > 0) {
n_Swaps = 0;
var _local11 = 0;
while (_local11 < _root.o_PosData.length) {
_local5 = o_Cylinder["o_BallContainer_" + _local11.toString()];
var _local6 = 0;
while (_local6 < _root.o_PosData.length) {
_local4 = o_Cylinder["o_BallContainer_" + _local6.toString()];
if (_local5._name != _local4._name) {
if ((_local5._x >= (_local4._x - 40)) && (_local5._x <= (_local4._x + 40))) {
if ((_local5._y < _local4._y) && (_local5.getDepth() > _local4.getDepth())) {
_local5.swapDepths(_local4);
n_Swaps++;
}
}
}
_local6++;
}
_local11++;
}
}
}
}
function f_Tint(o_Object, o_Col) {
myColor = new Color(o_Object);
myColorTransform = new Object(o_Col);
myColor.setTransform(myColorTransform);
}
function f_GetBestScores() {
_root.o_Settings = SharedObject.getLocal("GameSettings");
_root.n_BestScoreNormal = 0;
if (o_Settings.data.n_BestScoreNormal != undefined) {
_root.n_BestScoreNormal = o_Settings.data.n_BestScoreNormal;
}
_root.n_BestScoreEasy = 0;
if (o_Settings.data.n_BestScoreEasy != undefined) {
_root.n_BestScoreEasy = o_Settings.data.n_BestScoreEasy;
}
}
function f_AnyAnimation() {
var _local4 = false;
var _local3 = 0;
while (_local3 < _root.o_PosData.length) {
var _local2 = _root.o_PosData[_local3].length;
while (_local2 > 0) {
if ((_root.o_PosData[_local3][_local2]._color == 0) && (_root.o_PosData[_local3][_local2]._animating)) {
_root.o_PosData[_local3][_local2]._animating = false;
_root.f_SetBall(_local3, 0, 0, _local2);
}
if (_root.o_PosData[_local3][_local2]._animationstart != undefined) {
if (_root.o_PosData[_local3][_local2]._animationstart.getTime() <= (new Date().getTime() - 500)) {
_root.o_PosData[_local3][_local2]._color = 0;
_root.o_PosData[_local3][_local2]._animating = false;
_root.o_PosData[_local3][_local2]._animationstart = undefined;
_root.f_SetBall(_local3, 0, 0, _local2);
}
}
if (_root.o_PosData[_local3][_local2]._animating) {
return(true);
}
_local2--;
}
_local3++;
}
_local3 = 0;
while (_local3 < _root.o_PosData.length) {
var _local2 = _root.n_GameDepth;
while (_local2 > 0) {
if ((_root.o_PosData[_local3][_local2]._color == 0) && (_root.o_PosData[_local3][_local2 - 1]._color != 0)) {
return(true);
}
_local2--;
}
_local3++;
}
return(false);
}
function f_EndPopping(o_Source) {
var _local2 = o_Source._parent._parent._name.split("_")[2];
var _local3 = o_Source._parent._name.split("_")[2];
if ((_local2 != undefined) && (_local3 != undefined)) {
_root.o_PosData[_local2][_local3]._animating = false;
_root.o_PosData[_local2][_local3]._color = 0;
_root.o_PosData[_local2][_local3]._animationstart = undefined;
}
o_Source.gotoAndStop("Ball_0");
}
function f_AnimatePop(n_Column, n_Colour, n_Y) {
var _local2 = _root.o_LevelContainers.o_ContainerPlay["o_BallContainer_" + n_Column.toString()]["o_Ball_" + n_Y.toString()];
if (!_root.o_PosData[n_Column][n_Y]._animating) {
_root.o_PosData[n_Column][n_Y]._animating = true;
_root.o_PosData[n_Column][n_Y]._animationstart = new Date();
if (n_Colour >= 0) {
_local2.o_Graphics.gotoAndPlay(("Ball_" + n_Colour.toString()) + "_Pop");
} else if (n_Colour == -1) {
_local2.o_Graphics.gotoAndPlay("Ball_Explode");
} else if (n_Colour == -2) {
_local2.o_Graphics.gotoAndPlay("EndGame");
}
}
}
function f_SetBall(n_Column, n_Colour, n_BonusTypeID, n_Y) {
var _local2;
_local2 = _root.o_LevelContainers.o_ContainerPlay["o_BallContainer_" + n_Column.toString()]["o_Ball_" + n_Y.toString()];
if (_local2._name != undefined) {
_local2.o_Graphics.gotoAndStop("Ball_" + n_Colour.toString());
}
}
function f_TryPop(n_Column, n_Y, b_Start, n_Colour) {
var _local11;
var _local13;
var _local9 = false;
var _local7 = false;
var _local8;
var _local4;
var _local12;
if (b_Start) {
_root.o_PopArray = new Array(_root.o_PosData.length);
i = 0;
while (i < _root.o_PopArray.length) {
_root.o_PopArray[i] = new Array(_root.n_GameDepth);
j = 0;
while (j < _root.o_PopArray[j].length) {
_root.o_PopArray[i][j] = false;
j++;
}
i++;
}
_root.o_PopToDo = new Array();
}
if ((((!_root.o_PopArray[n_Column][n_Y]) && (_root.o_PosData[n_Column][n_Y]._color == n_Colour)) && (!_root.o_PopArray[n_Column][n_Y]._animating)) && (_root.o_PosData[n_Column][n_Y + 1]._color != 0)) {
_root.o_PopToDo.push(new Object({n_Y:n_Y, n_Column:n_Column, n_Color:_root.o_PosData[n_Column][n_Y]._color}));
_root.o_PopArray[n_Column][n_Y] = true;
if (n_Y > 0) {
_root.f_TryPop(n_Column, Number(n_Y) - 1, false, n_Colour);
}
if (n_Y < _root.n_Height) {
_root.f_TryPop(n_Column, Number(n_Y) + 1, false, n_Colour);
}
if (n_Column == 0) {
_root.f_TryPop(_root.o_PosData.length - 1, n_Y, false, n_Colour);
} else {
_root.f_TryPop(Number(n_Column) - 1, n_Y, false, n_Colour);
}
if (n_Column == (_root.o_PosData.length - 1)) {
_root.f_TryPop(0, n_Y, false, n_Colour);
} else {
_root.f_TryPop(Number(n_Column) + 1, n_Y, false, n_Colour);
}
}
if (b_Start) {
if (o_PopToDo.length >= 3) {
_local8 = 0;
_local4 = new Array();
var i = 0;
while (i < o_PopToDo.length) {
_root.n_Pops[o_PopToDo[i].n_Color]++;
_local4.push(new Object({n_Y:o_PopToDo[i].n_Y, n_Column:o_PopToDo[i].n_Column}));
i++;
}
var i = 0;
while (i < o_PopToDo.length) {
n_Column = o_PopToDo[i].n_Column;
n_Y = o_PopToDo[i].n_Y;
_root.f_AnimatePop(n_Column, n_Colour, n_Y);
i++;
}
if (_local4.length > 0) {
if (_root.s_PlayMode != "survival") {
_root.n_BallsNeeded = _root.n_BallsNeeded - _local4.length;
if (_root.n_BallsNeeded <= 0) {
_root.n_BallsNeeded = 0;
}
}
_root.f_ShowMessage(((("(" + _local4.length) + "x) ") + (_local4.length * _root.n_ScoreBall).toString()) + " points");
_root.n_Score = _root.n_Score + Math.floor((_local4.length * _root.n_ScoreBall) * (1 + ((_local4.length - 3) * _root.n_PopMultiplier)));
}
if (_root.s_GameMode.toLowerCase() != "menu") {
_root.f_PlaySound("o_Sounds", "Pop");
}
}
}
}
function f_Randomise() {
var _local4 = _root.attachMovie("SwapEffect", "SwapEffect_" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:275, _y:275});
_local4.gotoAndPlay(1);
var _local3 = 0;
while (_local3 < _root.o_PosData.length) {
var _local2 = _root.o_PosData[_local3].length;
while (_local2 > 0) {
if ((!_root.o_PosData[_local3][_local2]._animating) && (_root.o_PosData[_local3][_local2]._color > 0)) {
_root.o_PosData[_local3][_local2]._color = Math.ceil(Math.random() * _root.n_BallTypes);
}
_local2--;
}
_local3++;
}
}
function f_BuildField(n_Depth, n_FillToLevel, n_NewLevel) {
var _local9;
var _local10;
var _local15;
var _local14;
var _local11;
if ((n_NewLevel > (_root.o_Levels.length - 1)) && (!_root.b_Won)) {
} else {
_root.b_Won = false;
_root._quality = _root.s_Quality;
_root.o_MenuOverlay.o_ToggleQuality.gotoAndStop(_root.s_Quality);
_root.o_GameOverlay.o_ToggleQuality.gotoAndStop(_root.s_Quality);
_root.d_Timer = new Date();
_root.d_LastPause = undefined;
_root.b_GameOver = false;
_root.b_Animating = false;
_root.n_LastPos = 0;
_root.n_Level = n_NewLevel;
_root.n_BallsNeeded = _root.o_Levels[_root.n_Level][1];
if (_root.s_GameMode.toLowerCase() != "menu") {
_root.o_GameOverlay.o_Instructions._visible = _root.n_Level == 1;
_root.o_GameOverlay.o_Instructions.gotoAndStop(_root.s_InputMethod);
_root.f_SaveLevel();
_local11 = _root.attachMovie("LevelUp_Animation", "o_LevelUp_Anim", _root.getNextHighestDepth(), {_x:_root.n_AlertX, _y:_root.n_AlertY});
_local11.o_Display.o_LevelText.text = _root.n_Level;
_local11.o_Display.o_NeededText.text = ((_root.s_PlayMode == "normal") ? (_root.o_Levels[_root.n_Level][1]) : "Survival");
}
_root.n_GameDepth = n_Depth;
_root.b_Left = false;
_root.b_Right = false;
_root.n_MoveDirection = 0;
if (_root.s_GameMode == "menu") {
_root.d_MenuDropNext = new Date();
_root.d_MenuDropNext.setTime(new Date().getTime() + _root.n_MenuDropIntervalLower);
_root.n_MenuMoveDirection = ((Math.random() > 0.5) ? 1 : -1);
}
if ((_root.n_Level == 1) || (_root.s_PlayMode == "survival")) {
_root.n_Score = 0;
_root.n_Offset = 0;
_root.n_RotateSpeed = 0;
_root.n_RotateMin = 0;
_root.o_LevelContainers.o_ContainerPlay.removeMovieClip();
_root.o_LevelContainers.o_ContainerLast.removeMovieClip();
}
_root.o_MenuOverlay._visible = _root.s_GameMode.toLowerCase() == "menu";
_root.o_MenuOverlay._x = ((_root.s_GameMode.toLowerCase() == "menu") ? 0 : -1000);
_root.o_MenuOverlay.o_ChooseMethodNew._visible = false;
_root.o_MenuOverlay.o_ChooseMethodContinue._visible = false;
_root.o_MenuOverlay.o_ChooseMethodSurvival._visible = false;
if (_root.s_GameMode.toLowerCase() == "menu") {
if (((_root.s_URL.toLowerCase().indexOf("static.kaisergames.de", 0) > 0) || (_root.s_URL.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("vo.llnwd.net", 0) > 0)) {
_root.o_MenuOverlay.KIBA_MenuLink._visible = true;
} else {
_root.o_MenuOverlay.KIBA_MenuLink._visible = false;
}
if (_root.s_URL.toLowerCase().indexOf("mindjolt", 0) > 0) {
_root.o_MenuOverlay.o_Highscores._visible = false;
_root.o_MenuOverlay.o_AddGame._visible = false;
}
if ((_root.s_URL.toLowerCase().indexOf("gamesgames.com", 0) > 0) || (_root.s_URL.toLowerCase().indexOf("agame.com", 0) > 0)) {
_root.o_MenuOverlay.GamesGames_Logo._visible = true;
} else {
_root.o_MenuOverlay.GamesGames_Logo._visible = false;
}
}
_root.o_GameOverlay._visible = _root.s_GameMode.toLowerCase() != "menu";
_root.o_GameOverlay._x = ((_root.s_GameMode.toLowerCase() != "menu") ? 0 : -1000);
if (_root.s_GameMode.toLowerCase() != "menu") {
if (_root.s_PlayMode == "survival") {
_root.o_GameOverlay.o_Timer.n_Seconds = -999;
_root.o_GameOverlay.o_Timer._visible = false;
} else {
_root.o_GameOverlay.o_Timer.n_Seconds = _root.o_Levels[_root.n_Level][0];
_root.o_GameOverlay.o_Timer._visible = true;
}
} else {
_root.o_GameOverlay.o_Timer.n_Seconds = _root.n_GameLength;
}
_root.o_GameOverlay.o_Timer.d_LastTick = new Date();
_root.b_Shaking = false;
_root.b_Paused = false;
_root.d_ShakeStart = new Date();
_root.d_ShakeStart.setTime(new Date().getTime() - n_ShakeTime);
_root.a_MessageArray = new Array();
_root.d_MessageLast = undefined;
_root.o_Menu._visible = _root.s_GameMode == "menu";
_root.d_LastMove = new Date();
_root.o_GameOverlay.o_Progress._visible = true;
_root.n_TimerInterval = _root.n_TimerIntervalBottom;
_root.o_GameOverlay.o_Progress.n_MaxValue = _root.n_TimerInterval;
_root.n_IntervalCount = 0;
_root.o_GameOverlay.o_Progress.n_CurrentValue = 0;
_root.o_ToDrop._visible = false;
_root.o_GameOverlay.o_Progress._visible = false;
if ((_root.o_LevelContainers.o_ContainerPlay._name != undefined) && (_root.s_GameMode.toLowerCase() != "menu")) {
_root.o_LevelContainers.o_ContainerLast.removeMovieClip();
_local10 = _root.o_LevelContainers.attachMovie("LevelContainer", "o_ContainerLast", ((1000 + _root.o_Levels.length) - _root.n_Level) - 1, {_x:0, _y:0});
_root.f_DrawCylinder(_local10);
_local10.o_Base.o_LevelText.text = ((_root.s_GameMode.toLowerCase() == "menu") ? "" : ("Level " + (_root.n_Level - 1).toString()));
_root.f_PlaySound("o_Sounds", "levelup");
_local10.n_Velocity = 0;
_local10.onEnterFrame = function () {
if (_root.s_GameMode == "menu") {
} else {
if (this.n_Velocity < _root.n_AnimateDropMaxVel) {
this.n_Velocity++;
}
if (this._y < 300) {
this._y = this._y + this.n_Velocity;
_root.o_Background._y = _root.o_Background._y + (this.n_Velocity / 2);
if (this._y >= 300) {
this._y = 300;
}
} else {
this._y = 300;
this.onEnterFrame = undefined;
}
}
};
_root.o_LevelContainers.o_ContainerPlay.removeMovieClip();
}
if (_root.o_LevelContainers.o_ContainerPlay._name == undefined) {
_local9 = _root.o_LevelContainers.attachMovie("LevelContainer", "o_ContainerPlay", (1000 + _root.o_Levels.length) - _root.n_Level, {_x:0, _y:-600});
_local9.o_Base.o_LevelText.text = ((_root.s_GameMode.toLowerCase() == "menu") ? "" : ("Level " + _root.n_Level.toString()));
if (_root.s_GameMode == "menu") {
_local9._y = 0;
_root.o_ToDrop._visible = false;
} else {
_root._animatingDrop = true;
_local9.n_Velocity = 0;
_local9.onEnterFrame = function () {
if (this.n_Velocity < _root.n_AnimateDropMaxVel) {
this.n_Velocity++;
}
if (this._y < 0) {
this._y = this._y + this.n_Velocity;
if (this._y >= 0) {
this._y = 0;
}
} else {
this._y = 0;
_root._animatingDrop = false;
_root.o_ToDrop._visible = true;
_root.o_GameOverlay.o_Progress._visible = true;
_root.o_GameOverlay.o_Progress.n_CurrentValue = 0;
_root.d_Timer = new Date();
this.onEnterFrame = undefined;
}
};
}
}
_root.o_PosData = new Array(_root.n_BallsPerRow);
var _local3 = 0;
while (_local3 < _root.n_BallsPerRow) {
_root.o_PosData[_local3] = new Array(_root.n_Height);
n_y = 0;
while (n_y < _root.n_Height) {
_root.o_PosData[_local3][n_y] = new Object({_color:(((n_Depth - n_FillToLevel) <= n_y) ? (Math.floor(1 + (Math.random() * _root.n_BallTypes))) : 0), _animating:false, _animationstart:undefined});
n_y++;
}
_local3++;
}
_root.f_ChooseNextDrop();
}
_root.b_Setup = true;
}
function f_DoDrops() {
var _local2;
var _local6;
var _local4 = new Array();
var _local7;
_local2 = 0;
while (_local2 < _root.o_PosData.length) {
_local6 = _root.o_PosData[_local2].length;
while (_local6 > 0) {
if ((((_root.o_PosData[_local2][_local6]._color == 0) && (_root.o_PosData[_local2][_local6 - 1]._color != 0)) && (!_root.o_PosData[_local2][_local6]._animating)) && (!_root.o_PosData[_local2][_local6 - 1]._animating)) {
_root.o_PosData[_local2][_local6]._color = _root.o_PosData[_local2][_local6 - 1]._color;
_root.o_PosData[_local2][_local6 - 1]._color = 0;
if ((_root.o_PosData[_local2][_local6 + 1]._color != 0) || (_local6 == _root.n_Height)) {
_local4.push(new Object({n_Y:_local6, n_Column:_local2}));
}
}
_local6--;
}
_local2++;
}
if (_local4.length > 0) {
var _local3 = 0;
while (_local3 < _local4.length) {
if ((_root.o_PosData[_local4[_local3].n_Column][_local4[_local3].n_Y + 1]._color > 0) && (_root.s_GameMode.toLowerCase() != "menu")) {
_root.f_PlaySound("o_Sounds", "touch");
}
_root.f_TryPop(_local4[_local3].n_Column, _local4[_local3].n_Y, true, _root.o_PosData[_local4[_local3].n_Column][_local4[_local3].n_Y]._color);
_local3++;
}
}
}
function f_GetDropLength() {
var _local3 = 0;
var _local2 = 1;
if (s_GameMode == "menu") {
_local2 = 4;
} else if (_root.s_PlayMode == "normal") {
_local2 = Math.round(_root.o_Levels[_root.n_Level][2] + (Math.random() * (_root.o_Levels[_root.n_Level][3] - _root.o_Levels[_root.n_Level][2])));
} else if (_root.n_Drops < 20) {
_local2 = 2;
} else if ((_root.n_Drops >= 20) && (_root.n_Drops < 40)) {
_local2 = ((Math.random() > 0.5) ? 2 : 3);
} else if ((_root.n_Drops >= 40) && (_root.n_Drops < 60)) {
_local2 = 3;
} else if ((_root.n_Drops >= 60) && (_root.n_Drops < 80)) {
_local2 = ((Math.random() > 0.5) ? 3 : 4);
} else {
_local2 = 4;
}
return(_local2);
}
function f_ChooseNextDrop() {
var _local3;
var _local5 = _root.f_GetDropLength();
_root.o_DropChoice = new Array();
var _local2 = 0;
while (_local2 < _local5) {
_local3 = Math.floor(1 + (Math.random() * _root.n_BallTypes));
_root.o_DropChoice.push(new Object({_color:_local3}));
_local2++;
}
_root.d_Timer = new Date();
}
function f_StartDrop() {
_root.n_Drops++;
_root.d_Timer = new Date();
_root.n_LastPos = 1000;
var _local2 = 0;
while (_local2 < _root.o_DropData.length) {
if ((_root.o_DropData[_local2]._color > 0) && (_root.o_PosData[_local2][0]._color == 0)) {
if (_root.n_LastPos >= _local2) {
_root.n_LastPos = _local2;
}
_root.o_PosData[_local2][0]._color = _root.o_DropData[_local2]._color;
_root.f_SetBall(_local2, 0, 0, 0);
_root.f_TryPop(_local2, 0, true, _root.o_PosData[_local2][0]._color);
}
_local2++;
}
if (_root.s_GameMode != "menu") {
_root.n_IntervalCount++;
if (_root.n_IntervalCount >= _root.n_IntervalReduction) {
_root.n_IntervalCount = 0;
if (_root.n_TimerInterval > _root.n_TimerIntervalTopLower) {
_root.n_TimerInterval = _root.n_TimerInterval - n_IntervalReductionTime;
if (_root.n_TimerInterval < _root.n_TimerIntervalTopLower) {
_root.n_TimerInterval = _root.n_TimerIntervalTopLower;
}
} else {
_root.n_TimerInterval = _root.n_TimerIntervalTopLower;
}
}
}
}
function f_DoGraphics() {
_root.b_Animating = _root.f_AnyAnimation();
_root.f_DoDrops();
_root.f_DrawCylinder(_root.o_LevelContainers.o_ContainerPlay);
_root.f_DrawToDrop();
}
function f_StartShake() {
_root.b_Shaking = true;
_root.d_ShakeStart = new Date();
}
function f_Shake() {
if (_root.b_Shaking) {
if ((_root.d_ShakeStart.getTime() + _root.n_ShakeTime) <= new Date().getTime()) {
_root.b_Shaking = false;
_root.o_LevelContainers.o_ContainerPlay._x = 0;
_root.o_LevelContainers.o_ContainerPlay._y = 0;
} else {
_root.o_LevelContainers.o_ContainerPlay._x = _root.n_ShakeAmount + (Math.random() * (_root.n_ShakeAmount * 2));
_root.o_LevelContainers.o_ContainerPlay._y = 0;
}
}
}
function f_CheckGameOver() {
var _local5;
var _local6;
_local6 = f_AnyAnimation();
if (!_local6) {
if ((_root.o_GameOverlay.o_Timer.n_Seconds == 0) && ((_root.s_PlayMode == "normal") || (_root.s_GameMode == "menu"))) {
_root.b_GameOver = true;
_root.d_GameOverTimer = new Date();
return(true);
}
if ((_root.n_Level > (_root.o_Levels.length - 1)) && (!_root.b_Won)) {
_root.b_Won = true;
_root.n_Score = _root.n_Score + _root.n_WinBonus;
_root.b_GameOver = true;
_root.d_GameOverTimer = new Date();
return(true);
}
var _local4 = 0;
while (_local4 < _root.o_PosData.length) {
if (_root.o_PosData[_local4][0]._color > 0) {
_local5 = false;
var _local3 = 0;
while (_local3 < _root.o_PosData[_local4].length) {
if (_root.o_PosData[_local4][_local3]._color == 0) {
_local5 = true;
} else {
_local5 = false;
}
_local3++;
}
if (!_local5) {
if (_root.s_GameMode != "menu") {
_local5 = false;
var _local2 = 0;
while (_local2 < _root.o_PosData.length) {
if (_root.o_PosData[_local2][0]._color > 0) {
_root.f_TryPop(_local2, 0, true, _root.o_PosData[_local2][0]._color);
}
_local2++;
}
}
_root.b_GameOver = true;
_root.d_GameOverTimer = new Date();
return(true);
}
}
_local4++;
}
}
return(false);
}
function f_ShowMessage(s_Text) {
if (_root.s_GameMode != "menu") {
_root.a_MessageArray.push(s_Text);
}
}
function f_DoMessages() {
var _local2;
var _local3;
if (_root.a_MessageArray.length > 0) {
if (_root.f_TimeDiff(_root.d_MessageLast, new Date()) >= _root.n_MessageDelay) {
_local2 = _root.attachMovie("Messages", "Messages", _root.getNextHighestDepth());
_local3 = _root.a_MessageArray.shift();
_local2._x = _root.n_GameWidth / 2;
_local2._y = (_root.n_GameHeight / 2) - 50;
_local2.o_InnerText.o_Text.text = _local3;
_local2.gotoAndPlay(1);
_root.d_MessageLast = new Date();
}
}
}
function f_ToggleSounds() {
var _local2 = new Date();
var _local3 = SharedObject.getLocal("GameSettings");
if (d_SoundsToggle == undefined) {
d_SoundsToggle = new Date(1999, 12, 31, 23, 59, 59, 0);
}
if (_root.f_OverTimeDiff(_root.d_SoundsToggle, _local2, 100)) {
_root.b_SoundsOn = !_root.b_SoundsOn;
_local3.data.b_SoundsOn = _root.b_SoundsOn;
if (_root.b_SoundsOn) {
_root.f_PlaySound("o_Sounds", "GameMusic");
} else {
stopAllSounds();
}
_root.d_SoundsToggle = _local2;
}
}
function f_PlaySound(s_Group, s_Sound) {
if (_root.b_SoundsOn) {
_root[s_Group].gotoAndPlay(s_Sound);
}
}
function f_OverTimeDiff(d_DateFrom, d_DateTo, n_MillisecondsDiff) {
var _local2 = d_DateFrom.getTime();
var _local1 = d_DateTo.getTime();
if (((_local2 + n_MillisecondsDiff) <= _local1) || (_local2 >= (_local1 + n_MillisecondsDiff))) {
return(true);
}
return(false);
}
function f_TimeDiff(d_DateFrom, d_DateTo) {
var _local2 = d_DateFrom.getTime();
var _local1 = d_DateTo.getTime();
return(_local1 - _local2);
}
function f_TogglePause() {
if ((_root.f_TimeDiff(_root.d_LastPause, new Date()) > 1000) || (_root.d_LastPause == undefined)) {
if (!_root.b_Paused) {
_root.b_PausedMusic = _root.b_SoundsOn;
if (_root.b_PausedMusic) {
_root.f_ToggleSounds();
}
} else if (_root.b_PausedMusic) {
_root.f_ToggleSounds();
}
_root.b_Paused = !_root.b_Paused;
if (!_root.b_Paused) {
_root.d_Timer = new Date();
_root.o_FrontHolder._visible = true;
_root.o_BackHolder._visible = true;
} else {
_root.o_FrontHolder._visible = false;
_root.o_BackHolder._visible = false;
}
_root.d_KeyLast = new Date();
_root.d_LastPause = new Date();
}
}
function f_ToggleSounds() {
var _local2 = new Date();
var _local3 = SharedObject.getLocal("GameSettings");
if (d_SoundsToggle == undefined) {
d_SoundsToggle = new Date(1999, 12, 31, 23, 59, 59, 0);
}
if (_root.f_OverTimeDiff(_root.d_SoundsToggle, _local2, 100)) {
_root.b_SoundsOn = !_root.b_SoundsOn;
_local3.data.b_SoundsOn = _root.b_SoundsOn;
if (_root.b_SoundsOn) {
_root.f_PlaySound("o_Sounds", "GameMusic");
} else {
stopAllSounds();
}
_root.d_SoundsToggle = _local2;
}
}
var n_BallsPerRow = 20;
var n_BallWidth = 40;
var n_BallTypes = 6;
var n_Height = 8;
var n_XCenter = 275;
var n_YBase = 420;
var n_RowPerspectiveHeight = 50;
var n_RowPerspectiveWidth = 130;
var n_SquishFactor = 10;
var n_BallSepDegree = Math.floor(360 / _root.n_BallsPerRow);
var o_ObjectArray;
var n_Level;
var s_Quality = "HIGH";
var n_LastScore;
var n_LastLevel;
var o_LastPops;
var o_Levels = [[0, 0, 0, 0], [120, 40, 2, 2], [120, 45, 2, 3], [110, 50, 3, 3], [110, 55, 3, 4], [100, 60, 3, 4], [100, 70, 3, 5], [100, 75, 3, 5], [100, 80, 3, 5], [90, 85, 3, 5], [90, 90, 3, 5], [90, 95, 4, 5], [85, 100, 4, 5], [80, 105, 4, 5], [75, 110, 4, 5], [70, 115, 4, 5], [70, 120, 4, 5]];
var a_MessageArray;
var n_MessageDelay = 750;
var d_MessageLast;
var n_MessageRepeatDelay = 2000;
var n_RotateSpeed;
var n_RotateMin = n_BallSepDegree;
var n_RotateMax = 8;
var n_RotateIncrease = 0.33;
var n_RotateDecrease = 5;
var n_Offset;
var b_AnimatingDrop = false;
var n_AnimateDropMaxVel = 30;
var b_GameOver;
var d_GameOverTimer;
var n_GameOverPause = 3000;
var b_Won = false;
var n_WinBonus = 1000000;
var n_GameLength = 300;
var b_SoundsStarted = false;
var b_SoundsOn = true;
var d_SoundsToggle;
var b_Paused;
var b_PausedMusic;
var d_LastPause;
var b_Animating;
var n_LastPos;
var n_MessageRepeatDelay = 2000;
var b_InstructionsOn = true;
var n_AlertX = 0;
var n_AlertY = 180;
var b_Shaking;
var n_ShakeTime = 750;
var d_ShakeStart;
var n_ShakeAmount = 3;
var o_DropData = new Array();
var o_DropChoice = new Array();
var o_DropOutline = new Array();
var o_PosData = new Array();
var o_PopArray = new Array();
var o_PopToDo = new Array();
var n_PopLength = 3;
var n_PopMultiplier = 0.25;
var n_GameDepth;
var n_BombChance = 0.025;
var n_PosYSpace = 32;
var n_BaseY = -414;
var n_Brightness;
var b_Pop;
var n_Drops;
var n_MaxDropLength = [[0, 2, 2], [10, 2, 3], [20, 3, 3], [40, 3, 4], [80, 3, 5], [140, 3, 6], [200, 4, 6]];
var n_ColoursHard = 6;
var n_ColoursNormal = 6;
var n_ColoursEasy = 6;
var n_Level = 1;
var n_BallsNeeded = 0;
var n_Score;
var n_ScoreBall = 50;
var n_ScoreMultiplier = 0.5;
var n_ScorePass = -100;
var n_Pops;
var o_Settings = SharedObject.getLocal("hypertube");
var d_Timer;
var n_TimerInterval;
var n_TimerIntervalTop = 12000;
var n_TimerIntervalTopLower = 8000;
var n_TimerIntervalBottom = 12000;
var n_TimerIntervalBottomLower = 8000;
var n_IntervalCount = 0;
var n_IntervalReduction = 100;
var n_IntervalReductionTime = 250;
var d_MenuDropNext;
var n_MenuDropIntervalLower = 1500;
var n_MenuDropIntervalUpper = 3000;
var n_MenuMoveDirection;
var n_MenuRotateMax = 5;
var b_Setup;
var b_RunOnce = false;
var s_GameMode = "menu";
var s_InputMethod = "keyboard";
var s_PlayMode = "normal";
var o_MList;
var o_KeyList;
var b_Left;
var b_Right;
var n_MoveFront;
var d_LastMove;
var n_MoveIntervalTop = 100;
var n_MoveIntervalBottom = 200;
var n_MenuRotateChance = 0.2;
this.stop();
Frame 3
if ((_root.b_Setup == undefined) || (_root.b_Setup == false)) {
if (_root.s_GameMode == "menu") {
_root.f_StartGame(1);
}
}
Frame 5
if (_root.s_PlayMode == "normal") {
var o = {n:[1, 5, 3, 10, 12, 7, 2, 0, 7, 2, 13, 3, 6, 14, 12, 6], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
_root.onEnterFrame = undefined;
if (_root.n_Score > 0) {
mochi.as2.MochiScores.showLeaderboard({boardID:boardID, score:_root.n_Score});
} else {
mochi.as2.MochiScores.showLeaderboard({boardID:boardID});
}
} else if (_root.s_PlayMode == "survival") {
var o = {n:[2, 13, 11, 10, 8, 7, 3, 0, 8, 4, 11, 13, 3, 3, 6, 13], f:function (i, s) {
if (s.length == 16) {
return(s);
}
return(this.f(i + 1, s + this.n[i].toString(16)));
}};
var boardID = o.f(0, "");
_root.onEnterFrame = undefined;
if (_root.n_Score > 0) {
mochi.as2.MochiScores.showLeaderboard({boardID:boardID, score:_root.n_Score});
} else {
mochi.as2.MochiScores.showLeaderboard({boardID:boardID});
}
}
Frame 6
_root.s_GameMode = "menu";
_root.b_Setup = false;
_root.gotoAndPlay("Game");
Symbol 19 MovieClip [Messages] Frame 34
this.removeMovieClip();
Symbol 43 MovieClip [Ball_Graphics] Frame 15
_root.f_EndPopping(this);
Symbol 43 MovieClip [Ball_Graphics] Frame 22
_root.f_EndPopping(this);
Symbol 43 MovieClip [Ball_Graphics] Frame 29
_root.f_EndPopping(this);
Symbol 43 MovieClip [Ball_Graphics] Frame 36
_root.f_EndPopping(this);
Symbol 43 MovieClip [Ball_Graphics] Frame 43
_root.f_EndPopping(this);
Symbol 43 MovieClip [Ball_Graphics] Frame 50
_root.f_EndPopping(this);
Symbol 61 Button
on (release) {
getURL ("http://www.gamesgames.com", "_blank");
}
Symbol 64 Button [KIBA_MenuLink]
on (release) {
getURL ("http://www.kibagames.com", "_blank");
}
Symbol 72 Button [Credits_Click]
on (release) {
getURL ("http://www.smileygamer.com/?gameref=" + _root.s_SmileyID, "_blank");
}
Symbol 84 Button
on (release) {
o_ChooseMethodContinue._visible = false;
o_ChooseMethodSurvival._visible = false;
o_ChooseMethodNew._visible = !o_ChooseMethodNew._visible;
}
Symbol 88 Button
on (release) {
o_ChooseMethodNew._visible = false;
o_ChooseMethodSurvival._visible = false;
o_ChooseMethodContinue._visible = !o_ChooseMethodContinue._visible;
}
Symbol 92 Button
on (release) {
_root.n_Score = 0;
_root.s_PlayMode = "normal";
_root.f_DoScores();
}
Symbol 96 Button
on (release) {
_root.f_ToggleQuality();
}
Symbol 99 Button
on (release) {
_root.f_ToggleQuality();
}
Symbol 106 Button
on (release) {
_root.f_ToggleSounds();
}
Symbol 109 Button
on (release) {
_root.f_ToggleSounds();
}
Symbol 110 MovieClip [SoundsOnOff_SansKey] Frame 1
if (_root.b_SoundsOn == false) {
this.gotoAndPlay("Off");
} else {
this.gotoAndPlay("On");
}
Symbol 110 MovieClip [SoundsOnOff_SansKey] Frame 3
if (_root.b_SoundsOn) {
this.gotoAndPlay("On");
} else {
this.gotoAndPlay("Off");
}
Symbol 110 MovieClip [SoundsOnOff_SansKey] Frame 5
if (_root.b_SoundsOn) {
this.gotoAndPlay("On");
} else {
this.gotoAndPlay("Off");
}
Symbol 115 Button
on (release) {
_root.f_ShowIE8Problem();
}
Symbol 122 Button
on (release) {
getURL ("http://www.smileygamer.com/freecontent.html?gameref=" + _root.s_SmileyID, "_blank");
}
Symbol 126 Button
on (release) {
o_ChooseMethodNew._visible = false;
o_ChooseMethodContinue._visible = false;
o_ChooseMethodSurvival._visible = !o_ChooseMethodSurvival._visible;
}
Symbol 127 Button
on (release) {
_root.n_Score = 0;
_root.s_PlayMode = "survival";
_root.f_DoScores();
}
Symbol 133 Button
on (release) {
_root.getURL("http://www.smileygamer.com/play/3486/qube.html?gameref=5684", "_blank");
}
Symbol 139 Button
on (release) {
_root.s_PlayMode = "normal";
_root.s_InputMethod = "keyboard";
_root.s_GameMode = "game";
_root.f_StartGame(false);
}
Symbol 143 Button
on (release) {
_root.s_PlayMode = "normal";
_root.s_InputMethod = "mouse";
_root.s_GameMode = "game";
_root.f_StartGame(false);
}
Symbol 145 Button
on (release) {
_root.s_PlayMode = "normal";
_root.s_InputMethod = "keyboard";
_root.s_GameMode = "game";
_root.f_StartGame(true);
}
Symbol 146 Button
on (release) {
_root.s_PlayMode = "normal";
_root.s_InputMethod = "mouse";
_root.s_GameMode = "game";
_root.f_StartGame(true);
}
Symbol 148 Button
on (release) {
_root.s_PlayMode = "survival";
_root.s_InputMethod = "keyboard";
_root.s_GameMode = "game";
_root.f_StartGame(false);
}
Symbol 149 Button
on (release) {
_root.s_PlayMode = "survival";
_root.s_InputMethod = "mouse";
_root.s_GameMode = "game";
_root.f_StartGame(false);
}
Symbol 159 MovieClip [Progress] Frame 1
function f_showProgress() {
if (n_CurrentValue != undefined) {
if (this.n_CurrentValue >= this.n_MaxValue) {
this.gotoAndPlay("Unfinished");
} else {
this.gotoAndPlay("Finished");
}
} else {
this.gotoAndPlay("Unfinished");
}
}
var n_MaxValue;
var n_CurrentValue;
this.onEnterFrame = function () {
if ((n_MaxValue != undefined) and (n_CurrentValue != undefined)) {
if (n_CurrentValue > n_MaxValue) {
o_ProgressBar._width = o_ProgressBorder._width;
} else {
o_ProgressBar._width = (o_ProgressBorder._width / n_MaxValue) * n_CurrentValue;
}
}
};
Symbol 159 MovieClip [Progress] Frame 2
this.f_showProgress();
Symbol 159 MovieClip [Progress] Frame 4
this.f_showProgress();
Symbol 177 Button [ClickToPlayGame]
on (release) {
_root.play();
}
Symbol 178 MovieClip [Loader] Frame 2
var siteLoaded = _root.getBytesLoaded();
var siteTotal = _root.getBytesTotal();
var percentage = Math.round((siteLoaded / siteTotal) * 100);
loadingBar._xscale = percentage;
percentClip.percentDisplay.text = percentage + "%";
percentClip._x = loadingBar._x + loadingBar._width;
bytesDisplay.text = ((("loaded " + siteLoaded) + " of ") + siteTotal) + " bytes";
if (siteLoaded >= siteTotal) {
this.gotoAndPlay("End");
}
Symbol 178 MovieClip [Loader] Frame 3
if (siteLoaded >= siteTotal) {
this.gotoAndPlay("End");
} else {
gotoAndPlay ("Looper");
}
Symbol 178 MovieClip [Loader] Frame 4
if ((((((((((_root.s_URL.toLowerCase().indexOf("addictinggames", 0) > 0) || (_root.s_URL.toLowerCase().indexOf("smileygamer", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("static.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("kongregate", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("gamesclub.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("armorgames.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("media.jaludo.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("agame.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("freeonlinegames.com", 0) > 0)) {
_root.play();
} else if ((_root.f_TimeDiff(_root.d_AdvertStartTime, new Date()) >= _root.n_CPMWaitTime) || (_root.b_Debugging)) {
this.gotoAndPlay("PlayGame");
}
Symbol 178 MovieClip [Loader] Frame 5
this.gotoAndPlay("End");
Symbol 178 MovieClip [Loader] Frame 6
if (((((((((((_root.s_URL.toLowerCase().indexOf("addictinggames", 0) > 0) || (_root.s_URL.toLowerCase().indexOf("smileygamer", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("static.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("vo.llnwd.net", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("kongregate", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("gamesclub.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("armorgames.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("gamesgames.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("agame.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("freeonlinegames.com", 0) > 0)) {
_root.play();
} else {
this.stop();
}
Symbol 278 MovieClip [__Packages.mochi.as2.MochiSync] Frame 0
class mochi.as2.MochiSync
{
var _syncContainer;
function MochiSync () {
_syncContainer = {};
}
function getProp(name) {
return(_syncContainer[name]);
}
function setProp(name, value) {
if (_syncContainer[name] == value) {
return(undefined);
}
_syncContainer[name] = value;
mochi.as2.MochiServices.send("sync_propUpdate", {name:name, value:value});
}
function triggerEvent(eventType, args) {
switch (eventType) {
case SYNC_REQUEST :
mochi.as2.MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY :
_syncContainer[args.name] = args.value;
}
}
static var SYNC_REQUEST = "SyncRequest";
static var SYNC_PROPERTY = "UpdateProperty";
}
Symbol 279 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.8 as2");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
disconnect();
onError.apply(null, [errorCode]);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
case "sync" :
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function updateCopy(args) {
send("coins_updateCopy", args, null, null);
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
trace("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + methodName);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace(("WARNING: " + (leaderboard ? "board" : "game")) + " ID is not the appropriate length");
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
trace("WARNING: Board ID contains illegal characters: " + bid);
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var servicesSync = new mochi.as2.MochiSync();
}
Symbol 280 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 281 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 282 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("coins_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("coins_hideLoginWidget");
}
static function requestLogin() {
mochi.as2.MochiServices.send("coins_requestLogin");
}
static function getUserInfo() {
mochi.as2.MochiServices.send("coins_getUserInfo");
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("coins_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 283 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiServices.warnID(boardID, true);
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
options.clip = mochi.as2.MochiServices.clip;
if ((options.clip != mochi.as2.MochiServices.__get__clip()) || (mochi.as2.MochiServices.__get__childClip()._target == undefined)) {
mochi.as2.MochiServices.disconnect();
trace("WARNING! This application is attempting to connect to MochiServices inside a showLeaderboard call!");
trace("make sure MochiServices.connect is called as early in the application runtime as possible.");
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.as2.MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 284 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 188 MovieClip [Sounds] Frame 2
gotoAndStop (1);
Symbol 188 MovieClip [Sounds] Frame 4
gotoAndStop (1);
Symbol 188 MovieClip [Sounds] Frame 6
gotoAndStop (1);
Symbol 188 MovieClip [Sounds] Frame 8
gotoAndStop (1);
Symbol 188 MovieClip [Sounds] Frame 10
gotoAndStop (1);
Symbol 205 Button [SplashButton]
on (release) {
getURL ("http://www.smileygamer.com/?gameref=" + _root.s_SmileyID, "_blank");
}
Symbol 206 MovieClip [SplashGraphics] Frame 121
_root.play();
Symbol 214 Button
on (release) {
_root.o_MenuOverlay.o_IE8Problem.removeMovieClip();
}
Symbol 223 Button
on (release) {
this.play();
}
Symbol 250 MovieClip [GameOver_Animation] Frame 16
var n_PopID = 1;
while (n_PopID <= 6) {
this["o_Popped_" + n_PopID.toString()].text = _root.n_Pops[n_PopID].toString();
n_PopID++;
}
this.o_Score.text = _root.n_Score.toString();
if (_root.s_URL.toLowerCase().indexOf("mindjolt", 0) > 0) {
this.o_Submit._visible = false;
_root.MindJoltAPI.service.submitScore(_root.n_Score);
} else if ((((((((((_root.s_URL.toLowerCase().indexOf("addictinggames", 0) > 0) || (_root.s_URL.toLowerCase().indexOf("smileygamer", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("static.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("kongregate", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("gamesclub.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("armorgames.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("media.jaludo.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("agame.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("freeonlinegames.com", 0) > 0)) {
} else {
this.adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + _root.CPMStarContentInterlevelID);
}
this.stop();
_root.stop();
Symbol 250 MovieClip [GameOver_Animation] Frame 25
_root.f_DoScores();
this.removeMovieClip();
Symbol 250 MovieClip [GameOver_Animation] Frame 41
var n_PopID = 1;
while (n_PopID <= 6) {
this["o_Popped_" + n_PopID.toString()].text = _root.n_Pops[n_PopID].toString();
n_PopID++;
}
this.o_Score.text = _root.n_Score.toString();
if (_root.s_URL.toLowerCase().indexOf("mindjolt", 0) > 0) {
this.o_Submit._visible = false;
_root.MindJoltAPI.service.submitScore(_root.n_Score);
} else if ((((((((((_root.s_URL.toLowerCase().indexOf("addictinggames", 0) > 0) || (_root.s_URL.toLowerCase().indexOf("smileygamer", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("static.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("cdn.kaisergames.de", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("kongregate", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("gamesclub.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("armorgames.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("media.jaludo.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("agame.com", 0) > 0)) || (_root.s_URL.toLowerCase().indexOf("freeonlinegames.com", 0) > 0)) {
} else {
this.adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + _root.CPMStarContentInterlevelID);
}
this.stop();
_root.stop();
Symbol 250 MovieClip [GameOver_Animation] Frame 50
_root.f_DoScores();
this.removeMovieClip();
Symbol 253 MovieClip [Timer] Frame 1
var n_Seconds;
var d_LastTick;
this.onEnterFrame = function () {
var _local4 = "00";
var _local3 = "00";
var _local6 = this.o_TimerText.getTextFormat();
var _local5;
_local4 = "00" + Math.floor(this.n_Seconds / 60);
_local4 = _local4.substr(_local4.length - 2, 2);
_local3 = "00" + (this.n_Seconds % 60);
_local3 = _local3.substr(_local3.length - 2, 2);
if (_root.s_PlayMode != "survival") {
if ((!_root.b_Paused) && (!_root._animatingDrop)) {
if ((this.n_Seconds != undefined) && (this.d_LastTick != undefined)) {
if (this.n_Seconds > 0) {
if (_root.f_OverTimeDiff(this.d_LastTick, new Date(), 1000)) {
this.n_Seconds--;
this.d_LastTick = new Date();
}
}
if (this.n_Seconds <= 30) {
_local5 = 16711680 /* 0xFF0000 */;
} else if ((this.n_Seconds > 30) && (this.n_Seconds <= 60)) {
_local5 = 16776960 /* 0xFFFF00 */;
} else {
_local5 = 16777215 /* 0xFFFFFF */;
}
_local6.color = _local5;
this.o_TimerText.text = (_local4 + ":") + _local3;
this.o_TimerText.setTextFormat(_local6);
}
} else {
this.o_TimerText.text = (_root._animatingDrop ? ((_local4 + ":") + _local3) : "paused");
}
}
};
Symbol 256 MovieClip [Score] Frame 1
var s_ScoreString = ("00000000" + _root.n_Score.toString()).toString();
if (_root.s_PlayMode == "tutorial") {
this.ScoreText.text = "Tutorial Mode";
} else if (_root.n_Score != undefined) {
this.ScoreText.text = s_ScoreString.substring(s_ScoreString.length - 8, s_ScoreString.length);
} else {
this.ScoreText.text = "00000000";
}
Symbol 256 MovieClip [Score] Frame 2
gotoAndPlay (1);
Symbol 258 MovieClip [Needed] Frame 1
var s_ScoreString = ("000" + _root.n_BallsNeeded.toString()).toString();
var s_Color;
if (_root.s_PlayMode != "normal") {
this.ScoreText.text = "-";
} else if (_root.n_Level != undefined) {
this.ScoreText.text = s_ScoreString.substring(s_ScoreString.length - 3, s_ScoreString.length);
} else {
this.ScoreText.text = "000";
}
Symbol 258 MovieClip [Needed] Frame 2
gotoAndPlay (1);