Combined Code
// unknown tag 88 length 63
movieClip 19 generatedText {
}
movieClip 28 blockOneParticle {
}
movieClip 37 blockTwoParticle {
}
movieClip 38 block8Particle {
}
movieClip 47 blockOne {
}
movieClip 56 blockTwo {
}
movieClip 65 {
}
movieClip 74 {
}
movieClip 76 block8 {
}
movieClip 77 block7 {
}
movieClip 79 sweep {
}
movieClip 84 highlight2 {
}
movieClip 86 highlight {
}
movieClip 93 {
frame 1 {
this.gotoAndPlay(Math.ceil(Math.random() * 5));
}
}
movieClip 96 {
}
movieClip 99 {
}
movieClip 103 {
}
movieClip 104 bomb {
}
movieClip 106 explosionSquare {
}
movieClip 108 coverUp {
}
movieClip 110 redThing {
}
movieClip 112 popExplosion {
}
movieClip 115 pausedText {
}
movieClip 117 loseBar {
}
// unknown tag 88 length 69
movieClip 223 Card_Cooldown_Time {
frame 1 {
X = this._parent.sweepDelay;
Y = X / 100;
this.onEnterFrame = function () {
Z = this._parent.sweepTimer;
this.gotoAndStop((Z / X) * 100 + 1);
};
}
}
frame 1 {
function soun(S) {
if (this['soundOut' + S] < this['soundMax' + S]) {
++this['soundOut' + S];
this['snd' + S].start(0, 1);
}
}
function musi(M, loops) {
if (loops == undefined) {
loops = 100000;
}
musics += 1;
trace('Music----------');
trace(musics);
trace(this['mus' + (musics - 1)]);
this['mus' + (musics - 1)].stop();
delete this['mus' + (musics - 1)];
var v3 = new Sound();
this['mus' + musics] = v3;
trace('mus' + musics);
this['mus' + musics].attachSound('music' + M);
this['mus' + musics].start(0, loops);
trace('----------------');
}
function manageSound() {
if (_global.SoundOn == false && _global.Volume > 0) {
_global.Volume -= 5;
} else {
if (_global.SoundOn != false && _global.Volume < _global.VolumeSet) {
_global.Volume += 5;
} else {
if (_global.SoundOn != false && _global.Volume > _global.VolumeSet) {
_global.Volume -= 5;
}
}
}
snd1.setVolume(_global.Volume);
i = 1;
while (i <= NumberOfSounds) {
if (this['soundOut' + i] > 0) {
--this['soundOut' + i];
}
++i;
}
}
function toggleSound() {
if (_global.SoundOn) {
music.setVolume(0);
_global.SoundOn = false;
} else {
music.setVolume(80);
_global.SoundOn = true;
}
}
if (_global.SoundOn == undefined) {
_global.SoundOn = true;
_global.Volume = 80;
_global.VolumeSet = 80;
}
soundMax1 = 10;
var snd1 = new Sound();
snd1.attachSound('sound1');
snd1.setVolume(100);
snd1.start(0, 1000000);
NumberOfSounds = 50;
i = 1;
while (i <= NumberOfSounds) {
this['soundMax' + i] = 2;
this['snd' + i] = new Sound();
this['snd' + i].attachSound('sound' + i);
++i;
}
i = 1;
while (i <= NumberOfSounds) {
this['soundOut' + i] = 0;
++i;
}
if (musics == undefined) {
musics = 0;
}
_global.SoundOn = true;
}
frame 1 {
function rotateTo(Self, Target) {
X = Self._x;
Y = Self._y;
X2 = Target._x;
Y2 = Target._y;
Xdiff = X2 - X;
Ydiff = -(Y2 - Y);
radAngle = Math.atan(Ydiff / Xdiff);
if (Xdiff < 0) {
corrFactor = 270;
Rotation = -radAngle * 360 / 6.283185307179586 + corrFactor;
return Rotation;
}
corrFactor = 90;
Rotation = -radAngle * 360 / 6.283185307179586 + corrFactor;
return Rotation;
}
function getDist(Self, Target) {
DX = Self._x - Target._x;
DY = Self._y - Target._y;
Dis = Math.sqrt(this.DX * this.DX + this.DY * this.DY);
return Dis;
}
function size(Self) {
if (Self.head != undefined) {
Size = (Self.head._width + Self.head._height) / 2;
return Size;
}
Size = (Self._width + Self._height) / 2;
return Size;
}
function RN(Random, Int) {
if (Int == undefined) {
Int = 0;
}
return Math.random() * Random + Int;
}
function PC(percent) {
X = Math.random() * 100;
if (X < percent) {
return true;
} else {
return false;
}
}
function pull(Self, Target, Speed) {
angle = rotateTo(Target, Self);
Target._x += Math.sin(angle * 0.0174532925199433) * Speed / 10;
Target._y += (Math.cos(angle * 0.0174532925199433) * Speed / 10) * -1;
}
function pX(Rot) {
X = Math.sin(Rot * 0.0174532925199433) * 1;
return X;
}
function pY(Rot) {
Y = Math.cos(Rot * 0.0174532925199433) * 1 * -1;
return Y;
}
function run(Self) {
Self._x += Math.sin(Self._rotation * 0.0174532925199433) * Self.Speed / 10;
Self._y += (Math.cos(Self._rotation * 0.0174532925199433) * Self.Speed / 10) * -1;
}
function GraphicEffect(FX, behaviors, Data) {
function NewA() {
fx.TempA();
behaviors.A(fx);
}
function NewB() {
fx.TempB();
behaviors.B(fx);
}
function NewC() {
fx.TempC();
behaviors.C(fx);
}
if (Data._x == undefined) {
Data._x = 0;
}
if (Data._y == undefined) {
Data._y = 0;
}
if (Data._alpha == undefined) {
Data._alpha = 100;
}
if (Data._rotation == undefined) {
Data._rotation = 0;
}
if (Data.Speed == undefined) {
Data.Speed = 2;
}
if (Data.Life == undefined) {
Data.Life = 5;
}
if (Data.Spin == undefined) {
Data.Spin = 30;
}
if (Data.Speed == undefined) {
Data.Speed = 0;
}
if (Data.Grow == undefined) {
Data.Grow = 10;
}
if (Data.Shrink == undefined) {
Data.Shrink = 3;
}
if (Data.FadeOut == undefined) {
Data.FadeOut = 10;
}
var fx = this.attachMovie(FX, 'fx' + _global.cDepth, _global.cDepth);
fx.D = _global.cDepth;
++_global.cDepth;
fx._x = Data._x;
fx._y = Data._y;
fx._alpha = Data._alpha;
if (Data._xscale != undefined) {
fx._xscale = Data._xscale;
}
if (Data._yscale != undefined) {
fx._yscale = Data._yscale;
}
fx._rotation = Data._rotation;
fx.Spin = Data.Spin;
fx.Grow = Data.Grow;
fx.Speed = Data.Speed;
fx.Shrink = Data.Shrink;
fx.FadeOut = Data.FadeOut;
fx.Life = Data.Life;
fx.onEnterFrame = function () {
--fx.Life;
if (fx.Life < 1) {
fx.removeMovieClip();
}
};
fx.TempA = fx.onEnterFrame;
fx.onEnterFrame = function () {
NewA();
};
fx.TempB = fx.onEnterFrame;
fx.onEnterFrame = function () {
NewB();
};
fx.TempC = fx.onEnterFrame;
fx.onEnterFrame = function () {
NewC();
};
}
function spin(Self) {
Self._rotation += Self.Spin;
}
function grow(Self) {
Self._xscale += Self.Grow;
Self._yscale += Self.Grow;
}
function shrink(Self) {
Self._xscale -= Self.Shrink;
Self._yscale -= Self.Shrink;
}
function fadeOut(Self) {
Self._alpha -= Self.FadeOut;
}
}
frame 1 {
mochi.as2.MochiAd.showPreGameAd({'id': '1c6cbbba31b819d5', 'res': '550x400'});
mochi.as2.MochiServices.connect('1c6cbbba31b819d5');
}
frame 1 {
this.tabChildren = false;
}
movieClip 228 {
frame 1 {
this.onLoad = function () {
if (_global.SoundOn) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
};
this.onEnterFrame = function () {
if (_global.SoundOn) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
};
}
}
button 230 {
on (press) {
toggleSound();
}
}
movieClip 336 __Packages.mochi.as2.MochiAd {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiAd) {
var v1 = function () {};
mochi.as2.MochiAd = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return mochi.as2.MochiServices.getVersion();
};
v1.showPreGameAd = function (options) {
var v27 = {'clip': _root, 'ad_timeout': 3000, 'fadeout_time': 250, 'regpt': 'o', 'method': 'showPreloaderAd', 'color': 16747008, 'background': 16777161, 'outline': 13994812, 'no_progress_bar': false, 'ad_started': function () {
this.clip.stop();
}, 'ad_finished': function () {
this.clip.play();
}, 'ad_failed': function () {
trace('[MochiAd] Couldn\'t load an ad, make sure that your game\'s local security sandbox is configured for Access Network Only and that you are not using ad blocking software');
}, 'ad_loaded': function (width, height) {}, 'ad_skipped': function () {}, 'ad_progress': function (percent) {}};
options = mochi.as2.MochiAd._parseOptions(options, v27);
if ('c862232051e0a94e1c3609b3916ddb17'.substr(0) == 'dfeada81ac97cde83665f81c12da7def') {
options.ad_started();
options.ad_finished();
return undefined;
}
var clip = options.clip;
var v24 = 11000;
var v19 = options.ad_timeout;
if (options.skip) {
v19 = 0;
}
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!mochi.as2.MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return undefined;
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var v15 = mochi.as2.MochiAd._getRes(options);
var v5 = v15[0];
var v14 = v15[1];
mc._x = v5 * 0.5;
mc._y = v14 * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk._x = v5 * -0.5;
chk._y = v14 * -0.5;
var v7 = chk.createEmptyMovieClip('_mochiad_bar', 4);
if (options.no_progress_bar) {
v7._visible = false;
delete options.no_progress_bar;
} else {
v7._x = 10;
v7._y = v14 - 20;
}
var v23 = options.color;
delete options.color;
var v21 = options.background;
delete options.background;
var v25 = options.outline;
delete options.outline;
var v6 = v7.createEmptyMovieClip('_outline', 1);
v6.beginFill(v21);
v6.moveTo(0, 0);
v6.lineTo(v5 - 20, 0);
v6.lineTo(v5 - 20, 10);
v6.lineTo(0, 10);
v6.lineTo(0, 0);
v6.endFill();
var v4 = v7.createEmptyMovieClip('_inside', 2);
v4.beginFill(v23);
v4.moveTo(0, 0);
v4.lineTo(v5 - 20, 0);
v4.lineTo(v5 - 20, 10);
v4.lineTo(0, 10);
v4.lineTo(0, 0);
v4.endFill();
v4._xscale = 0;
var v8 = v7.createEmptyMovieClip('_outline', 3);
v8.lineStyle(0, v25, 100);
v8.moveTo(0, 0);
v8.lineTo(v5 - 20, 0);
v8.lineTo(v5 - 20, 10);
v8.lineTo(0, 10);
v8.lineTo(0, 0);
chk.ad_msec = v24;
chk.ad_timeout = v19;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var v2 = 100 * (1 - (getTimer() - this.fadeout_start) / this.fadeout_time);
if (v2 > 0) {
this._parent._alpha = v2;
} else {
var v3 = this._parent._parent;
mochi.as2.MochiAd.unload(v3);
delete this.onEnterFrame;
}
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var v2 = this.mc._mochiad_wait;
v2.server_control = true;
v2.started = getTimer();
v2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace('[MOCHIAD rpcTestFn] ' + s);
return s;
};
chk.onEnterFrame = function () {
var v10 = this._parent._parent;
var v3 = v10;
for (;;) {
if (!(!v3.getBytesTotal() && v3)) break;
v3 = v3._parent;
}
if (!v3) {
v3 = _root;
}
var v13 = this._parent._mochiad_ctr;
var v7 = getTimer() - this.started;
var v5 = false;
var v6 = v3.getBytesTotal();
var v9 = v3.getBytesLoaded();
var v4 = 100 * v9 / v6;
var v12 = 100 * v7 / chk.ad_msec;
var v11 = this._mochiad_bar._inside;
var v15 = Math.min(100, Math.min(v4 || 0, v12));
v15 = Math.max(this.last_pcnt, v15);
this.last_pcnt = v15;
v11._xscale = v15;
options.ad_progress(v15);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {'id': 'hostLoadPcnt', 'pcnt': v4}, clip._mochiad._containerLCName);
if (v4 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var v8 = v13.getBytesTotal();
if (v8 > 0 || typeof v8 == 'undefined') {
chk.showing = true;
chk.started = getTimer();
} else {
if (v7 > chk.ad_timeout && v4 == 100) {
options.ad_failed();
v5 = true;
}
}
}
if (v7 > chk.ad_msec) {
v5 = true;
}
if (v6 > 0 && v9 >= v6 && v5) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
};
v1.showClickAwayAd = function (options) {
var v10 = {'clip': _root, 'ad_timeout': 2000, 'fadeout_time': 250, 'regpt': 'o', 'method': 'showClickAwayAd', 'res': '300x250', 'no_bg': true, 'ad_started': function () {}, 'ad_finished': function () {}, 'ad_loaded': function (width, height) {}, 'ad_failed': function () {
trace('[MochiAd] Couldn\'t load an ad, make sure that your game\'s local security sandbox is configured for Access Network Only and that you are not using ad blocking software');
}, 'ad_skipped': function () {}};
options = mochi.as2.MochiAd._parseOptions(options, v10);
var clip = options.clip;
var v9 = options.ad_timeout;
delete options.ad_timeout;
if (!mochi.as2.MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return undefined;
}
options.ad_started();
var v3 = clip._mochiad;
v3.onUnload = function () {
options.ad_finished();
};
var v5 = mochi.as2.MochiAd._getRes(options);
var v11 = v5[0];
var v8 = v5[1];
v3._x = v11 * 0.5;
v3._y = v8 * 0.5;
var chk = v3.createEmptyMovieClip('_mochiad_wait', 3);
chk.ad_timeout = v9;
chk.started = getTimer();
chk.showing = false;
v3.lc.adLoaded = options.ad_loaded;
v3.lc.adSkipped = options.ad_skipped;
v3.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
v3.rpcTestFn = function (s) {
trace('[MOCHIAD rpcTestFn] ' + s);
return s;
};
var v21 = false;
chk.onEnterFrame = function () {
var v5 = this._parent._mochiad_ctr;
var v4 = getTimer() - this.started;
var v2 = false;
if (!chk.showing) {
var v3 = v5.getBytesTotal();
if (v3 > 0 || typeof v3 == 'undefined') {
v2 = true;
chk.showing = true;
chk.started = getTimer();
} else {
if (v4 > chk.ad_timeout) {
options.ad_failed();
v2 = true;
}
}
}
if (v2) {
delete this.onEnterFrame;
}
};
};
v1.showInterLevelAd = function (options) {
var v13 = {'clip': _root, 'ad_timeout': 2000, 'fadeout_time': 250, 'regpt': 'o', 'method': 'showTimedAd', 'ad_started': function () {
this.clip.stop();
}, 'ad_finished': function () {
this.clip.play();
}, 'ad_failed': function () {
trace('[MochiAd] Couldn\'t load an ad, make sure that your game\'s local security sandbox is configured for Access Network Only and that you are not using ad blocking software');
}, 'ad_loaded': function (width, height) {}, 'ad_skipped': function () {}};
options = mochi.as2.MochiAd._parseOptions(options, v13);
var clip = options.clip;
var v10 = 11000;
var v12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!mochi.as2.MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return undefined;
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var v5 = mochi.as2.MochiAd._getRes(options);
var v14 = v5[0];
var v11 = v5[1];
mc._x = v14 * 0.5;
mc._y = v11 * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk.ad_msec = v10;
chk.ad_timeout = v12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var v2 = 100 * (1 - (getTimer() - this.fadeout_start) / this.fadeout_time);
if (v2 > 0) {
this._parent._alpha = v2;
} else {
var v3 = this._parent._parent;
mochi.as2.MochiAd.unload(v3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var v2 = this.mc._mochiad_wait;
v2.server_control = true;
v2.started = getTimer();
v2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace('[MOCHIAD rpcTestFn] ' + s);
return s;
};
chk.onEnterFrame = function () {
var v5 = this._parent._mochiad_ctr;
var v4 = getTimer() - this.started;
var v2 = false;
if (!chk.showing) {
var v3 = v5.getBytesTotal();
if (v3 > 0 || typeof v3 == 'undefined') {
chk.showing = true;
chk.started = getTimer();
} else {
if (v4 > chk.ad_timeout) {
options.ad_failed();
v2 = true;
}
}
}
if (v4 > chk.ad_msec) {
v2 = true;
}
if (v2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
};
v1.showPreloaderAd = function (options) {
trace('[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0');
mochi.as2.MochiAd.showPreGameAd(options);
};
v1.showTimedAd = function (options) {
trace('[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0');
mochi.as2.MochiAd.showInterLevelAd(options);
};
v1._allowDomains = function (server) {
var v1 = ((server.split('/'))[2].split(':'))[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain('*');
System.security.allowDomain(v1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain('*');
System.security.allowInsecureDomain(v1);
}
}
return v1;
};
v1.load = function (options) {
var v12 = {'clip': _root, 'server': 'http://x.mochiads.com/srv/1/', 'method': 'load', 'depth': 10333, 'id': '_UNKNOWN_'};
options = mochi.as2.MochiAd._parseOptions(options, v12);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = mochi.as2.MochiAd.getVersion();
var v6 = options.clip;
if (!mochi.as2.MochiAd._isNetworkAvailable()) {
return null;
}
if (v6._mochiad_loaded) {
return null;
}
var v11 = options.depth;
delete options.depth;
var mc = v6.createEmptyMovieClip('_mochiad', v11);
var v10 = mochi.as2.MochiAd._getRes(options);
options.res = v10[0] + 'x' + v10[1];
options.server += options.id;
delete options.id;
v6._mochiad_loaded = true;
if (v6._url.indexOf('http') != 0) {
trace('[MochiAd] NOTE: Security Sandbox Violation errors below are normal');
}
var v4 = mc.createEmptyMovieClip('_mochiad_ctr', 1);
for (var v7 in options) {
v4[v7] = options[v7];
}
var v9 = v4.server;
delete v4.server;
var v13 = mochi.as2.MochiAd._allowDomains(v9);
mc.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var v5 = new Object();
var v8 = ['', Math.floor((new Date()).getTime()), random(999999)].join('_');
v5.mc = mc;
v5.name = v8;
v5.hostname = v13;
v5.allowDomain = function (d) {
return true;
};
v5.allowInsecureDomain = v5.allowDomain;
v5.connect(v8);
mc.lc = v5;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
v4.lc = v8;
v4.st = getTimer();
if (!options.skip) {
v4.loadMovie(v9 + '.swf', 'POST');
}
return mc;
};
v1.unload = function (clip) {
if (typeof clip == 'undefined') {
clip = _root;
}
if (clip.clip && clip.clip._mochiad) {
clip = clip.clip;
}
if (!clip._mochiad) {
return false;
}
mochi.as2.MochiAd.containerNotify(clip, {'id': 'unload'}, clip._mochiad._containerLCName);
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return true;
};
v1._isNetworkAvailable = function () {
if (System.security) {
var v1 = System.security;
if (v1.sandboxType == 'localWithFile') {
return false;
}
}
return true;
};
v1._getRes = function (options) {
var v3 = options.clip.getBounds();
var v2 = 0;
var v1 = 0;
if (typeof options.res != 'undefined') {
var v4 = options.res.split('x');
v2 = parseFloat(v4[0]);
v1 = parseFloat(v4[1]);
} else {
v2 = v3.xMax - v3.xMin;
v1 = v3.yMax - v3.yMin;
}
if (v2 == 0 || v1 == 0) {
v2 = Stage.width;
v1 = Stage.height;
}
return [v2, v1];
};
v1._parseOptions = function (options, defaults) {
var v4 = {};
for (var v8 in defaults) {
v4[v8] = defaults[v8];
}
if (options) {
for (v8 in options) {
v4[v8] = options[v8];
}
}
if (_root.mochiad_options) {
var v5 = _root.mochiad_options.split('&');
var v2 = 0;
while (v2 < v5.length) {
var v3 = v5[v2].split('=');
v4[unescape(v3[0])] = unescape(v3[1]);
++v2;
}
}
if (v4.id == 'test') {
trace('[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!');
}
return v4;
};
v1.rpc = function (clip, callbackID, arg) {
switch (arg.id) {
case 'setValue':
mochi.as2.MochiAd.setValue(clip, arg.objectName, arg.value);
break;
case 'getValue':
var v4 = mochi.as2.MochiAd.getValue(clip, arg.objectName);
mochi.as2.MochiAd.containerRpcResult(clip, callbackID, v4, clip._mochiad._containerLCName);
break;
case 'runMethod':
var v3 = mochi.as2.MochiAd.runMethod(clip, arg.method, arg.args);
mochi.as2.MochiAd.containerRpcResult(clip, callbackID, v3, clip._mochiad._containerLCName);
break;
default:
trace('[mochiads rpc] unknown rpc id: ' + arg.id);
}
};
v1.setValue = function (base, objectName, value) {
var v2 = objectName.split('.');
var v1;
v1 = 0;
while (v1 < v2.length - 1) {
if (base[v2[v1]] == undefined || base[v2[v1]] == null) {
return undefined;
}
base = base[v2[v1]];
++v1;
}
base[v2[v1]] = value;
};
v1.getValue = function (base, objectName) {
var v2 = objectName.split('.');
var v1;
v1 = 0;
while (v1 < v2.length - 1) {
if (base[v2[v1]] == undefined || base[v2[v1]] == null) {
return undefined;
}
base = base[v2[v1]];
++v1;
}
return base[v2[v1]];
};
v1.runMethod = function (base, methodName, argsArray) {
var v2 = methodName.split('.');
var v1;
v1 = 0;
while (v1 < v2.length - 1) {
if (base[v2[v1]] == undefined || base[v2[v1]] == null) {
return undefined;
}
base = base[v2[v1]];
++v1;
}
if (typeof base[v2[v1]] == 'function') {
return base[v2[v1]].apply(base, argsArray);
} else {
return undefined;
}
};
v1.containerNotify = function (clip, args, lcName) {
var v1 = clip._mochiad._mochiad_ctr.ad.app;
if (v1.notify) {
v1.notify(args);
} else {
(new LocalConnection()).send(lcName, 'notify', args);
}
};
v1.containerRpcResult = function (clip, callbackID, val, lcName) {
var v1 = clip._mochiad._mochiad_ctr.ad.app;
if (v1.rpcResult) {
v1.rpcResult(callbackID, val);
} else {
(new LocalConnection()).send(lcName, 'rpcResult', callbackID, val);
}
};
ASSetPropFlags(mochi.as2.MochiAd.prototype, null, 1);
}
#endinitclip
}
movieClip 337 __Packages.mochi.as2.MochiEventDispatcher {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiEventDispatcher) {
var v1 = function () {
this.eventTable = {};
};
mochi.as2.MochiEventDispatcher = v1;
var v2 = v1.prototype;
v2.buildDelegate = function (thisObject, thatObject) {
var v2 = {'thisObject': thisObject, 'thatObject': thatObject};
if (thatObject != undefined) {
var funct = (typeof thatObject == 'string') ? thisObject[thatObject] : thatObject;
v2.delegate = function (args) {
funct.call(thisObject, args);
};
return v2;
}
v2.delegate = thisObject;
return v2;
};
v2.compareDelegate = function (d_A, d_B) {
if (d_A.thisObject != d_B.thisObject || d_A.thatObject != d_B.thatObject) {
return false;
}
return true;
};
v2.addEventListener = function (event, thisObject, thatObject) {
this.removeEventListener(event, thisObject, thatObject);
this.eventTable[event].push(this.buildDelegate(thisObject, thatObject));
};
v2.removeEventListener = function (event, thisObject, thatObject) {
var v3 = this.buildDelegate(thisObject, thatObject);
if (this.eventTable[event] == undefined) {
this.eventTable[event] = [];
return undefined;
}
for (var v4 in this.eventTable[event]) {
if (!this.compareDelegate(this.eventTable[event][v4], v3)) {
continue;
}
this.eventTable[event].splice(Number(v4), 1);
}
};
v2.triggerEvent = function (event, args) {
if (this.eventTable[event] == undefined) {
return undefined;
}
for (var v4 in this.eventTable[event]) {
this.eventTable[event][v4].delegate(args);
}
};
ASSetPropFlags(mochi.as2.MochiEventDispatcher.prototype, null, 1);
}
#endinitclip
}
movieClip 338 __Packages.mochi.as2.MochiServices {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiServices) {
var v1 = function () {};
mochi.as2.MochiServices = v1;
var v2 = v1.prototype;
v1.__get__id = function () {
return mochi.as2.MochiServices._id;
};
v1.__get__clip = function () {
return mochi.as2.MochiServices._container;
};
v1.__get__childClip = function () {
return mochi.as2.MochiServices._clip;
};
v1.getVersion = function () {
return '3.9.1 as2';
};
v1.allowDomains = function (server) {
var v1 = ((server.split('/'))[2].split(':'))[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain('*');
System.security.allowDomain(v1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain('*');
System.security.allowInsecureDomain(v1);
}
}
return v1;
};
v1.__get__isNetworkAvailable = function () {
if (System.security) {
var v1 = System.security;
if (v1.sandboxType == 'localWithFile') {
return false;
}
}
return true;
};
v1.__set__comChannelName = function (val) {
if (val != undefined) {
if (val.length > 3) {
mochi.as2.MochiServices._sendChannelName = val + '_fromgame';
mochi.as2.MochiServices.initComChannels();
}
}
return mochi.as2.MochiServices.__get__comChannelName();
};
v1.__get__connected = function () {
return mochi.as2.MochiServices._connected;
};
v1.connect = function (id, clip, onError) {
mochi.as2.MochiServices.warnID(id, false);
if (!mochi.as2.MochiServices._connected && mochi.as2.MochiServices._clip == undefined) {
trace('MochiServices Connecting...');
mochi.as2.MochiServices._connecting = true;
mochi.as2.MochiServices.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);
};
}
}
};
v1.disconnect = function () {
if (mochi.as2.MochiServices._connected || mochi.as2.MochiServices._connecting) {
mochi.as2.MochiServices._connected = false;
mochi.as2.MochiServices._connecting = mochi.as2.MochiServices._connected;
mochi.as2.MochiServices.flush(true);
if (mochi.as2.MochiServices._clip != undefined) {
mochi.as2.MochiServices._clip.removeMovieClip();
delete mochi.as2.MochiServices._clip;
}
mochi.as2.MochiServices._listenChannel.close();
}
};
v1.init = function (id, clip) {
mochi.as2.MochiServices._id = id;
if (clip != undefined) {
mochi.as2.MochiServices._container = clip;
} else {
mochi.as2.MochiServices._container = _root;
}
mochi.as2.MochiServices.loadCommunicator(id, mochi.as2.MochiServices._container);
};
v1.loadCommunicator = function (id, clip) {
var v6 = '_mochiservices_com_' + id;
var v5 = new MovieClipLoader();
var v3 = {};
if (mochi.as2.MochiServices._clip != null) {
return mochi.as2.MochiServices._clip;
}
if (!mochi.as2.MochiServices.__get__isNetworkAvailable()) {
return null;
}
if ((mochi.as2.MochiServices.urlOptions()).servURL) {
mochi.as2.MochiServices._servURL = (mochi.as2.MochiServices.urlOptions()).servURL;
}
var v4 = mochi.as2.MochiServices._servURL + mochi.as2.MochiServices._services;
if ((mochi.as2.MochiServices.urlOptions()).servicesURL) {
v4 = (mochi.as2.MochiServices.urlOptions()).servicesURL;
}
mochi.as2.MochiServices.allowDomains(v4);
mochi.as2.MochiServices._clip = clip.createEmptyMovieClip(v6, 10336, false);
mochi.as2.MochiServices._listenChannelName += Math.floor((new Date()).getTime()) + '_' + Math.floor(Math.random() * 99999);
mochi.as2.MochiServices.listen();
if (v3.waitInterval != null) {
clearInterval(v3.waitInterval);
}
v3.onLoadError = mochi.as2.MochiServices.loadError;
v3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
v3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
v3.startTime = getTimer();
v3.wait = function () {
if (getTimer() - this.startTime > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ['IOError']);
}
clearInterval(this.waitInterval);
}
};
v3.waitInterval = setInterval(v3, 'wait', 1000);
v5.addListener(v3);
v5.loadClip(v4 + '?listenLC=' + mochi.as2.MochiServices._listenChannelName + '&mochiad_options=' + escape(_root.mochiad_options) + '&api_version=' + mochi.as2.MochiServices.getVersion(), mochi.as2.MochiServices._clip);
mochi.as2.MochiServices._sendChannel = new LocalConnection();
mochi.as2.MochiServices._sendChannel._queue = [];
return mochi.as2.MochiServices._clip;
};
v1.loadError = function (target_mc, errorCode, httpStatus) {
trace('MochiServices could not load.');
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, [errorCode]);
};
v1.onStatus = function (infoObject) {
if (infoObject.level !== 'error') {
} else {
mochi.as2.MochiServices._connected = false;
mochi.as2.MochiServices._listenChannel.connect(mochi.as2.MochiServices._listenChannelName);
}
};
v1.listen = function () {
mochi.as2.MochiServices._listenChannel = new LocalConnection();
mochi.as2.MochiServices._listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
mochi.as2.MochiServices._listenChannel.allowDomain = function (d) {
return true;
};
mochi.as2.MochiServices._listenChannel.allowInsecureDomain = mochi.as2.MochiServices._listenChannel.allowDomain;
mochi.as2.MochiServices._listenChannel._nextcallbackID = 0;
mochi.as2.MochiServices._listenChannel._callbacks = {};
mochi.as2.MochiServices._listenChannel.connect(mochi.as2.MochiServices._listenChannelName);
trace('Waiting for MochiAds services to connect...');
};
v1.initComChannels = function () {
if (!mochi.as2.MochiServices._connected) {
mochi.as2.MochiServices._sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', {'methodName': 'handshakeDone'});
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', {'methodName': 'registerGame', 'id': mochi.as2.MochiServices._id, 'version': mochi.as2.MochiServices.getVersion()});
mochi.as2.MochiServices._listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
mochi.as2.MochiServices._listenChannel.onReceive = function (pkg) {
var v5 = pkg.callbackID;
var v4 = this._callbacks[v5];
if (!v4) {
return undefined;
}
var v2 = v4.callbackMethod;
var v3 = v4.callbackObject;
if (v3 && typeof v2 == 'string') {
v2 = v3[v2];
}
if (v2 != undefined) {
v2.apply(v3, pkg.args);
}
delete this._callbacks[v5];
};
mochi.as2.MochiServices._listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case 'services':
mochi.as2.MochiServices.triggerEvent(pkg.event, pkg.args);
break;
case 'events':
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case 'coins':
mochi.as2.MochiCoins.triggerEvent(pkg.event, pkg.args);
break;
case 'social':
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
}
};
mochi.as2.MochiServices._listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ['IOError']);
};
trace('[SERVICES_API] connected!');
mochi.as2.MochiServices._connecting = false;
mochi.as2.MochiServices._connected = true;
while (mochi.as2.MochiServices._sendChannel._queue.length > 0) {
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', mochi.as2.MochiServices._sendChannel._queue.shift());
}
}
};
v1.flush = function (error) {
var v1;
var v2;
while (mochi.as2.MochiServices._sendChannel._queue.length > 0) {
v1 = mochi.as2.MochiServices._sendChannel._queue.shift();
false;
if (v1.callbackID != null) {
v2 = mochi.as2.MochiServices._listenChannel._callbacks[v1.callbackID];
}
delete mochi.as2.MochiServices._listenChannel._callbacks[v1.callbackID];
if (error) {
mochi.as2.MochiServices.handleError(v1.args, v2.callbackObject, v2.callbackMethod);
}
}
};
v1.handleError = function (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);
}
}
}
};
v1.send = function (methodName, args, callbackObject, callbackMethod) {
if (mochi.as2.MochiServices._connected) {
mochi.as2.MochiServices._sendChannel.send(mochi.as2.MochiServices._sendChannelName, 'onReceive', {'methodName': methodName, 'args': args, 'callbackID': mochi.as2.MochiServices._listenChannel._nextcallbackID});
} else {
if (mochi.as2.MochiServices._clip == undefined || !mochi.as2.MochiServices._connecting) {
trace('Error: MochiServices not connected. Please call MochiServices.connect(). Function: ' + methodName);
mochi.as2.MochiServices.handleError(args, callbackObject, callbackMethod);
mochi.as2.MochiServices.flush(true);
return undefined;
} else {
mochi.as2.MochiServices._sendChannel._queue.push({'methodName': methodName, 'args': args, 'callbackID': mochi.as2.MochiServices._listenChannel._nextcallbackID});
}
}
mochi.as2.MochiServices._listenChannel._callbacks[mochi.as2.MochiServices._listenChannel._nextcallbackID] = {'callbackObject': callbackObject, 'callbackMethod': callbackMethod};
++mochi.as2.MochiServices._listenChannel._nextcallbackID;
};
v1.urlOptions = function () {
var v5 = {};
var v6;
if (_root._url.indexOf('mochiad_options') != -1) {
var v2 = _root._url.indexOf('mochiad_options') + 'mochiad_options'.length + 1;
v6 = _root._url.substr(v2, _root._url.length);
} else {
if (_root.mochiad_options) {
v6 = _root.mochiad_options;
}
}
if (v6) {
var v4 = _root.mochiad_options.split('&');
var v2 = 0;
while (v2 < v4.length) {
var v3 = v4[v2].split('=');
v5[unescape(v3[0])] = unescape(v3[1]);
++v2;
}
}
return v5;
};
v1.warnID = function (bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
trace('WARNING: ' + (leaderboard ? 'board' : 'game') + ' ID is not the appropriate length');
return undefined;
} else {
if (bid == '1e113c7239048b3f') {
if (leaderboard) {
trace('WARNING: Using testing board ID');
} else {
trace('WARNING: Using testing board ID as game ID');
}
return undefined;
} else {
if (bid == '84993a1de4031cd8') {
if (leaderboard) {
trace('WARNING: Using testing game ID as board ID');
} else {
trace('WARNING: Using testing game ID');
}
return undefined;
}
}
}
var v1 = 0;
while (v1 < bid.length) {
switch (bid.charAt(v1)) {
if (bid.charAt(v1) !== 'f') {
} else {
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case 'a':
break;
case 'b':
case 'c':
case 'd':
case 'e':
}
default:
trace('WARNING: Board ID contains illegal characters: ' + bid);
return undefined;
}
++v1;
}
};
v1.addLinkEvent = function (url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var v2 = new Object();
v2.mav = mochi.as2.MochiServices.getVersion();
v2.swfv = btn.getSWFVersion() || 6;
v2.swfurl = btn._url;
v2.fv = System.capabilities.version;
v2.os = System.capabilities.os;
v2.lang = System.capabilities.language;
v2.scres = System.capabilities.screenResolutionX + 'x' + System.capabilities.screenResolutionY;
var s = '?';
var v3 = 0;
for (var v6 in v2) {
if (v3 != 0) {
s += '&';
}
++v3;
s = s + v6 + '=' + escape(v2[v6]);
}
if (!(mochi.as2.MochiServices.netupAttempted || mochi.as2.MochiServices._connected)) {
var ping = btn.createEmptyMovieClip('ping', 777);
var v7 = btn.createEmptyMovieClip('nettest', 778);
mochi.as2.MochiServices.netupAttempted = true;
ping.loadMovie('http://link.mochiads.com/linkping.swf?t=' + getTimer());
v7.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 v4 = btn.createEmptyMovieClip('clk', 1001);
v4._alpha = 0;
v4.beginFill(1044735);
v4.moveTo(0, 0);
v4.lineTo(0, btn._height);
v4.lineTo(btn._width, btn._height);
v4.lineTo(btn._width, 0);
v4.lineTo(0, 0);
v4.endFill();
v4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL(url + s, '_blank');
} else {
getURL(burl, '_blank');
}
if (onClick != undefined) {
onClick();
}
};
};
v1.setContainer = function (clip) {};
v1.stayOnTop = function (clip) {};
v1.addEventListener = function (eventType, thisObject, thatObject) {
mochi.as2.MochiServices._dispatcher.addEventListener(eventType, thisObject, thatObject);
};
v1.triggerEvent = function (eventType, args) {
mochi.as2.MochiServices._dispatcher.triggerEvent(eventType, args);
};
v1.removeEventListener = function (eventType, thisObject, thatObject) {
mochi.as2.MochiServices._dispatcher.removeEventListener(eventType, thisObject, thatObject);
};
v1.CONNECTED = 'onConnected';
v1._servURL = 'http://www.mochiads.com/static/lib/services/';
v1._services = 'services.swf';
v1._mochiLC = 'MochiLC.swf';
v1._listenChannelName = '__ms_';
v1._connecting = false;
v1._connected = false;
v1.netup = true;
v1.netupAttempted = false;
v1._dispatcher = new mochi.as2.MochiEventDispatcher();
v1.addProperty('childClip', v1.__get__childClip, function () {});
v1.addProperty('clip', v1.__get__clip, function () {});
v1.addProperty('comChannelName', function () {}, v1.__set__comChannelName);
v1.addProperty('connected', v1.__get__connected, function () {});
v1.addProperty('id', v1.__get__id, function () {});
v1.addProperty('isNetworkAvailable', v1.__get__isNetworkAvailable, function () {});
ASSetPropFlags(mochi.as2.MochiServices.prototype, null, 1);
}
#endinitclip
}
movieClip 339 __Packages.mochi.as2.MochiEvents {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiEvents) {
var v1 = function () {};
mochi.as2.MochiEvents = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return mochi.as2.MochiServices.getVersion();
};
v1.startSession = function (achievementID) {
mochi.as2.MochiServices.send('events_beginSession', {'achievementID': achievementID}, null, null);
};
v1.setNotifications = function (clip, style) {
var v2 = {};
for (var v3 in style) {
v2[v3] = style[v3];
}
v2.clip = clip;
mochi.as2.MochiServices.send('events_setNotifications', v2, null, null);
};
v1.addEventListener = function (eventType, thisObject, thatObject) {
mochi.as2.MochiEvents._dispatcher.addEventListener(eventType, thisObject, thatObject);
};
v1.triggerEvent = function (eventType, args) {
mochi.as2.MochiEvents._dispatcher.triggerEvent(eventType, args);
};
v1.removeEventListener = function (eventType, thisObject, thatObject) {
mochi.as2.MochiEvents._dispatcher.removeEventListener(eventType, thisObject, thatObject);
};
v1.startPlay = function (tag) {
if (tag == undefined) {
tag = 'gameplay';
}
mochi.as2.MochiServices.send('events_setRoundID', {'tag': String(tag)}, null, null);
};
v1.endPlay = function () {
mochi.as2.MochiServices.send('events_clearRoundID', null, null, null);
};
v1.trackEvent = function (tag, value) {
mochi.as2.MochiServices.send('events_trackEvent', {'tag': tag, 'value': value}, null, null);
};
v1.ACHIEVEMENT_RECEIVED = 'AchievementReceived';
v1.ALIGN_TOP_LEFT = 'ALIGN_TL';
v1.ALIGN_TOP = 'ALIGN_T';
v1.ALIGN_TOP_RIGHT = 'ALIGN_TR';
v1.ALIGN_LEFT = 'ALIGN_L';
v1.ALIGN_CENTER = 'ALIGN_C';
v1.ALIGN_RIGHT = 'ALIGN_R';
v1.ALIGN_BOTTOM_LEFT = 'ALIGN_BL';
v1.ALIGN_BOTTOM = 'ALIGN_B';
v1.ALIGN_BOTTOM_RIGHT = 'ALIGN_BR';
v1.FORMAT_SHORT = 'ShortForm';
v1.FORMAT_LONG = 'LongForm';
v1._dispatcher = new mochi.as2.MochiEventDispatcher();
ASSetPropFlags(mochi.as2.MochiEvents.prototype, null, 1);
}
#endinitclip
}
movieClip 340 __Packages.mochi.as2.MochiCoins {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiCoins) {
var v1 = function () {};
mochi.as2.MochiCoins = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return mochi.as2.MochiServices.getVersion();
};
v1.showStore = function (options) {
mochi.as2.MochiServices.send('coins_showStore', {'options': options}, null, null);
};
v1.showItem = function (options) {
if (options == undefined || typeof options.item != 'string') {
trace('ERROR: showItem call must pass an Object with an item key');
return undefined;
}
mochi.as2.MochiServices.send('coins_showItem', {'options': options}, null, null);
};
v1.showVideo = function (options) {
if (options == undefined || typeof options.item != 'string') {
trace('ERROR: showVideo call must pass an Object with an item key');
return undefined;
}
mochi.as2.MochiServices.send('coins_showVideo', {'options': options}, null, null);
};
v1.getStoreItems = function () {
mochi.as2.MochiServices.send('coins_getStoreItems');
};
v1.requestFunding = function (properties) {
mochi.as2.MochiServices.send('social_requestFunding', properties);
};
v1.addEventListener = function (eventType, delegate) {
mochi.as2.MochiCoins._dispatcher.addEventListener(eventType, delegate);
};
v1.triggerEvent = function (eventType, args) {
mochi.as2.MochiCoins._dispatcher.triggerEvent(eventType, args);
};
v1.removeEventListener = function (eventType, delegate) {
mochi.as2.MochiCoins._dispatcher.removeEventListener(eventType, delegate);
};
v1.STORE_SHOW = 'StoreShow';
v1.STORE_HIDE = 'StoreHide';
v1.ITEM_OWNED = 'ItemOwned';
v1.ITEM_NEW = 'ItemNew';
v1.STORE_ITEMS = 'StoreItems';
v1.ERROR = 'Error';
v1.IO_ERROR = 'IOError';
v1.NO_USER = 'NoUser';
v1._dispatcher = new mochi.as2.MochiEventDispatcher();
ASSetPropFlags(mochi.as2.MochiCoins.prototype, null, 1);
}
#endinitclip
}
movieClip 341 __Packages.mochi.as2.MochiSocial {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiSocial) {
var v1 = function () {};
mochi.as2.MochiSocial = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return mochi.as2.MochiServices.getVersion();
};
v1.showLoginWidget = function (options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send('social_showLoginWidget', {'options': options});
};
v1.hideLoginWidget = function () {
mochi.as2.MochiServices.send('social_hideLoginWidget');
};
v1.requestLogin = function (properties) {
mochi.as2.MochiServices.send('social_requestLogin', properties);
};
v1.getFriendsList = function (properties) {
mochi.as2.MochiServices.send('social_getFriendsList', properties);
};
v1.postToStream = function (properties) {
mochi.as2.MochiServices.send('social_postToStream', properties);
};
v1.inviteFriends = function (properties) {
mochi.as2.MochiServices.send('social_inviteFriends', properties);
};
v1.requestFan = function (properties) {
mochi.as2.MochiServices.send('social_requestFan', properties);
};
v1.saveUserProperties = function (properties) {
mochi.as2.MochiServices.send('social_saveUserProperties', properties);
};
v1.addEventListener = function (eventType, delegate) {
mochi.as2.MochiSocial._dispatcher.addEventListener(eventType, delegate);
};
v1.triggerEvent = function (eventType, args) {
mochi.as2.MochiSocial._dispatcher.triggerEvent(eventType, args);
};
v1.removeEventListener = function (eventType, delegate) {
mochi.as2.MochiSocial._dispatcher.removeEventListener(eventType, delegate);
};
v1.LOGGED_IN = 'LoggedIn';
v1.LOGGED_OUT = 'LoggedOut';
v1.LOGIN_SHOW = 'LoginShow';
v1.LOGIN_HIDE = 'LoginHide';
v1.LOGIN_SHOWN = 'LoginShown';
v1.PROFILE_SHOW = 'ProfileShow';
v1.PROFILE_HIDE = 'ProfileHide';
v1.PROPERTIES_SAVED = 'PropertySaved';
v1.WIDGET_LOADED = 'WidgetLoaded';
v1.FRIEND_LIST = 'FriendsList';
v1.PROFILE_DATA = 'ProfileData';
v1.GAMEPLAY_DATA = 'GameplayData';
v1.ACTION_CANCELED = 'onCancel';
v1.ACTION_COMPLETE = 'onComplete';
v1.USER_INFO = 'UserInfo';
v1.ERROR = 'Error';
v1.IO_ERROR = 'IOError';
v1.NO_USER = 'NoUser';
v1.PROPERTIES_SIZE = 'PropertiesSize';
v1._dispatcher = new mochi.as2.MochiEventDispatcher();
ASSetPropFlags(mochi.as2.MochiSocial.prototype, null, 1);
}
#endinitclip
}
movieClip 342 __Packages.mochi.as2.MochiScores {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiScores) {
var v1 = function () {};
mochi.as2.MochiScores = v1;
var v2 = v1.prototype;
v1.setBoardID = function (boardID) {
mochi.as2.MochiServices.warnID(boardID, true);
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send('scores_setBoardID', {'boardID': boardID});
};
v1.showLeaderboard = function (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 v1 = Number(options.score);
if (isNaN(v1)) {
trace('ERROR: Submitted score \'' + options.score + '\' will be rejected, score is \'Not a Number\'');
} else {
if (v1 == Number.NEGATIVE_INFINITY || v1 == Number.POSITIVE_INFINITY) {
trace('ERROR: Submitted score \'' + options.score + '\' will be rejected, score is an infinite');
} else {
if (Math.floor(v1) != v1) {
trace('WARNING: Submitted score \'' + options.score + '\' will be truncated');
}
options.score = v1;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
(mochi.as2.MochiServices.__get__clip()).stop();
}
if (options.onClose != null) {
mochi.as2.MochiScores.onClose = options.onClose;
} else {
mochi.as2.MochiScores.onClose = function () {
(mochi.as2.MochiServices.__get__clip()).play();
};
}
if (options.onError != null) {
mochi.as2.MochiScores.onError = options.onError;
} else {
mochi.as2.MochiScores.onError = mochi.as2.MochiScores.onClose;
}
if (options.boardID == null) {
if (mochi.as2.MochiScores.boardID != null) {
options.boardID = mochi.as2.MochiScores.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, mochi.as2.MochiScores.doClose);
};
v1.closeLeaderboard = function () {
mochi.as2.MochiServices.send('scores_closeLeaderboard');
};
v1.getPlayerInfo = function (callbackObj, callbackMethod) {
mochi.as2.MochiServices.send('scores_getPlayerInfo', null, callbackObj, callbackMethod);
};
v1.submit = function (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);
};
v1.requestList = function (callbackObj, callbackMethod) {
mochi.as2.MochiServices.send('scores_requestList', null, callbackObj, callbackMethod);
};
v1.scoresArrayToObjects = function (scores) {
var v5 = {};
var v1;
var v4;
var v2;
var v6;
for (var v8 in scores) {
if (typeof scores[v8] == 'object') {
if (scores[v8].cols != null && scores[v8].rows != null) {
v5[v8] = [];
v2 = scores[v8];
v4 = 0;
while (v4 < v2.rows.length) {
v6 = {};
v1 = 0;
while (v1 < v2.cols.length) {
v6[v2.cols[v1]] = v2.rows[v4][v1];
++v1;
}
v5[v8].push(v6);
++v4;
}
} else {
v5[v8] = {};
for (var v7 in scores[v8]) {
v5[v8][v7] = scores[v8][v7];
}
}
} else {
v5[v8] = scores[v8];
}
}
return v5;
};
v1.doClose = function (args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = 'IOError';
}
mochi.as2.MochiScores.onError.apply(null, [args.errorCode]);
} else {
mochi.as2.MochiScores.onClose.apply();
}
};
ASSetPropFlags(mochi.as2.MochiScores.prototype, null, 1);
}
#endinitclip
}
movieClip 343 __Packages.mochi.as2.MochiDigits {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiDigits) {
var v1 = function (digit, index) {
this.Encoder = 0;
this.setValue(digit, index);
};
mochi.as2.MochiDigits = v1;
var v2 = v1.prototype;
v2.__get__value = function () {
return Number(this.toString());
};
v2.__set__value = function (v) {
this.setValue(v);
return this.__get__value();
};
v2.addValue = function (v) {
this.value += v;
};
v2.setValue = function (digit, index) {
var v3 = digit.toString();
if (index == undefined || isNaN(index)) {
index = 0;
}
this.Fragment = v3.charCodeAt(index++) ^ this.Encoder;
if (index < v3.length) {
this.Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
this.Sibling = null;
}
this.reencode();
};
v2.reencode = function () {
var v2 = int(2147483647 * Math.random());
this.Fragment ^= v2 ^ this.Encoder;
this.Encoder = v2;
};
v2.toString = function () {
var v2 = String.fromCharCode(this.Fragment ^ this.Encoder);
return (this.Sibling != null) ? v2.concat(this.Sibling.toString()) : v2;
};
v2.addProperty('value', v2.__get__value, v2.__set__value);
ASSetPropFlags(mochi.as2.MochiDigits.prototype, null, 1);
}
#endinitclip
}
frame 2 {
}
frame 2 {
stop();
_global.VolumeSet = 80;
fscommand('showmenu', 'false');
_global.cDepth = 1;
nB = 10;
i = 0;
while (i < nB) {
a = Math.ceil(Math.random() * 2);
if (a == 1) {
block = this.attachMovie('blockOne', 'theBlock' + i, _global.cDepth);
++_global.cDepth;
} else {
block = this.attachMovie('blockTwo', 'theBlock' + i, _global.cDepth);
++_global.cDepth;
}
block._x = -100;
++i;
}
counter = 0;
index = 0;
this.onEnterFrame = function () {
if (Key.isDown(13)) {
i = 0;
while (i < 10) {
removeMovieClip(this['theBlock' + i]);
++i;
}
_global.PlayingGame = true;
this.theCredits.removeMovieClip();
this.gotoAndStop('gameFrame');
this.theOptions.removeMovieClip();
}
if (counter % 20 == 0) {
this['theBlock' + index]._x = Math.random() * 530 + 10;
this['theBlock' + index]._y = -16;
this['theBlock' + index].theSpeed = Math.random() * 4 + 3;
this['theBlock' + index].gotoAndStop(Math.ceil(Math.random() * 8));
++index;
if (index > 5) {
index = 0;
}
}
i = 0;
while (i < nB) {
this['theBlock' + i]._y += this['theBlock' + i].theSpeed;
++i;
}
++counter;
};
}
movieClip 234 {
}
movieClip 235 {
}
movieClip 239 {
}
movieClip 240 {
}
button 242 {
on (release) {
getURL('http://www.unboundedgames.com/', '_blank');
}
}
movieClip 244 {
}
movieClip 246 {
}
movieClip 247 {
instance of movieClip 244 {
onClipEvent (enterFrame) {
this._rotation += 3;
}
}
instance of movieClip 246 {
onClipEvent (enterFrame) {
this._rotation += 3;
}
}
}
movieClip 250 {
}
movieClip 251 {
}
movieClip 252 {
}
movieClip 253 {
}
button 258 {
on (release) {
getURL('http://cdn.mochiads.com/c/g/ethereal-celenite.zip', '_self');
}
}
button 263 {
on (press) {
i = 0;
while (i < 10) {
removeMovieClip(this._parent['theBlock' + i]);
++i;
}
_global.PlayingGame = true;
this._parent.theCredits.removeMovieClip();
this._parent.gotoAndStop('gameFrame');
this.removeMovieClip();
}
}
button 268 {
on (press) {
i = 0;
while (i < 10) {
removeMovieClip(this._parent['theBlock' + i]);
++i;
}
this._parent.theTitle.removeMovieClip();
this._parent.theCredits.removeMovieClip();
this._parent.gotoAndStop('instructionsFrame');
this.removeMovieClip();
}
}
movieClip 269 {
}
instance theOptions of movieClip 269 {
onClipEvent (load) {
swapDepths(999999997);
}
}
movieClip 271 {
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 56 blockTwo {
onClipEvent (load) {
stop();
}
}
instance of movieClip 47 blockOne {
onClipEvent (load) {
stop();
}
}
}
movieClip 273 {
}
movieClip 275 {
}
movieClip 276 {
frame 1 {
this._parent.soun(2);
this.swapDepths(999999999);
this.X = this._x;
this.Y = this._y;
this.Speed = 35;
this.onEnterFrame = function () {
if (_global.PlayingGame) {
if (this._x > 8 || this._y > 8) {
this.R = this._parent.rotateTo(this, {'_x': 0, '_y': 0});
this._rotation = this.R;
this._parent.run(this);
this._rotation = 0;
this._xscale -= 2.5;
this._yscale -= 2.5;
}
}
if (_global.GameOver) {
this.removeMovieClip();
}
};
}
instance of movieClip 273 {
onClipEvent (load) {
swapDepths(999999998);
}
}
frame 25 {
this._parent.soun(3);
}
frame 31 {
stop();
}
}
movieClip 279 {
}
movieClip 280 {
}
movieClip 282 {
}
button 284 {
on (release) {
getURL('http://www.brokenmindgames.com/', '_blank');
}
}
frame 3 {
function drawBomb(typeOfBomb, inputX, inputY) {
theBomb = this.attachMovie('bomb', 'theBomb' + _global.cDepth, _global.cDepth);
++_global.cDepth;
theBomb.gotoAndStop(typeOfBomb);
theBomb._x = inputX * 16 + startingX;
theBomb._y = inputY * 16 + startingY;
theBomb.life = 0;
theBomb.onEnterFrame = function () {
--this.life;
if (this.life < 0) {
removeMovieClip(this);
}
};
}
function textFunction(inputText, inputX, inputY, inputSize, inputLife, inputFadeOut) {
outputText = this.attachMovie('generatedText', 'generatedText' + _global.cDepth, _global.cDepth);
++_global.cDepth;
outputText._x = 430 - Math.random() * 160;
outputText._y = 60 - Math.random() * 30;
outputText.life = inputLife;
outputText.fadeOut = inputFadeOut;
outputText._yscale = inputSize;
outputText._xscale = outputText._yscale;
outputText.theText.text = inputText;
outputText.onEnterFrame = function () {
--this.life;
if (this.life < 0) {
this._alpha -= this.fadeOut;
}
if (this._alpha < this.fadeOut + 1) {
removeMovieClip(this);
}
};
}
function newTextFunction(inputText1, inputText2, inputText3, iT1Size) {
if (iT1Size == undefined) {
iT1Size = 100;
}
midText = this.attachMovie('generatedText', 'midText' + _global.cDepth, _global.cDepth++);
midText._x = 275;
midText._y = 260;
midText.life = 21;
midText.fadeOut = 2.5;
midText.theText1._xscale = iT1Size;
midText.theText1._yscale = iT1Size;
midText.theText1.text = inputText1;
midText.theText2.text = inputText2;
midText.theText3.text = inputText3;
midText.onEnterFrame = function () {
--this.life;
if (this.life < 0) {
this._alpha -= this.fadeOut;
}
if (this._alpha < this.fadeOut + 1) {
this.removeMovieClip();
}
this._y -= 2;
};
}
function explodeHorizontal(theY) {
soun(9);
soun(7);
theDestroyed = 0;
j = 0;
while (j < gridWidth) {
if (grid[j][theY] < 5) {
blockExplode(j, theY);
grid[j][theY] = 5;
++theDestroyed;
if (this['block' + j + ',' + theY].hasBomb > 0) {
if (this['block' + j + ',' + theY].hasBomb == 1) {
this['block' + j + ',' + theY].hasBomb = 0;
explodeHorizontal(theY);
} else {
if (this['block' + j + ',' + theY].hasBomb == 2) {
this['block' + j + ',' + theY].hasBomb = 0;
explodeVertical(j);
} else {
if (this['block' + j + ',' + theY].hasBomb == 3) {
this['block' + j + ',' + theY].hasBomb = 0;
explodeSquare(j, theY);
}
}
}
}
}
++j;
}
_global.destroyed += theDestroyed;
drawHorizontalExplosion(theY);
}
function drawHorizontalExplosion(theY) {
currentExplosion = this.attachMovie('highlight2', 'explosionH' + _global.cDepth, _global.cDepth);
++_global.cDepth;
currentExplosion._y = theY * 16 + startingY;
currentExplosion._x = 600;
currentExplosion._width = 16;
currentExplosion._height = 900;
currentExplosion._rotation = 90;
currentExplosion.onEnterFrame = function () {
if (currentExplosion._alpha > 12) {
currentExplosion._alpha -= 7;
} else {
removeMovieClip(this);
}
};
}
function explodeVertical(theX) {
soun(9);
soun(7);
theDestroyed = 0;
k = 2;
while (k < gridHeight) {
if (grid[theX][k] < 5) {
blockExplode(theX, k);
grid[theX][k] = 5;
++theDestroyed;
if (this['block' + theX + ',' + k].hasBomb > 0) {
if (this['block' + theX + ',' + k].hasBomb == 1) {
this['block' + theX + ',' + k].hasBomb = 0;
explodeHorizontal(k);
} else {
if (this['block' + theX + ',' + k].hasBomb == 2) {
this['block' + theX + ',' + k].hasBomb = 0;
explodeVertical(theX);
} else {
if (this['block' + theX + ',' + k].hasBomb == 3) {
this['block' + theX + ',' + k].hasBomb = 0;
explodeSquare(theX, k);
}
}
}
}
}
++k;
}
_global.destroyed += theDestroyed;
drawVerticalExplosion(theX);
}
function drawVerticalExplosion(theX) {
currentExplosion = this.attachMovie('highlight2', 'explosionV' + _global.cDepth, _global.cDepth);
++_global.cDepth;
currentExplosion._y = 0;
currentExplosion._x = theX * 16 + startingX;
currentExplosion._width = 16;
currentExplosion._height = 500;
currentExplosion.onEnterFrame = function () {
if (currentExplosion._alpha > 12) {
currentExplosion._alpha -= 7;
} else {
removeMovieClip(this);
}
};
}
function explodeSquare(theX, theY) {
soun(8);
soun(3);
theDestroyed = 0;
j = theX - 2;
while (j <= theX + 2) {
k = theY - 2;
while (k <= theY + 2) {
if (grid[j][k] < 5) {
if (!(j == theX - 2 && k == theY - 2) && !(j == theX - 2 && k == theY + 2) && !(j == theX + 2 && k == theY - 2) && !(j == theX + 2 && k == theY + 2)) {
blockExplode(j, k);
grid[j][k] = 5;
++theDestroyed;
if (this['block' + j + ',' + k].hasBomb > 0) {
if (this['block' + j + ',' + k].hasBomb == 1) {
this['block' + j + ',' + k].hasBomb = 0;
explodeHorizontal(k);
} else {
if (this['block' + j + ',' + k].hasBomb == 2) {
this['block' + j + ',' + k].hasBomb = 0;
explodeVertical(j);
} else {
if (this['block' + j + ',' + k].hasBomb == 3) {
this['block' + j + ',' + k].hasBomb = 0;
explodeSquare(j, k);
}
}
}
}
}
}
++k;
}
++j;
}
_global.destroyed += theDestroyed;
drawSquareExplosion(theX, theY);
}
function drawSquareExplosion(theX, theY) {
currentExplosion = this.attachMovie('explosionSquare', 'explosionS' + _global.cDepth, _global.cDepth);
++_global.cDepth;
currentExplosion._y = theY * 16 + startingY;
currentExplosion._x = theX * 16 + startingX;
currentExplosion.onEnterFrame = function () {
if (currentExplosion._alpha > 12) {
currentExplosion._alpha -= 7;
} else {
removeMovieClip(this);
}
};
}
function gameOverFunction() {
gamePaused = true;
j = 0;
while (j < gridWidth) {
this['blockShift' + j].removeMovieClip();
k = 0;
while (k < gridHeight) {
this['block' + j + ',' + k].removeMovieClip();
++k;
}
++j;
}
i = 1;
while (i < 4) {
this['futureBlockUL' + i].removeMovieClip();
this['futureBlockUR' + i].removeMovieClip();
this['futureBlockLL' + i].removeMovieClip();
this['futureBlockLR' + i].removeMovieClip();
++i;
}
b = 0;
while (b < numberOfBombs + 1) {
this['bomb' + b].removeMovieClip();
++b;
}
this.sweep.removeMovieClip();
this.coverUpA.removeMovieClip();
this.coverUpB.removeMovieClip();
this.highlighter.removeMovieClip();
this.redThing.removeMovieClip();
q = 0;
while (q < gridWidth) {
this['lB' + q].removeMovieClip();
++q;
}
_global.PlayingGame = false;
_global.GameOver = true;
gotoAndStop('gameOverFrame');
}
function newGameOverFunction() {
if (firstTimeCalled != true) {
b = 0;
while (b < numberOfBombs + 1) {
this['bomb' + b].removeMovieClip();
++b;
}
firstTimeCalled = true;
newGameOverFunctionInit();
}
if (lastPhaseOfGameOver > 0) {
++lastPhaseOfGameOver;
if (lastPhaseOfGameOver > 40) {
gameOverFunction();
}
}
if (kkk < gridHeight) {
bitch = 0;
while (bitch < 4) {
if (grid[jjj][kkk] != 5) {
if (grid[jjj][2] == 5) {
pE = this.attachMovie('popExplosion', 'pE' + _global.cDepth, _global.cDepth++);
pE._x = this['block' + jjj + ',' + kkk]._x;
pE._y = this['block' + jjj + ',' + kkk]._y;
if (pE._x == 0) {
pE.removeMovieClip();
}
pE.onEnterFrame = function () {
this._alpha -= 6;
if (this._alpha < 10) {
this.removeMovieClip();
}
};
this['block' + jjj + ',' + kkk].hasBomb = 0;
oldVal = grid[jjj][kkk];
grid[jjj][kkk] = 5;
soun(10);
rr = Math.ceil(Math.random() * 2) + 0;
i = 0;
while (i < rr) {
pP = this.attachMovie('block8Particle', 'pP' + _global.cDepth, _global.cDepth++);
pP.gotoAndStop(oldVal);
if (oldVal == undefined) {
pP.removeMovieClip();
}
pP.theBlock.gotoAndStop(_global.levelCurrent);
pP._x = this['block' + jjj + ',' + kkk]._x;
pP._y = this['block' + jjj + ',' + kkk]._y;
pP._xscale = 25;
pP._yscale = 25;
pP.vX = Math.random() * 6 - 3;
pP.vY = Math.random() * -6;
pP.life = 34;
if (kkk > gridHeight - 3) {
pP.flag = false;
} else {
pP.flag = true;
}
pP.onEnterFrame = function () {
this.vX *= 0.98;
this.vY += 0.4;
if (this.vY > 4) {
this.vY = 4;
}
this._x += this.vX;
this._y += this.vY;
--this.life;
if (this.flag) {
if (this.life == 0) {
this.removeMovieClip();
}
} else {
if (this._y < -10) {
this.removeMovieClip();
}
}
};
++i;
}
}
}
++jjj;
if (jjj > gridWidth) {
jjj = 0;
++kkk;
}
gameOverCountDown = 30;
++bitch;
}
} else {
if (gameOverCountDown > 0) {
--gameOverCountDown;
} else {
if (gameOverCountDown == 0) {
vertBlowUpFlag = true;
q = 0;
w = 0;
currentlyWorkingOnCol = false;
--gameOverCountDown;
}
}
if (vertBlowUpFlag) {
if (currentlyWorkingOnCol == false) {
while (currentlyWorkingOnCol == false) {
if (grid[q][2] != 5) {
currentlyWorkingOnCol = true;
w = 2;
this['lB' + q].removeMovieClip();
} else {
++q;
}
if (q == gridWidth) {
if (lastPhaseOfGameOver == undefined) {
lastPhaseOfGameOver = 1;
}
}
}
}
if (currentlyWorkingOnCol) {
pE = this.attachMovie('popExplosion', 'pE' + _global.cDepth, _global.cDepth++);
pE._x = this['block' + q + ',' + w]._x;
pE._y = this['block' + q + ',' + w]._y;
if (pE._x == 0) {
pE.removeMovieClip();
}
pE.onEnterFrame = function () {
this._alpha -= 6;
if (this._alpha < 10) {
this.removeMovieClip();
}
};
this['block' + q + ',' + w].hasBomb = 0;
oldVal = grid[q][w];
grid[q][w] = 5;
if (lastPhaseOfGameOver < 0 || lastPhaseOfGameOver == undefined) {
soun(10);
}
rr = Math.ceil(Math.random() * 2) + 0;
i = 0;
while (i < rr) {
pP = this.attachMovie('block8Particle', 'pP' + _global.cDepth, _global.cDepth++);
pP.gotoAndStop(oldVal);
if (oldVal == undefined) {
pP.removeMovieClip();
}
pP.theBlock.gotoAndStop(_global.levelCurrent);
pP._x = this['block' + q + ',' + w]._x;
pP._y = this['block' + q + ',' + w]._y;
pP._xscale = 25;
pP._yscale = 25;
pP.vX = Math.random() * 6 - 3;
pP.vY = Math.random() * -6;
pP.life = 34;
pP.flag = false;
pP.onEnterFrame = function () {
this.vX *= 0.98;
this.vY += 0.4;
if (this.vY > 4) {
this.vY = 4;
}
this._x += this.vX;
this._y += this.vY;
--this.life;
if (this.flag) {
if (this.life == 0) {
this.removeMovieClip();
}
} else {
if (this._y < -10) {
this.removeMovieClip();
}
}
if (lastPhaseOfGameOver > 40) {
this.removeMovieClip();
}
};
++i;
}
++w;
if (w > gridHeight) {
currentlyWorkingOnCol = false;
}
}
}
}
}
function newGameOverFunctionInit() {
i = 1;
while (i < 4) {
this['futureBlockUL' + i].removeMovieClip();
this['futureBlockUR' + i].removeMovieClip();
this['futureBlockLL' + i].removeMovieClip();
this['futureBlockLR' + i].removeMovieClip();
++i;
}
b = 0;
while (b < numberOfBombs + 1) {
this['bomb' + b].removeMovieClip();
++b;
}
this.sweep.removeMovieClip();
this.highlighter.removeMovieClip();
sweepTimerMC.swapDepths(_global.cDepth++);
sweepTimerMC.removeMovieClip();
shiftSpeed = -1;
q = 0;
while (q < gridWidth) {
if (grid[q][2] != 5) {
lB = this.attachMovie('loseBar', 'lB' + q, _global.cDepth++);
lB._x = this['block' + q + ',' + 2]._x;
lB._y = this['block' + q + ',' + 2]._y - 8;
lB.ddd = 0;
lB._alpha = 15;
lB.onEnterFrame = function () {
if (this.ddd) {
this._alpha -= 1.5;
if (this._alpha < 50) {
this.ddd = 0;
}
} else {
this._alpha += 1.5;
if (this._alpha > 95) {
this.ddd = 1;
}
}
};
}
++q;
}
}
function blockExplode(tX, tY) {
pE = this.attachMovie('popExplosion', 'pE' + _global.cDepth, _global.cDepth++);
pE._x = this['block' + tX + ',' + tY]._x;
pE._y = this['block' + tX + ',' + tY]._y;
pE.onEnterFrame = function () {
this._alpha -= 6;
if (this._alpha < 10) {
this.removeMovieClip();
}
};
oldVal = grid[tX][tY];
if (oldVal > 2) {
oldVal -= 2;
}
rr = Math.ceil(Math.random() * 2) + 0;
i = 0;
while (i < rr) {
pP = this.attachMovie('block8Particle', 'pP' + _global.cDepth, _global.cDepth++);
pP.gotoAndStop(oldVal);
if (oldVal == undefined) {
pP.removeMovieClip();
}
pP.theBlock.gotoAndStop(_global.levelCurrent);
pP._x = this['block' + tX + ',' + tY]._x;
pP._y = this['block' + tX + ',' + tY]._y;
pP._xscale = 25;
pP._yscale = 25;
pP.vX = Math.random() * 6 - 3;
pP.vY = Math.random() * -6;
pP.life = 34;
pP.flag = false;
pP.onEnterFrame = function () {
this.vX *= 0.98;
this.vY += 0.4;
if (this.vY > 4) {
this.vY = 4;
}
this._x += this.vX;
this._y += this.vY;
--this.life;
if (this.flag) {
if (this.life == 0) {
this.removeMovieClip();
}
} else {
if (this._y < -10) {
this.removeMovieClip();
}
}
};
++i;
}
}
_global.VolumeSet = 90;
_global.cDepth = 1000;
_global.gameTime = 0;
startingX = 85;
startingY = 90;
gridWidth = 24;
gridHeight = 17;
nextBlock = true;
nextBlockTime = 0;
playersBlockHit = false;
playersBlockLeftX = -10;
playersBlockRightX = -10;
playersBlockRightY = 1;
playersBlockLeftY = 1;
pbUL = 1;
pbUR = 2;
pbLL = 2;
pbLR = 1;
leftHit = false;
rightHit = false;
score = 0;
time = 0;
seconds = 0;
minutes = 0;
_global.destroyed = 0;
deleted = 0;
shiftTimer = 5;
shiftIndex = 0;
shiftSpeed = 15;
colorB = 1;
colorA = 1;
previousLevel = 1;
_global.levelCurrent = 1;
numberOfBombs = 0;
oldAmount = 0;
gamePaused = 0;
justPaused = 0;
gameOverDelay = 0;
gameOverFlag = 0;
realGameOverFlag = false;
realDropDelay = 0;
messages = new Array('Good Job!', 'Awesome!', 'Don\'t Stop!', 'Careful!', 'Nice Move!', 'Keep Going!', ':)', 'Way To Go!', 'Focus', 'Faster!', 'Dont steal my game you BITCH!');
sweepDelay = 200;
sweepTimer = 0;
bombChance = 30;
firstTimeCalled = false;
jjj = 0;
kkk = 2;
newGameOverFlag = false;
lastPhaseOfGameOver = undefined;
vertBlowUpFlag = false;
newKeyLeftDelay = 0;
newKeyRightDelay = 0;
if (music == undefined) {
music.stop();
music = new Sound();
music.attachSound('gameMusic1.mp3');
music.setVolume(90);
music.start(0, 100);
shiftSound.stop();
shiftSound = new Sound();
shiftSound.attachSound('shifter2.mp3');
levelSound.stop();
levelSound = new Sound();
levelSound.attachSound('levelup.mp3');
}
grid = new Array();
valueX = startingX;
valueY = startingY;
j = 0;
while (j < gridWidth) {
grid[j] = new Array();
k = 0;
while (k < gridHeight) {
currentBlock = this.attachMovie('block8', 'block' + j + ',' + k, _global.cDepth);
++_global.cDepth;
currentBlock._x = valueX;
currentBlock._y = valueY;
currentBlock.gotoAndStop(5);
currentBlock.hasBomb = 0;
grid[j][k] = 5;
valueY += 16;
++k;
}
valueY = startingY;
valueX += 16;
++j;
}
sweep = this.attachMovie('sweep', 'sweep', _global.cDepth);
++_global.cDepth;
sweep._height = gridHeight * 16 - 32;
sweep._xscale = 600;
sweep._x = startingX - 16;
sweep._y = startingY + 24;
cover = this.attachMovie('coverUp', 'coverUpA', 1);
cover._x = startingX - 8;
cover._y = startingY + 24;
cover._width = gridWidth * 16;
cover._height = gridHeight * 16 - 32;
cover = this.attachMovie('coverUp', 'coverUpB', 2);
cover._x = startingX - 8;
cover._y = startingY + 8 + gridHeight * 16;
cover._width = gridWidth * 16;
cover._height = 16;
redThing = this.attachMovie('redThing', 'redThing', 3);
redThing._x = startingX - 8;
redThing._y = startingY + 24;
redThing._width = gridWidth * 16;
redThing._alpha = 40;
highlighter = this.attachMovie('highlight', 'highlight', 99);
highlighter._alpha = 25;
highlighter._y = startingY + 24;
highlighter._height = sweep._height;
shiftGrid = new Array();
valueY = startingY + 16 + gridHeight * 16;
valueX = startingX;
j = 0;
while (j < gridWidth) {
currentBlock = this.attachMovie('block8', 'blockShift' + j, _global.cDepth);
++_global.cDepth;
currentBlock._x = valueX;
currentBlock._y = valueY;
valueX += 16;
shiftGrid[j] = 5;
currentBlock.gotoAndStop(5);
++j;
}
fbStartingX = 432;
fbStartingY = 180;
offsetX = 58;
futureBlock = this.attachMovie('block8', 'futureBlockUL1', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX;
futureBlock._y = startingY + 32;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockUR1', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX + 16;
futureBlock._y = startingY + 32;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockLR1', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX + 16;
futureBlock._y = startingY + 32 + 16;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockLL1', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX;
futureBlock._y = startingY + 32 + 16;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockUL2', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX;
futureBlock._y = startingY + 32 + 32 + 16;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockUR2', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX + 16;
futureBlock._y = startingY + 32 + 32 + 16;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockLR2', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX + 16;
futureBlock._y = startingY + 32 + 32 + 32;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockLL2', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX;
futureBlock._y = startingY + 32 + 32 + 32;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockUL3', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX;
futureBlock._y = startingY + 32 + 32 + 32 + 32;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockUR3', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX + 16;
futureBlock._y = startingY + 32 + 32 + 32 + 32;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockLR3', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX + 16;
futureBlock._y = startingY + 32 + 32 + 32 + 32 + 16;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
futureBlock = this.attachMovie('block8', 'futureBlockLL3', _global.cDepth);
++_global.cDepth;
futureBlock._x = startingX - offsetX;
futureBlock._y = startingY + 32 + 32 + 32 + 32 + 16;
futureBlock.stuff = Math.round(Math.random()) + 1;
futureBlock.gotoAndStop(6);
_global.additive = 0;
this.onEnterFrame = function () {
manageSound();
if (gamePaused == false) {
sweepWentBy = false;
highlighter._x = startingX - 8 + playersBlockRightX * 16;
j = 0;
while (j < gridWidth) {
this['blockShift' + j].gotoAndStop(shiftGrid[j]);
if (shiftGrid[j] == 1 || shiftGrid[j] == 3) {
this['blockShift' + j].theBlock.gotoAndStop(colorA);
} else {
if (shiftGrid[j] == 2 || shiftGrid[j] == 4) {
this['blockShift' + j].theBlock.gotoAndStop(colorB);
}
}
k = gridHeight;
while (k >= 0) {
if (this['block' + j + ',' + k].hasBomb > 0) {
drawBomb(this['block' + j + ',' + k].hasBomb, j, k);
}
if (k == 2 && realDropDelay < 1) {
if (grid[j][k] < 5) {
realGameOverFlag = true;
}
}
if (k < 2 && (j != playersBlockLeftX || k != playersBlockLeftY) && (j != playersBlockRightX || k != playersBlockRightY) && (j != playersBlockLeftX || k != playersBlockLeftY - 1) && (j != playersBlockRightX || k != playersBlockRightY - 1)) {
if (grid[j][k] < 5 && gameOverDelay > 2) {
++gameOverFlag;
}
this['block' + j + ',' + k].gotoAndStop(6);
} else {
this['block' + j + ',' + k].gotoAndStop(grid[j][k]);
}
if (grid[j][k] == 1 || grid[j][k] == 3) {
this['block' + j + ',' + k].theBlock.gotoAndStop(colorA);
} else {
if (grid[j][k] == 2 || grid[j][k] == 4) {
this['block' + j + ',' + k].theBlock.gotoAndStop(colorB);
}
}
if (grid[j][k] < 5 && k < gridHeight - 1 && grid[j][k + 1] == 5) {
if ((j != playersBlockLeftX || k != playersBlockLeftY) && (j != playersBlockRightX || k != playersBlockRightY)) {
grid[j][k + 1] = grid[j][k];
grid[j][k] = 5;
if (this['block' + j + ',' + k].hasBomb > 0) {
this['block' + j + ',' + (k + 1)].hasBomb = this['block' + j + ',' + k].hasBomb;
this['block' + j + ',' + k].hasBomb = 0;
}
}
}
if (k > 2) {
if ((j != playersBlockLeftX || k != playersBlockLeftY) && (j != playersBlockRightX || k != playersBlockRightY) && (j + 1 != playersBlockLeftX || k != playersBlockLeftY) && (j + 1 != playersBlockLeftX || k - 1 != playersBlockLeftY)) {
if ((grid[j][k] == 1 || grid[j][k] == 3) && (grid[j][k - 1] == 1 || grid[j][k - 1] == 3) && (grid[j + 1][k] == 1 || grid[j + 1][k] == 3) && (grid[j + 1][k - 1] == 1 || grid[j + 1][k - 1] == 3) && grid[j + 1][k + 1] != 5) {
grid[j][k] = 3;
grid[j][k - 1] = 3;
grid[j + 1][k] = 3;
grid[j + 1][k - 1] = 3;
}
if ((grid[j][k] == 2 || grid[j][k] == 4) && (grid[j][k - 1] == 2 || grid[j][k - 1] == 4) && (grid[j + 1][k] == 2 || grid[j + 1][k] == 4) && (grid[j + 1][k - 1] == 2 || grid[j + 1][k - 1] == 4) && grid[j + 1][k + 1] != 5) {
grid[j][k] = 4;
grid[j][k - 1] = 4;
grid[j + 1][k] = 4;
grid[j + 1][k - 1] = 4;
}
}
}
--k;
}
++j;
}
if (grid[playersBlockLeftX][playersBlockLeftY + 1] < 5 || playersBlockLeftY == gridHeight - 1) {
if (playersBlockLeftY != 1) {
leftHit = true;
}
} else {
if (leftHit == true || rightHit == true) {
grid[playersBlockLeftX][playersBlockLeftY - 1] = 5;
++playersBlockLeftY;
} else {
if (_global.gameTime % 6 == 0 && keyDownIsReleased && dropTime < 1 && (leftHit == false || rightHit == false)) {
} else {
--dropTime;
}
}
}
if (grid[playersBlockRightX][playersBlockRightY + 1] < 5 || playersBlockRightY == gridHeight - 1) {
if (playersBlockRightY != 1) {
rightHit = true;
}
} else {
if (leftHit == true || rightHit == true) {
grid[playersBlockRightX][playersBlockRightY - 1] = 5;
++playersBlockRightY;
} else {
if (_global.gameTime % 6 == 0 && keyDownIsReleased && dropTime < 1 && (leftHit == false || rightHit == false)) {
} else {
--dropTime;
}
}
}
if (leftHit == true && rightHit == true) {
nextBlock = true;
}
if (nextBlock == true) {
++nextBlockTime;
if (nextBlockTime == 12) {
gameOverDelay = 0;
nextBlockTime = 0;
nextBlock = false;
leftHit = false;
rightHit = false;
playersBlockLeftX = gridWidth / 2 - 1;
playersBlockRightX = playersBlockLeftX + 1;
playersBlockRightY = 1;
playersBlockLeftY = 1;
pbUL = this.futureBlockUL1.stuff;
pbUR = this.futureBlockUR1.stuff;
pbLL = this.futureBlockLL1.stuff;
pbLR = this.futureBlockLR1.stuff;
this.futureBlockUL1.stuff = this.futureBlockUL2.stuff;
this.futureBlockUR1.stuff = this.futureBlockUR2.stuff;
this.futureBlockLL1.stuff = this.futureBlockLL2.stuff;
this.futureBlockLR1.stuff = this.futureBlockLR2.stuff;
this.futureBlockUL2.stuff = this.futureBlockUL3.stuff;
this.futureBlockUR2.stuff = this.futureBlockUR3.stuff;
this.futureBlockLL2.stuff = this.futureBlockLL3.stuff;
this.futureBlockLR2.stuff = this.futureBlockLR3.stuff;
this.futureBlockUL3.stuff = Math.round(Math.random()) + 1;
this.futureBlockUR3.stuff = Math.round(Math.random()) + 1;
this.futureBlockLL3.stuff = Math.round(Math.random()) + 1;
this.futureBlockLR3.stuff = Math.round(Math.random()) + 1;
if (numberOfBombs > 0) {
q = 1;
while (q <= numberOfBombs) {
if (this['bomb' + q].process > 1) {
--this['bomb' + q].process;
this['bomb' + q]._y -= 48;
} else {
if (this['bomb' + q].process == 1) {
--this['bomb' + q].process;
if (this['bomb' + q].whichBlock == 4) {
this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb = this['bomb' + q].theType;
removeMovieClip(this['bomb' + q]);
} else {
if (this['bomb' + q].whichBlock == 3) {
this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb = this['bomb' + q].theType;
removeMovieClip(this['bomb' + q]);
} else {
if (this['bomb' + q].whichBlock == 2) {
this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb = this['bomb' + q].theType;
removeMovieClip(this['bomb' + q]);
} else {
if (this['bomb' + q].whichBlock == 1) {
this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb = this['bomb' + q].theType;
removeMovieClip(this['bomb' + q]);
}
}
}
}
}
}
++q;
}
}
if (Math.round(Math.random() * 99) < bombChance) {
++numberOfBombs;
currentBomb = this.attachMovie('bomb', 'bomb' + numberOfBombs, _global.cDepth);
++_global.cDepth;
currentBomb.process = 3;
theBombType = Math.ceil(Math.random() * 10);
if (theBombType < 4) {
currentBomb.theType = 1;
} else {
if (theBombType < 9) {
currentBomb.theType = 3;
} else {
currentBomb.theType = 2;
}
}
currentBomb.gotoAndStop(currentBomb.theType);
blockNumber = Math.round(Math.random() * 3) + 1;
currentBomb.whichBlock = blockNumber;
if (blockNumber == 1) {
currentBomb._x = this.futureBlockUL3._x;
currentBomb._y = this.futureBlockUL3._y;
} else {
if (blockNumber == 2) {
currentBomb._x = this.futureBlockUR3._x;
currentBomb._y = this.futureBlockUR3._y;
} else {
if (blockNumber == 3) {
currentBomb._x = this.futureBlockLL3._x;
currentBomb._y = this.futureBlockLL3._y;
} else {
currentBomb._x = this.futureBlockLR3._x;
currentBomb._y = this.futureBlockLR3._y;
}
}
}
}
this.futureBlockUL1.gotoAndStop(this.futureBlockUL1.stuff);
this.futureBlockUR1.gotoAndStop(this.futureBlockUR1.stuff);
this.futureBlockLL1.gotoAndStop(this.futureBlockLL1.stuff);
this.futureBlockLR1.gotoAndStop(this.futureBlockLR1.stuff);
this.futureBlockUL2.gotoAndStop(this.futureBlockUL2.stuff);
this.futureBlockUR2.gotoAndStop(this.futureBlockUR2.stuff);
this.futureBlockLL2.gotoAndStop(this.futureBlockLL2.stuff);
this.futureBlockLR2.gotoAndStop(this.futureBlockLR2.stuff);
this.futureBlockUL3.gotoAndStop(this.futureBlockUL3.stuff);
this.futureBlockUR3.gotoAndStop(this.futureBlockUR3.stuff);
this.futureBlockLL3.gotoAndStop(this.futureBlockLL3.stuff);
this.futureBlockLR3.gotoAndStop(this.futureBlockLR3.stuff);
i = 1;
while (i <= 3) {
if (this['futureBlockUL' + i].stuff == 1 || this['futureBlockUL' + i].stuff == 3) {
this['futureBlockUL' + i].theBlock.gotoAndStop(colorA);
} else {
if (this['futureBlockUL' + i].stuff == 2 || this['futureBlockUL' + i].stuff == 4) {
this['futureBlockUL' + i].theBlock.gotoAndStop(colorB);
}
}
if (this['futureBlockUR' + i].stuff == 1 || this['futureBlockUR' + i].stuff == 3) {
this['futureBlockUR' + i].theBlock.gotoAndStop(colorA);
} else {
if (this['futureBlockUR' + i].stuff == 2 || this['futureBlockUR' + i].stuff == 4) {
this['futureBlockUR' + i].theBlock.gotoAndStop(colorB);
}
}
if (this['futureBlockLL' + i].stuff == 1 || this['futureBlockLL' + i].stuff == 3) {
this['futureBlockLL' + i].theBlock.gotoAndStop(colorA);
} else {
if (this['futureBlockLL' + i].stuff == 2 || this['futureBlockLL' + i].stuff == 4) {
this['futureBlockLL' + i].theBlock.gotoAndStop(colorB);
}
}
if (this['futureBlockLR' + i].stuff == 1 || this['futureBlockLR' + i].stuff == 3) {
this['futureBlockLR' + i].theBlock.gotoAndStop(colorA);
} else {
if (this['futureBlockLR' + i].stuff == 2 || this['futureBlockLR' + i].stuff == 4) {
this['futureBlockLR' + i].theBlock.gotoAndStop(colorB);
}
}
++i;
}
dropTime = 40;
}
}
if (Key.isDown(37) && !Key.isDown(39) && playersBlockLeftX - 1 > -1 && newGameOverFlag != true) {
if (newKeyLeftDelay % 2 == 0) {
if (this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb > 0) {
this['block' + (playersBlockLeftX - 1) + ',' + (playersBlockLeftY - 1)].hasBomb = this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb;
this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb = 0;
} else {
if (this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb > 0) {
this['block' + (playersBlockRightX - 1) + ',' + (playersBlockRightY - 1)].hasBomb = this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb;
this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb = 0;
} else {
if (this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb > 0) {
this['block' + (playersBlockLeftX - 1) + ',' + playersBlockLeftY].hasBomb = this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb;
this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb = 0;
} else {
if (this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb > 0) {
this['block' + (playersBlockRightX - 1) + ',' + playersBlockRightY].hasBomb = this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb;
this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb = 0;
}
}
}
}
grid[playersBlockRightX][playersBlockRightY] = 5;
grid[playersBlockRightX][playersBlockRightY - 1] = 5;
--playersBlockLeftX;
--playersBlockRightX;
++newKeyLeftDelay;
} else {
++newKeyLeftDelay;
}
} else {
if (!Key.isDown(37)) {
newKeyLeftDelay = 0;
}
}
if (Key.isDown(39) && !Key.isDown(37) && playersBlockLeftX + 1 < 23 && newGameOverFlag != true) {
if (newKeyRightDelay % 2 == 0) {
if (this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb > 0) {
this['block' + (playersBlockLeftX + 1) + ',' + (playersBlockLeftY - 1)].hasBomb = this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb;
this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb = 0;
} else {
if (this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb > 0) {
this['block' + (playersBlockRightX + 1) + ',' + (playersBlockRightY - 1)].hasBomb = this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb;
this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb = 0;
} else {
if (this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb > 0) {
this['block' + (playersBlockLeftX + 1) + ',' + playersBlockLeftY].hasBomb = this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb;
this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb = 0;
} else {
if (this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb > 0) {
this['block' + (playersBlockRightX + 1) + ',' + playersBlockRightY].hasBomb = this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb;
this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb = 0;
}
}
}
}
grid[playersBlockLeftX][playersBlockLeftY] = 5;
grid[playersBlockLeftX][playersBlockLeftY - 1] = 5;
++playersBlockLeftX;
++playersBlockRightX;
++keyRight;
++newKeyRightDelay;
} else {
++newKeyRightDelay;
}
} else {
if (!Key.isDown(39)) {
newKeyRightDelay = 0;
}
}
if (Key.isDown(40) && keyDownIsReleased == true && newKeyLeftDelay == 0 && newKeyRightDelay == 0) {
if (grid[playersBlockLeftX][playersBlockLeftY + 2] < 5 || grid[playersBlockRightX][playersBlockRightY + 2] < 5) {
gameOverFlag += 5;
}
keyDownIsReleased = false;
playersBlockLeftX = -1000;
playersBlockLeftY = -1000;
playersBlockRightX = -1000;
playersBlockRightY = -1000;
nextBlock = true;
gameOverDelay = 0;
realDropDelay = 5;
} else {
if ((Key.isDown(32) || Key.isDown(38)) && leftHit == false && rightHit == false && keyIsReleased == true) {
soun(4);
if (this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb > 0) {
this['block' + (playersBlockLeftX + 1) + ',' + (playersBlockLeftY - 1)].hasBomb = this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb;
this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb = 0;
} else {
if (this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb > 0) {
this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb = this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb;
this['block' + playersBlockRightX + ',' + (playersBlockRightY - 1)].hasBomb = 0;
} else {
if (this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb > 0) {
this['block' + playersBlockLeftX + ',' + (playersBlockLeftY - 1)].hasBomb = this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb;
this['block' + playersBlockLeftX + ',' + playersBlockLeftY].hasBomb = 0;
} else {
if (this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb > 0) {
this['block' + (playersBlockRightX - 1) + ',' + playersBlockRightY].hasBomb = this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb;
this['block' + playersBlockRightX + ',' + playersBlockRightY].hasBomb = 0;
}
}
}
}
keyIsReleased = false;
a = pbUL;
b = pbUR;
c = pbLR;
d = pbLL;
pbUL = d;
pbUR = a;
pbLR = b;
pbLL = c;
}
}
if (Key.isDown(13) && gamePaused == false && controlIsReleased && newGameOverFlag == false) {
gamePaused = true;
justPaused = true;
controlIsReleased = false;
}
if (!Key.isDown(32) && !Key.isDown(38)) {
keyIsReleased = true;
}
if (!Key.isDown(37)) {
keyLeft = 0;
}
if (!Key.isDown(39)) {
keyRight = 0;
}
if (!Key.isDown(40)) {
keyDownIsReleased = true;
}
if (!Key.isDown(13)) {
controlIsReleased = true;
}
grid[playersBlockLeftX][playersBlockLeftY] = pbLL;
grid[playersBlockLeftX][playersBlockLeftY - 1] = pbUL;
grid[playersBlockRightX][playersBlockRightY] = pbLR;
grid[playersBlockRightX][playersBlockRightY - 1] = pbUR;
i = 1;
while (i <= 3) {
if (this['futureBlockUL' + i].stuff == 1 || this['futureBlockUL' + i].stuff == 3) {
this['futureBlockUL' + i].theBlock.gotoAndStop(colorA);
} else {
if (this['futureBlockUL' + i].stuff == 2 || this['futureBlockUL' + i].stuff == 4) {
this['futureBlockUL' + i].theBlock.gotoAndStop(colorB);
}
}
if (this['futureBlockUR' + i].stuff == 1 || this['futureBlockUR' + i].stuff == 3) {
this['futureBlockUR' + i].theBlock.gotoAndStop(colorA);
} else {
if (this['futureBlockUR' + i].stuff == 2 || this['futureBlockUR' + i].stuff == 4) {
this['futureBlockUR' + i].theBlock.gotoAndStop(colorB);
}
}
if (this['futureBlockLL' + i].stuff == 1 || this['futureBlockLL' + i].stuff == 3) {
this['futureBlockLL' + i].theBlock.gotoAndStop(colorA);
} else {
if (this['futureBlockLL' + i].stuff == 2 || this['futureBlockLL' + i].stuff == 4) {
this['futureBlockLL' + i].theBlock.gotoAndStop(colorB);
}
}
if (this['futureBlockLR' + i].stuff == 1 || this['futureBlockLR' + i].stuff == 3) {
this['futureBlockLR' + i].theBlock.gotoAndStop(colorA);
} else {
if (this['futureBlockLR' + i].stuff == 2 || this['futureBlockLR' + i].stuff == 4) {
this['futureBlockLR' + i].theBlock.gotoAndStop(colorB);
}
}
++i;
}
if (_global.gameTime % shiftSpeed == 0 && newGameOverFlag != true) {
lawl = Math.round(Math.random() * 1.1);
if (lawl == 0) {
shiftGrid[shiftIndex] = Math.round(Math.random()) + 1;
} else {
if (grid[shiftIndex][gridHeight - 1] == 1 || grid[shiftIndex][gridHeight - 1] == 3) {
shiftGrid[shiftIndex] = 2;
} else {
if (grid[shiftIndex][gridHeight - 1] == 2 || grid[shiftIndex][gridHeight - 1] == 4) {
shiftGrid[shiftIndex] = 1;
} else {
shiftGrid[shiftIndex] = Math.round(Math.random()) + 1;
}
}
}
++shiftIndex;
}
if (shiftIndex == gridWidth + 1) {
shiftSound.start(0, 1);
shiftIndex = 0;
j = 0;
while (j < gridWidth) {
k = 0;
while (k < gridHeight) {
if (k < 3) {
if (grid[j][k] == 5 && grid[j][k + 1] < 5 && gameOverDelay > 2) {
gameOverFlag += 2;
}
}
if (k < gridHeight - 1) {
if (grid[j][k] == 5) {
grid[j][k] = grid[j][k + 1];
grid[j][k + 1] = 5;
this['block' + j + ',' + k].hasBomb = this['block' + j + ',' + (k + 1)].hasBomb;
this['block' + j + ',' + (k + 1)].hasBomb = 0;
}
if ((k == playersBlockLeftY || k == playersBlockRightY) && grid[j][k + 1] < 5) {
++gameOverFlag;
}
} else {
grid[j][k] = shiftGrid[j];
}
++k;
}
shiftGrid[j] = 5;
++j;
}
}
shiftSpeed = 15 - Math.ceil(level / 2);
if (shiftSpeed < 4) {
shiftSpeed = 4;
}
if (sweep._visible == false) {
++sweepTimer;
if (sweepTimer > sweepDelay) {
sweep._visible = true;
sweep._x = startingX - 25;
}
} else {
sweep._x += Math.floor(gridWidth * 16 / 30);
}
if (sweep._x > gridWidth * 16 + startingX) {
sweepWentBy = true;
if (_global.destroyed > 0) {
_global.additive = _global.destroyed * 10 * _global.levelCurrent + Math.round(Math.pow(_global.destroyed, 1.5 + _global.levelCurrent / 8));
if (_global.additive % 2 != 0) {
--_global.additive;
}
score += _global.additive;
}
deleted += _global.destroyed;
sweep._x = -999;
sweep._visible = false;
sweepTimer = 0;
}
k = gridHeight;
while (k >= 0) {
if (grid[Math.floor((sweep._x - 48) / 16)][k] == 3 || grid[Math.floor((sweep._x - 48) / 16)][k] == 4) {
_global.destroyed += 1;
soun(10);
blockExplode(Math.floor((sweep._x - 48) / 16), k);
grid[Math.floor((sweep._x - 48) / 16)][k] = 5;
if (this['block' + Math.floor((sweep._x - 48) / 16) + ',' + k].hasBomb > 0) {
if (this['block' + Math.floor((sweep._x - 48) / 16) + ',' + k].hasBomb == 1) {
this['block' + Math.floor((sweep._x - 48) / 16) + ',' + k].hasBomb = 0;
explodeHorizontal(k);
} else {
if (this['block' + Math.floor((sweep._x - 48) / 16) + ',' + k].hasBomb == 2) {
this['block' + Math.floor((sweep._x - 48) / 16) + ',' + k].hasBomb = 0;
explodeVertical(Math.floor((sweep._x - 48) / 16));
} else {
if (this['block' + Math.floor((sweep._x - 48) / 16) + ',' + k].hasBomb == 3) {
this['block' + Math.floor((sweep._x - 48) / 16) + ',' + k].hasBomb = 0;
explodeSquare(Math.floor((sweep._x - 48) / 16), k);
}
}
}
this['block' + Math.floor((sweep._x - 48) / 16) + ',' + k].hasBomb = 0;
}
}
--k;
}
++gameOverDelay;
--realDropDelay;
level = _global.levelCurrent;
if (deleted >= oldAmount + 75) {
++_global.levelCurrent;
oldAmount += 75;
}
if (previousLevel != _global.levelCurrent) {
levelSound.start(0, 1);
levelUp = true;
if (previousLevel > 7) {
colorA = Math.round(Math.random() * 5) + 1;
colorB = Math.round(Math.random() * 5) + 1;
} else {
colorA = _global.levelCurrent;
colorB = _global.levelCurrent;
}
}
previousLevel = _global.levelCurrent;
if (_global.additive > 0 && sweepWentBy) {
if (!levelUp) {
if (_global.destroyed <= 4) {
theMsg = '';
} else {
if (_global.destroyed <= 6) {
theMsg = 'Good';
} else {
if (_global.destroyed <= 8) {
theMsg = 'Great';
} else {
if (_global.destroyed <= 10) {
theMsg = 'Outstanding';
} else {
if (_global.destroyed <= 14) {
theMsg = 'Awesome';
} else {
if (_global.destroyed <= 19) {
theMsg = 'Spectacular';
} else {
if (_global.destroyed <= 24) {
theMsg = 'Incredible!';
} else {
if (_global.destroyed <= 30) {
theMsg = 'Amazing!';
} else {
if (_global.destroyed <= 35) {
theMsg = 'Wonderful!';
} else {
if (_global.destroyed <= 40) {
theMsg = 'Marvelous!';
} else {
if (_global.destroyed <= 45) {
theMsg = 'Fantastic!';
} else {
if (_global.destroyed <= 50) {
theMsg = 'Miraculous!';
} else {
if (_global.destroyed <= 60) {
theMsg = 'UNBELIEVABLE!';
} else {
if (_global.destroyed <= 70) {
theMsg = 'RIDICULOUS!';
} else {
if (_global.destroyed <= 80) {
theMsg = 'DEVASTATING!';
} else {
if (_global.destroyed <= 90) {
theMsg = 'CATACLYSMIC!';
} else {
if (_global.destroyed > 90) {
theMsg = 'ABSOLUTE CHAOS!';
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
newTextFunction(theMsg, '+' + _global.additive, 'Chain: ' + _global.destroyed, theSizeMod);
} else {
newTextFunction('Level ' + _global.levelCurrent, '+' + _global.additive, 'Chain: ' + _global.destroyed, 100);
}
_global.additive = 0;
_global.destroyed = 0;
levelUp = false;
}
if (realGameOverFlag == true) {
newGameOverFlag = true;
}
++_global.gameTime;
if (_global.gameTime % 30 == 0) {
++seconds;
}
if (seconds > 59) {
++minutes;
seconds = 0;
}
if (minutes < 10 && seconds < 10) {
timeTextD.text = '0' + minutes + ':' + '0' + seconds;
} else {
if (minutes < 10 && seconds > 9) {
timeTextD.text = '0' + minutes + ':' + seconds;
} else {
if (minutes > 9 && seconds < 10) {
timeTextD.text = minutes + ':' + '0' + seconds;
} else {
timeTextD.text = minutes + ':' + seconds;
}
}
}
}
if (Key.isDown(13) && gamePaused == true && controlIsReleased == true) {
gamePaused = false;
controlIsReleased = false;
this.pauseText.removeMovieClip();
}
if (!Key.isDown(13)) {
controlIsReleased = true;
}
if (gamePaused == true) {
if (justPaused) {
pauseText = this.attachMovie('pausedText', 'pauseText', _global.cDepth);
++_global.cDepth;
pauseText._x = 275;
pauseText._y = 160;
pauseText._yscale = 100;
pauseText._xscale = 100;
pauseText.theText.text = 'Paused';
justPaused = false;
}
}
if (newGameOverFlag) {
newGameOverFunction();
}
};
}
movieClip 295 {
}
instance of movieClip 295 {
onClipEvent (load) {
this._x = this._parent.startingX - 5;
this._y = this._parent.startingY - 5;
}
}
frame 4 {
_global.VolumeSet = 50;
}
button 301 {
on (press) {
_global.GameOver = false;
gotoAndStop('titleScreenFrame');
}
}
button 306 {
on (press) {
var o = {'n': [1, 5, 1, 10, 8, 5, 7, 3, 3, 10, 6, 7, 3, 9, 2, 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, '');
mochi.as2.MochiScores.showLeaderboard({'boardID': boardID, 'score': score});
}
}
// unknown tag 88 length 145
movieClip 312 {
frame 13 {
stop();
}
}
frame 5 {
_global.VolumeSet = 60;
}
button 317 {
on (press) {
i = 0;
while (i < 10) {
removeMovieClip(this['theBlock' + i]);
++i;
}
removeMovieClip(this.theTitle);
removeMovieClip(this.theCredits);
gotoAndStop('titleScreenFrame');
}
}
// unknown tag 88 length 64
movieClip 331 {
}
// unknown tag 88 length 62
movieClip 335 {
}