Combined Code
movieClip 18 {
frame 1 {
stop();
}
}
movieClip 25 {
}
movieClip 28 {
}
movieClip 30 {
frame 1 {
X = Math.ceil((_parent._parent._parent.ColorScheme + 1) / 5);
gotoAndStop(X);
}
}
movieClip 53 {
}
movieClip 76 {
}
movieClip 100 {
}
movieClip 110 {
frame 1 {
X = Math.ceil((_parent._parent._parent.ColorScheme + 1) / 5);
gotoAndStop(X);
}
}
movieClip 112 {
}
movieClip 122 {
frame 8 {
stop();
}
}
movieClip 124 {
}
movieClip 133 {
frame 1 {
if (this._parent._parent.ColorScheme % 7 == 0) {
gotoAndPlay(7);
}
}
frame 5 {
if (this._parent._parent.ColorScheme % 7 != 0) {
gotoAndPlay(1);
}
}
frame 7 {
if (this._parent._parent.ColorScheme % 7 != 0) {
gotoAndPlay(1);
}
}
frame 11 {
if (this._parent._parent.ColorScheme % 7 != 0) {
gotoAndPlay(7);
}
}
}
movieClip 136 {
frame 1 {
if (this._parent._parent.ColorScheme % 7 == 0) {
gotoAndPlay(7);
}
}
frame 5 {
if (this._parent._parent.ColorScheme % 7 != 0) {
gotoAndPlay(1);
}
}
frame 7 {
if (this._parent._parent.ColorScheme % 7 != 0) {
gotoAndPlay(1);
}
}
frame 11 {
if (this._parent._parent.ColorScheme % 7 != 0) {
gotoAndPlay(7);
}
}
}
movieClip 137 LED {
frame 1 {
stop();
}
}
movieClip 140 LEDHL {
frame 1 {
stop();
}
}
// unknown tag 88 length 138
movieClip 143 TextBox {
}
movieClip 145 LightRay {
frame 1 {
Speed = Math.round(Math.random() * 200) / 100 + 1;
if (Math.random() > 0.5) {
Speed *= -1;
}
Range = this._rotation + 35;
Range2 = this._rotation - 35;
this.onEnterFrame = function () {
if (this._rotation < Range2 || this._rotation > Range) {
this.Speed *= -1;
}
this._rotation += this.Speed;
};
}
}
movieClip 148 LaserGFX {
frame 1 {
if (this._parent.ColorScheme % 7 == 0) {
gotoAndStop(2);
} else {
stop();
}
}
}
movieClip 150 GreyGFX2 {
}
movieClip 152 GreyGFX {
}
movieClip 155 BombGFX {
frame 1 {
if (this._parent.ColorScheme % 7 == 0) {
gotoAndStop(2);
} else {
stop();
}
}
}
movieClip 161 Z_RedLightning {
}
frame 1 {
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = '__mochibot__';
mbc = 'mochibot.com';
g = _global ? _global : _level0._root;
if (g[mb + swfid]) {
return g[mb + swfid];
}
s = System.security;
x = mc._root.getSWFVersion;
fv = x ? mc.getSWFVersion() : (_global ? 6 : 5);
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == 'localWithFile') {
return null;
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = (fv == 5) ? /:$version : System.capabilities.version;
u = 'http://' + mbc + '/my/core.swf?mv=8&fv=' + fv + '&v=' + escape(pv) + '&swfid=' + escape(swfid) + '&l=' + lv + '&f=' + mc + (sb ? '&sb=' + sb : '') + (trk ? '&t=1' : '');
lv = fv > 6 ? mc.getNextHighestDepth() : (g[mb + 'level'] ? g[mb + 'level'] + 1 : lv);
g[mb + 'level'] = lv;
if (fv == 5) {
res = '_level' + lv;
if (!eval(res)) {
loadMovieNum(u, lv);
}
return res;
}
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
return res;
}
__com_mochibot__('5bc4a8c9', this, 10301, true);
if (mochiShowVar == undefined) {
mochiShowVar = 1;
var _mochiads_game_id = '9ffe73235ff2913f';
mochi.as2.MochiServices.connect('9ffe73235ff2913f');
mochi.as2.MochiAd.showPreGameAd({'id': '9ffe73235ff2913f', 'res': '600x500', 'background': 16777161, 'color': 16763904, 'outline': 65539, 'no_bg': true, 'ad_failed': function () {
this._parent.play();
}});
}
}
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);
if (_global.Frames % 2 == 0) {
i = 1;
while (i <= NumberOfSounds) {
if (this['soundOut' + i] > 0) {
--this['soundOut' + i];
}
++i;
}
}
}
if (_global.SoundOn == undefined) {
_global.SoundOn = true;
_global.Volume = 100;
_global.VolumeSet = 100;
}
soundMax1 = 10;
var snd1 = new Sound();
snd1.attachSound('sound1');
snd1.setVolume(100);
snd1.start(0, 1000000);
NumberOfSounds = 15;
i = 1;
while (i <= NumberOfSounds) {
this['soundMax' + i] = 5;
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;
}
}
frame 1 {
function doNothing() {}
function link() {
getURL('http://www.unboundedgames.com/', '_blank');
}
MENU = new ContextMenu();
MENU.hideBuiltInItems();
item1 = new ContextMenuItem('Joseph Lormand', doNothing);
item2 = new ContextMenuItem('Unboundedgames', link);
item3 = new ContextMenuItem('____________________', doNothing);
item4 = new ContextMenuItem('(Quality Automagically Adjusts)', doNothing);
MENU.customItems.push(item1);
MENU.customItems.push(item2);
MENU.customItems.push(item3);
MENU.customItems.push(item4);
this.menu = MENU;
_parent.menu = MENU;
_global.menu = MENU;
}
movieClip 164 {
}
movieClip 165 {
frame 1 {
stop();
this.onEnterFrame = function () {
CS = this._parent.ColorScheme % 22;
if (this._parent.ColorScheme > 21) {
CS += 1;
}
if (_global.GameOver != true) {
gotoAndStop(CS);
} else {
gotoAndStop(1);
}
};
}
}
instance of movieClip 133 {
onClipEvent (enterFrame) {
this._parent.manageSound();
}
}
// unknown tag 88 length 143
movieClip 170 {
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 172 {
on (press) {
if (_global.SoundOn) {
_global.SoundOn = false;
} else {
_global.SoundOn = true;
}
}
}
movieClip 305 __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 v26 = {'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, v26);
if ('c862232051e0a94e1c3609b3916ddb17'.substr(0) == 'dfeada81ac97cde83665f81c12da7def') {
options.ad_started();
options.ad_finished();
return undefined;
}
var clip = options.clip;
var v23 = 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 v14 = mochi.as2.MochiAd._getRes(options);
var v4 = v14[0];
var v13 = v14[1];
mc._x = v4 * 0.5;
mc._y = v13 * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk._x = v4 * -0.5;
chk._y = v13 * -0.5;
var v6 = chk.createEmptyMovieClip('_mochiad_bar', 4);
if (options.no_progress_bar) {
v6._visible = false;
delete options.no_progress_bar;
} else {
v6._x = 10;
v6._y = v13 - 20;
}
var v22 = options.color;
delete options.color;
var v20 = options.background;
delete options.background;
var v24 = options.outline;
delete options.outline;
var v5 = v6.createEmptyMovieClip('_outline', 1);
v5.beginFill(v20);
v5.moveTo(0, 0);
v5.lineTo(v4 - 20, 0);
v5.lineTo(v4 - 20, 10);
v5.lineTo(0, 10);
v5.lineTo(0, 0);
v5.endFill();
var v3 = v6.createEmptyMovieClip('_inside', 2);
v3.beginFill(v22);
v3.moveTo(0, 0);
v3.lineTo(v4 - 20, 0);
v3.lineTo(v4 - 20, 10);
v3.lineTo(0, 10);
v3.lineTo(0, 0);
v3.endFill();
v3._xscale = 0;
var v7 = v6.createEmptyMovieClip('_outline', 3);
v7.lineStyle(0, v24, 100);
v7.moveTo(0, 0);
v7.lineTo(v4 - 20, 0);
v7.lineTo(v4 - 20, 10);
v7.lineTo(0, 10);
v7.lineTo(0, 0);
chk.ad_msec = v23;
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;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
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 v6 = this._parent._parent;
var v11 = this._parent._mochiad_ctr;
var v5 = getTimer() - this.started;
var v3 = false;
var v4 = v6.getBytesTotal();
var v8 = v6.getBytesLoaded();
var v2 = 100 * v8 / v4;
var v10 = 100 * v5 / chk.ad_msec;
var v9 = this._mochiad_bar._inside;
var v13 = Math.min(100, Math.min(v2 || 0, v10));
v13 = Math.max(this.last_pcnt, v13);
this.last_pcnt = v13;
v9._xscale = v13;
options.ad_progress(v13);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {'id': 'hostLoadPcnt', 'pcnt': v2}, clip._mochiad._containerLCName);
if (v2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var v7 = v11.getBytesTotal();
if (v7 > 0 || typeof v7 == 'undefined') {
chk.showing = true;
chk.started = getTimer();
} else {
if (v5 > chk.ad_timeout && v2 == 100) {
options.ad_failed();
v3 = true;
}
}
}
if (v5 > chk.ad_msec) {
v3 = true;
}
if (v4 > 0 && v8 >= v4 && v3) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
};
v1.showClickAwayAd = function (options) {
var v9 = {'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, v9);
var clip = options.clip;
var v8 = 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 mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var v4 = mochi.as2.MochiAd._getRes(options);
var v10 = v4[0];
var v7 = v4[1];
mc._x = v10 * 0.5;
mc._y = v7 * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk.ad_timeout = v8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace('[MOCHIAD rpcTestFn] ' + s);
return s;
};
var v20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
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 v13 = {'clip': _root, 'server': 'http://x.mochiads.com/srv/1/', 'method': 'load', 'depth': 10333, 'id': '_UNKNOWN_'};
options = mochi.as2.MochiAd._parseOptions(options, v13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = mochi.as2.MochiAd.getVersion();
var v7 = options.clip;
if (!mochi.as2.MochiAd._isNetworkAvailable()) {
return null;
}
if (v7._mochiad_loaded) {
return null;
}
var v12 = options.depth;
delete options.depth;
var v6 = v7.createEmptyMovieClip('_mochiad', v12);
var v11 = mochi.as2.MochiAd._getRes(options);
options.res = v11[0] + 'x' + v11[1];
options.server += options.id;
delete options.id;
v7._mochiad_loaded = true;
if (v7._url.indexOf('http') != 0) {
trace('[MochiAd] NOTE: Security Sandbox Violation errors below are normal');
}
var v4 = v6.createEmptyMovieClip('_mochiad_ctr', 1);
for (var v8 in options) {
v4[v8] = options[v8];
}
var v10 = v4.server;
delete v4.server;
var v14 = mochi.as2.MochiAd._allowDomains(v10);
v6.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 v9 = ['', Math.floor((new Date()).getTime()), random(999999)].join('_');
v5.mc = v6;
v5.name = v9;
v5.hostname = v14;
v5.allowDomain = function (d) {
return true;
};
v5.allowInsecureDomain = v5.allowDomain;
v5.connect(v9);
v6.lc = v5;
v4.lc = v9;
v4.st = getTimer();
if (!options.skip) {
v4.loadMovie(v10 + '.swf', 'POST');
}
return v6;
};
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 306 __Packages.mochi.as2.MochiSync {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.as2) {
_global.mochi.as2 = new Object();
}
if (!_global.mochi.as2.MochiSync) {
var v1 = function () {
this._syncContainer = {};
};
mochi.as2.MochiSync = v1;
var v2 = v1.prototype;
v2.getProp = function (name) {
return this._syncContainer[name];
};
v2.setProp = function (name, value) {
if (this._syncContainer[name] == value) {
return undefined;
}
this._syncContainer[name] = value;
mochi.as2.MochiServices.send('sync_propUpdate', {'name': name, 'value': value});
};
v2.triggerEvent = function (eventType, args) {
switch (eventType) {
case mochi.as2.MochiSync.SYNC_REQUEST:
mochi.as2.MochiServices.send('sync_syncronize', this._syncContainer);
break;
case mochi.as2.MochiSync.SYNC_PROPERTY:
this._syncContainer[args.name] = args.value;
}
};
v1.SYNC_REQUEST = 'SyncRequest';
v1.SYNC_PROPERTY = 'UpdateProperty';
ASSetPropFlags(mochi.as2.MochiSync.prototype, null, 1);
}
#endinitclip
}
movieClip 307 __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.7 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 'events':
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case 'coins':
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
case 'sync':
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
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':
break;
case '8':
case '9':
case 'a':
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://x.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._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.servicesSync = new mochi.as2.MochiSync();
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 308 __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 309 __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.trigger = function (kind, obj) {
if (obj == undefined) {
obj = {};
} else {
if (obj.kind != undefined) {
trace('WARNING: optional arguements package contains key \'id\', it will be overwritten');
obj.kind = kind;
}
}
mochi.as2.MochiServices.send('events_triggerEvent', {'eventObject': obj}, 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.startGame = function () {
mochi.as2.MochiEvents.gameStart = (new Date()).getTime();
mochi.as2.MochiEvents.trigger('start_game');
};
v1.endGame = function () {
var v1 = (new Date()).getTime() - mochi.as2.MochiEvents.gameStart;
mochi.as2.MochiEvents.trigger('end_game', {'time': v1});
};
v1.startLevel = function () {
mochi.as2.MochiEvents.levelStart = (new Date()).getTime();
mochi.as2.MochiEvents.trigger('start_level');
};
v1.endLevel = function () {
var v1 = (new Date()).getTime() - mochi.as2.MochiEvents.levelStart;
mochi.as2.MochiEvents.trigger('end_level', {'time': v1});
};
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 310 __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('coins_showLoginWidget', {'options': options});
};
v1.hideLoginWidget = function () {
mochi.as2.MochiServices.send('coins_hideLoginWidget');
};
v1.requestLogin = function () {
mochi.as2.MochiServices.send('coins_requestLogin');
};
v1.getUserInfo = function () {
mochi.as2.MochiServices.send('coins_getUserInfo');
};
v1.saveUserProperties = function (properties) {
mochi.as2.MochiServices.send('coins_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.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 311 __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 312 __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 {
stop();
this.tabChildren = false;
if (_global.SoundOn) {
_global.Volume = 100;
}
_global.VolumeSet = 100;
musi(2);
StartingLevel = 1;
}
movieClip 175 {
}
movieClip 176 {
}
button 178 {
on (press) {
getURL('http://www.unboundedgames.com/', '_blank');
}
}
movieClip 180 {
}
movieClip 182 {
}
movieClip 183 {
instance of movieClip 180 {
onClipEvent (enterFrame) {
this._rotation += 3;
}
}
instance of movieClip 182 {
onClipEvent (enterFrame) {
this._rotation += 3;
}
}
}
movieClip 186 {
}
movieClip 187 {
}
movieClip 188 {
}
movieClip 191 {
}
button 198 {
on (press) {
this._parent.soun(13);
this._parent.StartingLevel = 15;
this._parent.gotoAndStop('Game');
}
}
button 199 {
on (press) {
this._parent.soun(13);
this._parent.StartingLevel = 20;
this._parent.gotoAndStop('Game');
}
}
button 200 {
on (press) {
this._parent.soun(13);
this._parent.StartingLevel = 10;
this._parent.gotoAndStop('Game');
}
}
button 201 {
on (press) {
this._parent.soun(13);
this._parent.StartingLevel = 25;
this._parent.gotoAndStop('Game');
}
}
button 202 {
on (press) {
this._parent.soun(13);
this._parent.StartingLevel = 5;
this._parent.gotoAndStop('Game');
}
}
movieClip 204 {
frame 1 {
this.RS = Math.random() * 10 + 20;
this._visible = false;
this.Vis = 0;
this.onEnterFrame = function () {
this._rotation -= this.RS;
if (Math.random() < 0.01) {
this.Vis = 6;
}
--this.Vis;
if (this.Vis > 1) {
this._visible = true;
} else {
this._visible = false;
}
};
}
}
// unknown tag 88 length 79
button 210 {
on (release) {
this.play();
}
}
button 215 {
on (release) {
this._parent.gotoAndStop('Tutorial');
}
}
movieClip 219 {
}
movieClip 220 {
frame 1 {
X = 0;
skills = new Array();
skills = ['Perception', 'Logic', 'Reflex', 'Psychology', 'Challenge', 'Frustration', 'Intellect', 'Skill', 'Stability', 'Panic', 'Determination', 'Priorities', 'Talent', 'Shapes', 'Colors', 'Secret Shortcuts'];
SL = skills.length;
time = 0;
About._alpha = 0;
About.DT.text = skills[X];
++X;
if (X >= SL) {
X = 0;
}
this.onEnterFrame = function () {
++time;
if (time < 35) {
About._alpha += 3;
}
if (time > 75) {
About._alpha -= 4;
}
if (time == 100) {
time = 0;
About._alpha = 0;
About.DT.text = skills[X];
++X;
if (X >= SL) {
X = 0;
}
}
};
}
}
movieClip 221 {
}
movieClip 225 {
frame 1 {
this._parent.soun(4);
}
frame 11 {
this._parent.soun(12);
this._parent.soun(8);
}
frame 18 {
stop();
this.tabChildren = false;
}
frame 19 {
if (this._parent.StartingLevel > 1) {
this._parent.soun(13);
} else {
this._parent.soun(11);
}
}
frame 28 {
this._parent.gotoAndStop('Game');
}
}
button 226 {
on (press) {
this._parent.soun(13);
this._parent.StartingLevel = 37;
this._parent.gotoAndStop('Game');
}
}
button 231 {
on (release) {
this._parent.gotoAndStop('Title');
this.removeMovieClip();
}
}
// unknown tag 88 length 89
movieClip 234 {
}
movieClip 242 {
}
instance gameOver of movieClip 242 {
onClipEvent (load) {
this._alpha = 0;
_global.VolumeSet = 50;
}
onClipEvent (enterFrame) {
if (this._alpha < 105) {
this._alpha += 5;
}
}
}
frame 4 {
GridWidth = 26;
GridHeight = 23;
Xoffset = 48;
Yoffset = 20;
BlockSize = 19;
overLay.swapDepths(10000005 + Math.floor(Math.random() * 100000));
}
frame 4 {
function gridScan() {
NumberOfBlocks = 0;
NumberOfBombs = 0;
NumberOfLasers = 0;
NumberOfEmpty = 0;
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
if (this.Grid[i][ii] == 1) {
++NumberOfEmpty;
} else {
if (this.Grid[i][ii] < 5) {
++NumberOfBlocks;
} else {
if (this.Grid[i][ii] < 8) {
++NumberOfEmpty;
} else {
if (this.Grid[i][ii] == 11) {
++NumberOfBombs;
} else {
if (this.Grid[i][ii] == 12 || this.Grid[i][ii] == 13) {
++NumberOfLasers;
}
}
}
}
}
++ii;
}
++i;
}
}
function levelUp() {
spawnText('Level ' + ColorScheme, 300, 255, 7);
LevelDrop = Math.round(ColorScheme * 1) + 10;
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
this['LED' + i + ',' + ii].orb.mask.gotoAndStop(Math.ceil((ColorScheme + 1) / 5));
++ii;
}
++i;
}
if (ColorScheme % 4 == 0 && ReverseGravity != true) {
ReverseGravity = true;
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
this['LED' + i + ',' + ii].grid.gotoAndStop(2);
this['LED' + i + ',' + ii]._y = (GridHeight - ii) * BlockSize;
++ii;
}
++i;
}
} else {
if (ReverseGravity == true) {
ReverseGravity = false;
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
this['LED' + i + ',' + ii].grid.gotoAndStop(1);
this['LED' + i + ',' + ii]._y = ii * BlockSize + Yoffset;
++ii;
}
++i;
}
}
}
}
function penaltyCross(X, Y) {
soun(9);
N = 0;
Grid[X][Y] = 10;
if (Grid[X - 1][Y] != 1 && Grid[X - 1][Y] < 5) {
Grid[X - 1][Y] = 8;
++N;
}
if (Grid[X + 1][Y] != 1 && Grid[X + 1][Y] < 5) {
Grid[X + 1][Y] = 8;
++N;
}
if (Grid[X][Y - 1] != 1 && Grid[X][Y - 1] < 5) {
Grid[X][Y - 1] = 8;
++N;
}
if (Grid[X][Y + 1] != 1 && Grid[X][Y + 1] < 5) {
Grid[X][Y + 1] = 8;
++N;
}
if (N > 0) {
spawnText('*', _xmouse, _ymouse - 5);
}
}
function dropRandom() {
if (Math.floor(_global.Frames / 100) % 4 != 0) {
Drop = Math.floor(Math.random() * GridWidth);
} else {
Drop = DropStreak;
++DropStreak;
}
if (Math.floor(_global.Frames / 35) % 6 == 0 && LevelDrop < 2) {
if (Math.random() < 0.5) {
i = 0;
while (i < GridWidth) {
if (Grid[i][0] == 1 && Math.random() < 0.5) {
Drop = i;
break;
}
++i;
}
} else {
i = GridWidth;
while (i > 0) {
if (Grid[i][0] == 1 && Math.random() < 0.5) {
Drop = i;
break;
}
--i;
}
}
}
if (DropStreak >= GridWidth) {
DropStreak = 0;
}
i = 0;
while (i < 8) {
if (Grid[Drop][0] != 1) {
Drop = Math.floor(Math.random() * GridWidth);
} else {
if (Grid[Drop][1] != 1 && Math.random() < 0.15) {
Drop = Math.floor(Math.random() * GridWidth);
} else {
if (Grid[Drop][2] != 1 && Math.random() < 0.1) {
Drop = Math.floor(Math.random() * GridWidth);
} else {
break;
}
}
}
++i;
}
if (Grid[Drop][0] != 1) {
Drop = -1;
}
if (Drop >= 0 && Grid[Drop][0] == 1) {
Grid[Drop][0] = Math.ceil(Math.random() * 3) + 1;
if (ColorScheme > LastColorScheme) {
if (Math.random() < 0.09) {
Grid[Drop][0] = 11;
} else {
if (Math.random() < 0.006) {
Grid[Drop][0] = 12;
} else {
if (Math.random() < 0.003) {
Grid[Drop][0] = 13;
}
}
}
} else {
J = 0.02 - NumberOfBombs * 0.001;
K = 0.01 - NumberOfLasers * 0.0005;
L = 0.005 - NumberOfLasers * 0.00025;
if (Math.random() < J) {
Grid[Drop][0] = 11;
} else {
if (Math.random() < K) {
Grid[Drop][0] = 12;
} else {
if (Math.random() < L) {
Grid[Drop][0] = 13;
}
}
}
}
}
}
function topRow() {
Counter = 0;
if (Counter3 > 100) {
i = 0;
while (i < GridWidth) {
if (Grid[i][0] > 1 && Grid[i][0] < 5 || Grid[i][0] >= 10) {
Counter2 = 0;
ii = 0;
while (ii < GridHeight) {
if ((Grid[i][ii] > 7 || Grid[i][ii] < 5) && Grid[i][ii] != 1) {
++Counter2;
}
++ii;
}
if (Counter2 >= GridHeight) {
soun(8);
ii = 0;
while (ii < GridHeight) {
Grid[i][ii] = 9;
++ii;
}
}
} else {
if (Grid[i][ii] == 9) {
++Counter;
}
}
++i;
}
}
if (Counter >= GridWidth && Counter3 > 100) {
Counter = 0;
_global.GameOver = true;
blockScreen();
Counter3 = 15;
soun(4);
}
if (Counter3 < 100 && Counter3 > -10) {
--Counter3;
}
if (Counter3 == 4) {
soun(4);
soun(12);
overLay.play();
}
if (Counter3 < 1) {
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
this['LED' + i + ',' + ii].removeMovieClip();
++ii;
}
++i;
}
gotoAndStop('GameOver');
}
}
function spawnText(Num, X, Y, ScaleMod) {
var v3 = this.attachMovie('TextBox', T + _global.cDepth, _global.cDepth);
++_global.cDepth;
v3._x = X;
v3._y = Y;
v3.DT.text = Num;
if (ScaleMod == undefined) {
ScaleMod = Math.floor(BlocksExploded / 10) + 1;
}
if (ScaleMod > 40) {
ScaleMod = 40;
}
v3._xscale += ScaleMod * 20;
v3._yscale += ScaleMod * 20;
v3.Life = 14 + ScaleMod;
v3.onEnterFrame = function () {
--this._y;
--this.Life;
if (this.Life < 5) {
this._alpha -= 15;
}
if (this.Life < 1) {
this.removeMovieClip();
}
};
}
function calcScore() {
ScoreAdd = BlocksExploded * BlocksExploded + BlocksExploded * 5 + BlocksExploded * ColorScheme;
Score += ScoreAdd;
spawnText(ScoreAdd, _xmouse, _ymouse - 5);
BlocksExploded = 0;
}
function penalty() {
i = 0;
while (i < GridWidth) {
Grid[i][0] = Math.ceil(Math.random() * 3) + 1;
++i;
}
}
function highlightLED() {
X = Math.floor((_xmouse - Xoffset) / BlockSize);
Y = Math.floor((_ymouse - Yoffset) / BlockSize);
LHL._x = X * BlockSize + Xoffset;
LHL._y = Y * BlockSize + Yoffset;
if (MouseTime < 5) {
LHL.gotoAndStop(2);
} else {
LHL.gotoAndStop(1);
}
if (X > GridWidth - 1 || Y > GridHeight - 1) {
LHL._visible = false;
} else {
if (X < 0 || Y < 0) {
LHL._visible = false;
} else {
LHL._visible = true;
}
}
}
function initialSweep(X, Y, Z) {
i = X - 9;
while (i < X + 9) {
ii = Y + 7;
while (ii >= Y - 7) {
if (ExplGrid[i][ii] == 1 && Grid[i][ii] == Z) {
explodeGrid(i, ii, Z);
}
--ii;
}
++i;
}
i = X + 9;
while (i >= X - 9) {
ii = Y - 7;
while (ii < Y + 7) {
if (ExplGrid[i][ii] == 1 && Grid[i][ii] == Z) {
explodeGrid(i, ii, Z);
}
++ii;
}
--i;
}
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
if (ExplGrid[i][ii] == 1 && Grid[i][ii] == Z) {
explode(i, ii);
}
++ii;
}
++i;
}
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
ExplGrid[i][ii] = 0;
++ii;
}
++i;
}
}
function explodeCheck() {
BlocksExploded = 0;
X = Math.floor((_xmouse - Xoffset) / BlockSize);
Y = Math.floor((_ymouse - Yoffset) / BlockSize);
if (ReverseGravity == true) {
Y = GridHeight - Y - 1;
}
N = 1;
Z = Grid[X][Y];
if (Z > 1 && Z != undefined && Z < 5) {
if (Grid[X - 1][Y] == Z) {
++N;
}
if (Grid[X + 1][Y] == Z) {
++N;
}
if (Grid[X][Y - 1] == Z) {
++N;
}
if (Grid[X][Y + 1] == Z) {
++N;
}
if (N > 1) {
ExplGrid[X][Y] = 1;
S = Z + 3;
soun(S);
initialSweep(X, Y, Z);
} else {
Y2 = Y;
if (ReverseGravity == true) {
Y2 = GridHeight - Y - 1;
}
var v3 = this.attachMovie('GreyGFX', 'L' + _global.cDepth, _global.cDepth);
++_global.cDepth;
v3._x = (X + 0.5) * BlockSize + Xoffset;
v3._y = (Y2 + 0.5) * BlockSize + Yoffset;
v3.Life = 7;
v3.onEnterFrame = function () {
--this.Life;
if (this.Life == 0) {
this._alpha = 50;
} else {
this._yscale *= 1.2;
this._xscale *= 1.2;
}
if (this.Life < 0) {
this.removeMovieClip();
}
};
Grid[X][Y] = 8;
soun(10);
}
calcScore();
} else {
if (Z == 8) {
Y2 = Y;
if (ReverseGravity == true) {
Y2 = GridHeight - Y - 1;
}
var v3 = this.attachMovie('GreyGFX2', 'L' + _global.cDepth, _global.cDepth);
++_global.cDepth;
v3._x = (X + 0.5) * BlockSize + Xoffset;
v3._y = (Y2 + 0.5) * BlockSize + Yoffset;
v3.Life = 7;
v3.onEnterFrame = function () {
--this.Life;
if (this.Life == 0) {
this._alpha = 50;
} else {
this._yscale *= 1.25;
this._xscale *= 1.25;
}
if (this.Life < 0) {
this.removeMovieClip();
}
};
penaltyCross(X, Y);
} else {
if (Z == 11) {
Y2 = Y;
if (ReverseGravity == true) {
Y2 = GridHeight - Y - 1;
}
soun(2);
var v3 = this.attachMovie('BombGFX', 'L' + _global.cDepth, _global.cDepth);
++_global.cDepth;
v3._x = (X + 0.5) * BlockSize + Xoffset;
v3._y = (Y2 + 0.5) * BlockSize + Yoffset;
v3.Life = 6;
v3.onEnterFrame = function () {
--this.Life;
if (this.Life == 0) {
this._alpha = 50;
} else {
this._yscale *= 1.53;
this._xscale *= 1.53;
}
if (this.Life < 0) {
this.removeMovieClip();
}
};
popCross(X - 2, Y);
popCross(X + 2, Y);
popCross(X, Y - 1);
popCross(X, Y - 2);
popCross(X, Y + 1);
popCross(X, Y + 2);
Grid[X][Y] = 1;
calcScore();
} else {
if (Z == 12) {
Y2 = Y;
if (ReverseGravity == true) {
Y2 = GridHeight - Y - 1;
}
soun(3);
var v3 = this.attachMovie('LaserGFX', 'L' + _global.cDepth, _global.cDepth);
++_global.cDepth;
v3._x = (X + 0.5) * BlockSize + Xoffset;
v3._y = (Y2 + 0.5) * BlockSize + Yoffset;
v3.Life = 6;
v3._rotation = 90;
v3.onEnterFrame = function () {
--this.Life;
this._yscale *= 4;
this._xscale -= 10;
if (this.Life == 1) {
this._alpha = 50;
}
if (this.Life < 0) {
this.removeMovieClip();
}
};
i = 0;
while (i < GridWidth) {
pop(i, Y);
++i;
}
Grid[X][Y] = 1;
calcScore();
} else {
if (Z == 13) {
Y2 = Y;
if (ReverseGravity == true) {
Y2 = GridHeight - Y - 1;
}
soun(3);
var v3 = this.attachMovie('LaserGFX', 'L' + _global.cDepth, _global.cDepth);
++_global.cDepth;
v3._x = (X + 0.5) * BlockSize + Xoffset;
v3._y = (Y2 + 0.5) * BlockSize + Yoffset;
v3.Life = 6;
v3.onEnterFrame = function () {
--this.Life;
this._yscale *= 4;
this._xscale -= 10;
if (this.Life == 1) {
this._alpha = 50;
}
if (this.Life < 0) {
this.removeMovieClip();
}
};
i = 0;
while (i < GridHeight) {
pop(X, i);
++i;
}
Grid[X][Y] = 1;
calcScore();
}
}
}
}
}
}
function pop(X, Y) {
Z = Grid[X][Y];
if (Z > 1 && Z != undefined && Z < 5) {
ClearedFlashes = false;
ClearFlashes = 6;
Grid[X][Y] += 3;
BlocksExploded += 1;
}
if (Z == 8) {
Grid[X][Y] = 1;
}
}
function popCross(X, Y) {
ClearedFlashes = false;
ClearFlashes = 6;
pop(X, Y);
pop(X - 1, Y);
pop(X + 1, Y);
pop(X, Y - 1);
pop(X, Y + 1);
}
function explode(X, Y) {
ClearedFlashes = false;
ClearFlashes = 6;
Z = Grid[X][Y];
if (Z > 1 && Z != undefined && Z < 5) {
Grid[X][Y] += 3;
BlocksExploded += 1;
if (Grid[X - 1][Y] == Z) {
explode(X - 1, Y);
}
if (Grid[X + 1][Y] == Z) {
explode(X + 1, Y);
}
if (Grid[X][Y - 1] == Z) {
explode(X, Y - 1);
}
if (Grid[X][Y + 1] == Z) {
explode(X, Y + 1);
}
}
}
function explodeGrid(X, Y, Z) {
ExplGrid[X][Y] = 0;
ClearedFlashes = false;
ClearFlashes = 6;
if (Z > 1 && Z != undefined) {
Grid[X][Y] += 3;
BlocksExploded += 1;
if (Grid[X - 1][Y] == Z) {
ExplGrid[X - 1][Y] = 1;
}
if (Grid[X + 1][Y] == Z) {
ExplGrid[X + 1][Y] = 1;
}
if (Grid[X][Y - 1] == Z) {
ExplGrid[X][Y - 1] = 1;
}
if (Grid[X][Y + 1] == Z) {
ExplGrid[X][Y + 1] = 1;
}
}
}
function clearFlashes() {
i = 0;
while (i < GridWidth) {
ii = GridHeight - 1;
while (ii >= 0) {
if (Grid[i][ii] > 4 && Grid[i][ii] < 8) {
Grid[i][ii] = 1;
}
--ii;
}
++i;
}
}
function refreshScreen() {
CS = ColorScheme % 22;
if (ColorScheme > 21) {
CS += 1;
}
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
this['LED' + i + ',' + ii].gotoAndStop(Grid[i][ii]);
this['LED' + i + ',' + ii].orb.gotoAndStop(CS);
++ii;
}
++i;
}
}
function blockScreen() {
i = BlockScreenSlider;
while (i < GridWidth) {
if (Grid[i][0] != 10) {
ii = 0;
while (ii < GridHeight) {
this['LED' + i + ',' + ii].gotoAndStop(10);
++ii;
}
break;
}
++i;
}
i = GridWidth - BlockScreenSlider - 1;
while (i >= 0) {
if (Grid[i][0] != 10) {
ii = 0;
while (ii < GridHeight) {
this['LED' + i + ',' + ii].gotoAndStop(10);
++ii;
}
break;
}
--i;
}
++BlockScreenSlider;
}
function gravity() {
i = 0;
while (i < GridWidth) {
ii = GridHeight - 1;
while (ii > 0) {
if (Grid[i][ii] == 1 && Grid[i][ii - 1] != 1) {
Grid[i][ii] = Grid[i][ii - 1];
Grid[i][ii - 1] = 1;
}
--ii;
}
++i;
}
}
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 getMouseDist(Self, Target) {
DX = Self._x - Target._xmouse;
DY = Self._y - Target._ymouse;
Dis = Math.sqrt(this.DX * this.DX + this.DY * this.DY);
return Dis;
}
delete this.onMouseUp;
_global.GameOver = false;
_global.cDepth = 1000;
_global.Frames = 0;
_global.LeaderBoard = false;
_global.ShowingBoard = false;
Score = 0;
FallDelay = 5;
DropStreak = 0;
NumberOfBlocks = 0;
NumberofBombs = 0;
NumberOfLasers = 0;
NumberOfEmpty = 0;
ClearFlashes = 0;
MouseTime = 100;
DelayTimer = 0;
ToggleLock = 1;
LevelDrop = 0;
ColorScheme = StartingLevel;
if (StartingLevel == undefined) {
ColorScheme = 1;
}
LastColorScheme = ColorScheme;
Xmodulus = 4;
Xmod2 = 1;
if (Math.random() < 0.5) {
Xmod2 *= -1;
}
Ymodulus = 1;
BlockScreenSlider = 0;
Counter3 = 999;
Grid = new Array();
ExplGrid = new Array();
i = 0;
while (i < GridWidth) {
Grid[i] = new Array();
ExplGrid[i] = new Array();
ii = 0;
while (ii < GridHeight) {
Grid[i][ii] = 1;
if (ii % Ymodulus == 0 && (i - Xmod2 * ii) % Xmodulus == 0) {
Grid[i][ii] = Math.ceil(Math.random() * 3) + 1;
}
ExplGrid[i][ii] = 0;
var LED = this.attachMovie('LED', 'LED' + i + ',' + ii, _global.cDepth);
++_global.cDepth;
LED._x = i * BlockSize + Xoffset;
LED._y = ii * BlockSize + Yoffset;
++ii;
}
++i;
}
var LEDHL = this.attachMovie('LEDHL', 'LHL', _global.cDepth);
++_global.cDepth;
stageBG.Time = 0;
stageBG.onEnterFrame = function () {
if (_global.Frames % 3 == 0 && !_global.Paused) {
this.play();
} else {
this.stop();
}
};
ReverseGravity = false;
if (ColorScheme % 4 == 0 && ReverseGravity != true) {
ReverseGravity = true;
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
this['LED' + i + ',' + ii].grid.gotoAndStop(2);
this['LED' + i + ',' + ii]._y = (GridHeight - ii) * BlockSize;
++ii;
}
++i;
}
} else {
if (ReverseGravity == true) {
ReverseGravity = false;
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
this['LED' + i + ',' + ii].grid.gotoAndStop(1);
this['LED' + i + ',' + ii]._y = ii * BlockSize + Yoffset;
++ii;
}
++i;
}
}
}
musi(1);
if (StartingLevel > 1) {
soun(13);
}
spawnText('Level ' + ColorScheme, 300, 255, 7);
this.onMouseDown = function () {
MouseTime = 0;
};
this.onEnterFrame = function () {
Score_txt.text = 'Score: ' + Score;
Level_txt.text = 'Level: ' + ColorScheme;
if (_global.Paused != true) {
_global.VolumeSet = 100;
} else {
if (_global.Paused) {
_global.VolumeSet = 40;
}
}
if (ToggleLock > 2) {
--ToggleLock;
}
if (Key.isDown(32)) {
if (ToggleLock < 1) {
soun(11);
if (!_global.Paused) {
_global.Paused = true;
ToggleLock = 15;
} else {
if (_global.Paused) {
_global.Paused = false;
ToggleLock = 2;
BlockScreenSlider = 0;
}
}
}
} else {
--ToggleLock;
}
if (!_global.Paused) {
++MouseTime;
--ClearFlashes;
++DelayTimer;
--LevelDrop;
++_global.Frames;
FallDelay = Math.round(400 - NumberOfEmpty);
if (FallDelay > Math.round((30 - ColorScheme) / 2)) {
FallDelay = Math.round((30 - ColorScheme) / 2);
}
if (FallDelay < 7 - ColorScheme) {
FallDelay = 7 - ColorScheme;
}
if (FallDelay < 2) {
FallDelay = 2;
}
if (_global.Frames % 2 == 0) {
refreshScreen();
}
if (_global.Frames % 2 == 0) {
gravity();
topRow();
}
if (_global.Frames % 10 == 0) {
gridScan();
}
if (ClearFlashes < 1 && ClearedFlashes != true) {
clearFlashes();
ClearedFlashes = true;
}
if (ColorScheme > LastColorScheme) {
levelUp();
}
LastColorScheme = ColorScheme;
if (_global.Frames % FallDelay == 0 || Math.random() < 0.15) {
dropRandom();
}
if (LevelDrop > 0) {
dropRandom();
dropRandom();
dropRandom();
dropRandom();
}
if (MouseTime < 2 && ClearFlashes < 1) {
explodeCheck();
}
if (Counter3 < 100 && BlockScreenSlider - 1 < GridWidth / 2) {
blockScreen();
}
highlightLED();
} else {
if (BlockScreenSlider - 1 < GridWidth / 2) {
blockScreen();
}
}
};
}
movieClip 246 {
}
movieClip 253 {
instance of movieClip 246 {
onClipEvent (enterFrame) {
if (_global.Paused != true) {
this._xscale += 28;
this._yscale += 28;
}
}
}
frame 193 {
this._parent.soun(4);
}
frame 195 {
this._parent.overLay.gotoAndPlay(2);
++this._parent.ColorScheme;
}
}
instance stageBG of movieClip 253 {
onClipEvent (load) {
this._x = this._parent.Xoffset;
this._y = this._parent.Yoffset;
this._width = this._parent.GridWidth * this._parent.BlockSize + 4;
this._height = this._parent.GridHeight * this._parent.BlockSize + 4;
}
}
button 259 {
on (release) {
this._parent.soun(11);
_global.Paused = true;
}
}
button 264 {
on (release) {
this._parent.soun(11);
_global.Paused = false;
this._parent.BlockScreenSlider = 0;
}
}
button 266 {
on (release) {
this._parent.soun(11);
_global.Paused = true;
}
}
button 268 {
on (release) {
this._parent.soun(11);
_global.Paused = false;
this._parent.BlockScreenSlider = 0;
}
}
movieClip 269 {
frame 1 {
this.onEnterFrame = function () {
if (this._parent.ColorScheme % 7 != 0) {
if (_global.Paused) {
gotoAndStop(2);
} else {
gotoAndStop(1);
}
} else {
if (_global.Paused) {
gotoAndStop(4);
} else {
gotoAndStop(3);
}
}
};
}
}
button 274 {
on (release) {
_global.Paused = false;
BlockScreenSlider = 0;
i = 0;
while (i < GridWidth) {
ii = 0;
while (ii < GridHeight) {
Grid[i][ii] = 10;
++ii;
}
++i;
}
}
}
movieClip 277 {
frame 1 {
stop();
}
}
instance overLay of movieClip 277 {
onClipEvent (load) {
this._x = this._parent.Xoffset;
this._y = this._parent.Yoffset;
this._width = this._parent.GridWidth * this._parent.BlockSize;
this._height = this._parent.GridHeight * this._parent.BlockSize;
}
}
movieClip 279 {
}
instance of movieClip 279 {
onClipEvent (load) {
this.swapDepths(10000000000001.0);
this._visible = false;
}
onClipEvent (enterFrame) {
if (_global.Paused) {
this._visible = true;
} else {
this._visible = false;
}
}
}
frame 5 {
overLay.removeMovieClip();
}
frame 5 {
delete this.onEnterFrame;
LHL.removeMovieClip();
Score_txt.text = 'Score: ' + Score;
Level_txt.text = 'Level: ' + ColorScheme;
manageSound();
}
button 284 {
on (release) {
_global.LeaderBoard = true;
this.removeMovieClip();
}
}
button 289 {
on (release) {
this._parent.gotoAndStop('Title');
this.removeMovieClip();
}
}
movieClip 291 {
}
movieClip 292 {
instance of movieClip 291 {
onClipEvent (load) {
this._parent._alpha = 0;
}
onClipEvent (enterFrame) {
if (this._parent._alpha < 105) {
this._parent._alpha += 5;
}
}
}
}
button 300 {
on (release) {
getURL('http://cdn.mochiads.com/c/g/chaos-chamber.zip', '_blank');
}
}
movieClip 301 {
frame 1 {
Level.text = 'You made it to Level ' + this._parent.ColorScheme + ' before complete lockdown.';
Score_txt.text = 'Score: ' + this._parent.Score;
}
}
instance gameOver of movieClip 301 {
onClipEvent (load) {
this.swapDepths(10000000000002.0);
this._alpha = 0;
_global.VolumeSet = 60;
this.tabChildren = false;
}
onClipEvent (enterFrame) {
if (_global.GameOver != true) {
this._alpha = 0;
}
if (this._alpha < 105 && _global.GameOver) {
this._alpha += 5;
}
}
}
movieClip 304 {
frame 1 {
stop();
}
frame 3 {
_global.LeaderBoard = false;
_global.ShowingBoard = false;
this.gotoAndStop(1);
this._parent.gotoAndStop('Title');
}
}
instance Clip1 of movieClip 304 {
onClipEvent (enterFrame) {
if (_global.LeaderBoard == true && _global.ShowingBoard != true) {
_global.ShowingBoard = true;
var o = {'n': [3, 4, 1, 5, 11, 1, 0, 11, 15, 8, 6, 5, 3, 12, 15, 10], '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': 'c8f1fdcb0e21c200', 'score': this._parent.Score});
}
}
}