Combined Code
movieClip 17 Ball {
}
movieClip 21 Cone {
#initclip
Object.registerClass('Cone', Cone);
#endinitclip
}
movieClip 23 Shadow {
#initclip
Object.registerClass('Shadow', Shadow);
#endinitclip
}
// unknown tag 88 length 150
movieClip 30 Target {
#initclip
Object.registerClass('Target', Target);
#endinitclip
}
// unknown tag 88 length 148
movieClip 33 Points {
#initclip
Object.registerClass('Points', Points);
#endinitclip
}
movieClip 37 screenHighScores {
}
movieClip 56 screenComplete {
}
movieClip 68 screenResult {
}
movieClip 81 AdvertPage {
}
movieClip 85 inputNameBox {
}
movieClip 92 screenInstrucs {
}
movieClip 107 TitleScreen {
}
movieClip 110 Mouse {
}
movieClip 113 Arrow {
#initclip
Object.registerClass('Arrow', Arrow);
#endinitclip
}
movieClip 122 Player {
#initclip
Object.registerClass('Player', Player);
#endinitclip
}
movieClip 125 imgBoss5 {
}
movieClip 128 imgBoss3 {
}
movieClip 131 imgBoss2 {
}
movieClip 134 imgBoss1 {
}
frame 1 {
var kongregate = false;
if (kongregate) {
_root.kongregateServices.connect();
} else {
var _mochiads_game_id = '767895ad2733d4ba';
MochiAd.showPreGameAd({'id': '767895ad2733d4ba', 'res': '480x400'});
mochi.MochiServices.connect('767895ad2733d4ba');
}
}
movieClip 144 __Packages.mochi.MochiServices {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.MochiServices) {
var v1 = function () {};
mochi.MochiServices = v1;
var v2 = v1.prototype;
v1.__get__id = function () {
return mochi.MochiServices._id;
};
v1.__get__clip = function () {
return mochi.MochiServices._container;
};
v1.__get__childClip = function () {
return mochi.MochiServices._clip;
};
v1.getVersion = function () {
return '1.43';
};
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.MochiServices._sendChannelName = val + '_fromgame';
mochi.MochiServices.initComChannels();
}
}
return mochi.MochiServices.__get__comChannelName();
};
v1.__get__connected = function () {
return mochi.MochiServices._connected;
};
v1.connect = function (id, clip, onError) {
if (!mochi.MochiServices._connected && mochi.MochiServices._clip == undefined) {
trace('MochiServices Connecting...');
mochi.MochiServices._connecting = true;
mochi.MochiServices.init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else {
if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
};
v1.disconnect = function () {
if (mochi.MochiServices._connected || mochi.MochiServices._connecting) {
mochi.MochiServices._connected = false;
mochi.MochiServices._connecting = mochi.MochiServices._connected;
mochi.MochiServices.flush(true);
if (mochi.MochiServices._clip != undefined) {
mochi.MochiServices._clip.removeMovieClip();
delete mochi.MochiServices._clip;
}
mochi.MochiServices._listenChannel.close();
}
};
v1.init = function (id, clip) {
mochi.MochiServices._id = id;
if (clip != undefined) {
mochi.MochiServices._container = clip;
} else {
mochi.MochiServices._container = _root;
}
mochi.MochiServices.loadCommunicator(id, mochi.MochiServices._container);
};
v1.loadCommunicator = function (id, clip) {
var v3 = '_mochiservices_com_' + id;
if (mochi.MochiServices._clip != null) {
return mochi.MochiServices._clip;
}
if (!mochi.MochiServices.__get__isNetworkAvailable()) {
return null;
}
if ((mochi.MochiServices.urlOptions()).servicesURL != undefined) {
mochi.MochiServices._servicesURL = (mochi.MochiServices.urlOptions()).servicesURL;
}
mochi.MochiServices.allowDomains(mochi.MochiServices._servicesURL);
mochi.MochiServices._clip = clip.createEmptyMovieClip(v3, 10336, false);
mochi.MochiServices._listenChannelName += Math.floor((new Date()).getTime()) + '_' + Math.floor(Math.random() * 99999);
mochi.MochiServices._loader = new MovieClipLoader();
if (mochi.MochiServices._loaderListener.waitInterval != null) {
clearInterval(mochi.MochiServices._loaderListener.waitInterval);
}
mochi.MochiServices._loaderListener = {};
mochi.MochiServices._loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace('MochiServices could not load.');
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
mochi.MochiServices._loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
mochi.MochiServices._loaderListener.startTime = getTimer();
mochi.MochiServices._loaderListener.wait = function () {
if (getTimer() - this.startTime > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ['IOError']);
}
clearInterval(this.waitInterval);
}
};
mochi.MochiServices._loaderListener.waitInterval = setInterval(mochi.MochiServices._loaderListener, 'wait', 1000);
mochi.MochiServices._loader.addListener(mochi.MochiServices._loaderListener);
mochi.MochiServices._loader.loadClip(mochi.MochiServices._servicesURL + '?listenLC=' + mochi.MochiServices._listenChannelName + '&mochiad_options=' + escape(_root.mochiad_options), mochi.MochiServices._clip);
mochi.MochiServices._sendChannel = new LocalConnection();
mochi.MochiServices._sendChannel._queue = [];
mochi.MochiServices.listen();
return mochi.MochiServices._clip;
};
v1.onStatus = function (infoObject) {
if (infoObject.level !== 'error') {
} else {
mochi.MochiServices._connected = false;
mochi.MochiServices._listenChannel.connect(mochi.MochiServices._listenChannelName);
}
};
v1.listen = function () {
mochi.MochiServices._listenChannel = new LocalConnection();
mochi.MochiServices._listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
mochi.MochiServices._listenChannel.allowDomain = function (d) {
return true;
};
mochi.MochiServices._listenChannel.allowInsecureDomain = mochi.MochiServices._listenChannel.allowDomain;
mochi.MochiServices._listenChannel._nextcallbackID = 0;
mochi.MochiServices._listenChannel._callbacks = {};
mochi.MochiServices._listenChannel.connect(mochi.MochiServices._listenChannelName);
trace('Waiting for MochiAds services to connect...');
};
v1.initComChannels = function () {
if (!mochi.MochiServices._connected) {
mochi.MochiServices._sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
mochi.MochiServices._sendChannel.send(mochi.MochiServices._sendChannelName, 'onReceive', {'methodName': 'handshakeDone'});
mochi.MochiServices._sendChannel.send(mochi.MochiServices._sendChannelName, 'onReceive', {'methodName': 'registerGame', 'id': mochi.MochiServices._id, 'clip': mochi.MochiServices._clip, 'version': /:$version});
mochi.MochiServices._listenChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
mochi.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.MochiServices._listenChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ['IOError']);
};
trace('connected!');
mochi.MochiServices._connecting = false;
mochi.MochiServices._connected = true;
while (mochi.MochiServices._sendChannel._queue.length > 0) {
mochi.MochiServices._sendChannel.send(mochi.MochiServices._sendChannelName, 'onReceive', mochi.MochiServices._sendChannel._queue.shift());
}
}
};
v1.flush = function (error) {
var v1;
var v2;
while (mochi.MochiServices._sendChannel._queue.length > 0) {
v1 = mochi.MochiServices._sendChannel._queue.shift();
false;
if (v1.callbackID != null) {
v2 = mochi.MochiServices._listenChannel._callbacks[v1.callbackID];
}
delete mochi.MochiServices._listenChannel._callbacks[v1.callbackID];
if (error) {
mochi.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.MochiServices._connected) {
mochi.MochiServices._sendChannel.send(mochi.MochiServices._sendChannelName, 'onReceive', {'methodName': methodName, 'args': args, 'callbackID': mochi.MochiServices._listenChannel._nextcallbackID});
} else {
if (mochi.MochiServices._clip == undefined || !mochi.MochiServices._connecting) {
mochi.MochiServices.onError.apply(null, ['NotConnected']);
mochi.MochiServices.handleError(args, callbackObject, callbackMethod);
mochi.MochiServices.flush(true);
return undefined;
} else {
mochi.MochiServices._sendChannel._queue.push({'methodName': methodName, 'args': args, 'callbackID': mochi.MochiServices._listenChannel._nextcallbackID});
}
}
mochi.MochiServices._listenChannel._callbacks[mochi.MochiServices._listenChannel._nextcallbackID] = {'callbackObject': callbackObject, 'callbackMethod': callbackMethod};
++mochi.MochiServices._listenChannel._nextcallbackID;
};
v1.urlOptions = function () {
var v5 = {};
if (_root.mochiad_options) {
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.addLinkEvent = function (url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var v2 = new Object();
v2.mav = /:$version;
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.MochiServices.netupAttempted || mochi.MochiServices._connected)) {
var ping = btn.createEmptyMovieClip('ping', 777);
var v7 = btn.createEmptyMovieClip('nettest', 778);
mochi.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.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.MochiServices.netup) {
getURL(url + s, '_blank');
} else {
getURL(burl, '_blank');
}
if (onClick != undefined) {
onClick();
}
};
};
v1._servicesURL = 'http://www.mochiads.com/static/lib/services/services.swf';
v1._listenChannelName = '__ms_';
v1._connecting = false;
v1._connected = false;
v1.netup = true;
v1.netupAttempted = false;
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.MochiServices.prototype, null, 1);
}
#endinitclip
}
movieClip 145 __Packages.MochiAd {
#initclip
if (!_global.MochiAd) {
var v1 = function () {};
_global.MochiAd = v1;
var v2 = v1.prototype;
v1.getVersion = function () {
return '2.7';
};
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 = MochiAd._parseOptions(options, v26);
if ('c862232051e0a94e1c3609b3916ddb17'.substr(0) == 'dfeada81ac97cde83665f81c12da7def') {
options.ad_started();
options.ad_finished();
return undefined;
}
var clip = options.clip;
var v22 = 11000;
var v25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!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 = 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 v21 = options.color;
delete options.color;
var v19 = options.background;
delete options.background;
var v23 = options.outline;
delete options.outline;
var v5 = v6.createEmptyMovieClip('_outline', 1);
v5.beginFill(v19);
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(v21);
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, v23, 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 = v22;
chk.ad_timeout = v25;
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;
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) {
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) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, 'notify', {'id': 'hostLoadPcnt', 'pcnt': v2});
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 = MochiAd._parseOptions(options, v9);
var clip = options.clip;
var v8 = options.ad_timeout;
delete options.ad_timeout;
if (!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 = 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) {
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 = 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 (!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 = 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;
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) {
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');
MochiAd.showPreGameAd(options);
};
v1.showTimedAd = function (options) {
trace('[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0');
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 = MochiAd._parseOptions(options, v13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = MochiAd.getVersion();
var v9 = options.clip;
if (!MochiAd._isNetworkAvailable()) {
return null;
}
if (v9._mochiad_loaded) {
return null;
}
var v12 = options.depth;
delete options.depth;
var v6 = v9.createEmptyMovieClip('_mochiad', v12);
var v11 = MochiAd._getRes(options);
options.res = v11[0] + 'x' + v11[1];
options.server += options.id;
delete options.id;
v9._mochiad_loaded = true;
var v4 = v6.createEmptyMovieClip('_mochiad_ctr', 1);
for (var v7 in options) {
v4[v7] = options[v7];
}
var v10 = v4.server;
delete v4.server;
var v14 = MochiAd._allowDomains(v10);
v6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var v5 = new LocalConnection();
var v8 = ['', Math.floor((new Date()).getTime()), random(999999)].join('_');
v5.mc = v6;
v5.name = v8;
v5.hostname = v14;
v5.allowDomain = function (d) {
return true;
};
v5.allowInsecureDomain = v5.allowDomain;
v5.connect(v8);
v6.lc = v5;
v4.lc = v8;
v4.st = getTimer();
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;
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, 'notify', {'id': 'unload'});
}
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':
MochiAd.setValue(clip, arg.objectName, arg.value);
break;
case 'getValue':
var v4 = MochiAd.getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, 'rpcResult', callbackID, v4);
break;
case 'runMethod':
var v3 = MochiAd.runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, 'rpcResult', callbackID, v3);
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;
}
};
ASSetPropFlags(_global.MochiAd.prototype, null, 1);
}
#endinitclip
}
movieClip 146 __Packages.Shadow {
#initclip
if (!_global.Shadow) {
var v1 = function () {
super();
};
_global.Shadow = v1;
_global.Shadow extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.ball = _root.attachMovie('Ball', 'Ball1', _root.getNextHighestDepth());
this.ball._x = this._x;
this.ball._y = this._y;
this.bouncecount = 0;
this.frameCounter = 0;
this.frame = 1;
this.ball.gotoAndStop(this.frame);
this.live = true;
};
v2.onEnterFrame = function () {
this.speed *= 0.985;
if (this.speed < 2) {
this.speed *= 0.965;
}
var v4 = false;
if (this.ballheight > 0) {
this.ballheight += this.zspeed;
this.zspeed -= this.gravity;
} else {
if (this.ballheight < 0) {
this.zspeed = -this.zspeed * 0.6;
this.ballheight = 0.1;
if (this.zspeed < 1.5) {
this.ballheight = 0;
}
this.bouncecount += 1;
v4 = true;
}
}
if (this.speed > 0.1) {
this._x += Math.cos(this.direc * Math.PI / 180) * this.speed;
this._y += Math.sin(this.direc * Math.PI / 180) * this.speed;
this.frameCounter += this.speed;
if (this.frameCounter > 4) {
this.frameCounter = 0;
this.frame -= 1;
if (this.frame < 1) {
this.frame = 4;
}
this.ball.gotoAndStop(this.frame);
}
}
this.ball._x = this._x;
this.ball._y = this._y - this.ballheight;
if (this._y < 36) {
this._y = 38;
this.direc = -this.direc;
this.multiplier += 1;
if (this._x > 0 && this._x < this.screenW) {
_root.soundFX.attachSound('Post.wav');
_root.soundFX.start();
}
}
for (var v5 in _root.myPlayer.cones) {
if (_root.myPlayer.cones[v5].live == true) {
if (_root.getDistance(this._x, this._y, _root.myPlayer.cones[v5]._x, _root.myPlayer.cones[v5]._y) < 10 && this.ballheight < 10) {
this.direc += Math.random() * 60 - 30;
this.speed *= 0.75;
if (this.bouncecount == 0) {
this.multiplier += 1;
}
if (this._x < _root.myPlayer.cones[v5]._x) {
this.multiplier += 1;
_root.myPlayer.cones[v5].KnockDown(2, this.multiplier);
} else {
this.multiplier += 1;
_root.myPlayer.cones[v5].KnockDown(3, this.multiplier);
}
}
}
}
for (v5 in _root.myPlayer.targets) {
if (_root.myPlayer.targets[v5].live == true) {
var v3 = _root.getDistance(this._x, this._y, _root.myPlayer.targets[v5]._x, _root.myPlayer.targets[v5]._y);
if (v3 < 17) {
switch (_root.myPlayer.targets[v5].targettype) {
case 1:
if (this.speed < 0.1) {
this.multiplier += 1;
_root.myPlayer.targets[v5].hitTarget(v3, this.multiplier);
}
break;
case 2:
if (this.bouncecount == 1 && v4) {
this.multiplier += 1;
_root.myPlayer.targets[v5].hitTarget(v3, this.multiplier);
}
}
}
}
}
};
v2.Kick = function (bx, by, bd, bp, kt) {
trace('Kick:' + kt);
this._x = bx;
this._y = by;
this.multiplier = 0;
switch (kt) {
case 1:
this.zspeed = 0;
this.ballheight = 0;
break;
case 2:
this.zspeed = bp;
this.ballheight = 1;
this.bouncecount = 1;
}
this.direc = bd;
this.speed = bp;
this.live = false;
_root.soundFX.attachSound('Kick.wav');
_root.soundFX.start();
};
v2.screenW = 480;
v2.gravity = 0.45;
ASSetPropFlags(_global.Shadow.prototype, null, 1);
}
#endinitclip
}
movieClip 147 __Packages.Target {
#initclip
if (!_global.Target) {
var v1 = function () {
super();
};
_global.Target = v1;
_global.Target extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.live = true;
var v3 = false;
do {
v3 = false;
if (_root.myPlayer.level < 5) {
this._x = _root.myPlayer._x + Math.random() * 200 - 100;
this._y = 200 + Math.random() * 100;
} else {
this._x = _root.myPlayer._x + Math.random() * 400 - 200;
this._y = 120 + Math.random() * 180;
}
for (var v4 in _root.myPlayer.cones) {
if (_root.getDistance(this._x, this._y, _root.myPlayer.cones[v4]._x, _root.myPlayer.cones[v4]._y) < 24) {
v3 = true;
}
}
for (v4 in _root.myPlayer.targets) {
if (this != _root.myPlayer.targets[v4]) {
if (_root.getDistance(this._x, this._y, _root.myPlayer.targets[v4]._x, _root.myPlayer.targets[v4]._y) < 32) {
v3 = true;
}
}
}
} while (v3 == true);
};
v2.onEnterFrame = function () {
this.gotoAndStop(this.targettype);
if (this.live == false) {
this.gotoAndStop(3);
}
};
v2.hitTarget = function (dist, multi) {
_root.soundFX.attachSound('Target.wav');
_root.soundFX.start();
switch (multi) {
break;
case 1:
case 2:
_root.soundFX2.attachSound('multi1.wav');
_root.soundFX2.start();
break;
case 3:
_root.soundFX2.attachSound('multi2.wav');
_root.soundFX2.start();
break;
case 4:
_root.soundFX2.attachSound('multi3.wav');
_root.soundFX2.start();
break;
default:
_root.soundFX2.attachSound('multi4.wav');
_root.soundFX2.start();
}
this.live = false;
var v3 = 250;
if (dist < 13) {
v3 = 500;
}
if (dist < 9) {
v3 = 750;
}
if (dist < 5) {
v3 = 1000;
}
v3 *= multi;
_root.myPlayer.score += v3;
var v4 = _root.attachMovie('Points', 'Points' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = this._x + 16;
v4._y = this._y;
v4.textPoints.text = '+' + v3;
};
ASSetPropFlags(_global.Target.prototype, null, 1);
}
#endinitclip
}
movieClip 148 __Packages.Points {
#initclip
if (!_global.Points) {
var v1 = function () {
super();
};
_global.Points = v1;
_global.Points extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.timer = 50;
};
v2.onEnterFrame = function () {
this._y -= 1;
this.timer -= 0.75;
if (this.timer < 0) {
this.removeMovieClip();
}
};
ASSetPropFlags(_global.Points.prototype, null, 1);
}
#endinitclip
}
movieClip 149 __Packages.Arrow {
#initclip
if (!_global.Arrow) {
var v1 = function () {
super();
};
_global.Arrow = v1;
_global.Arrow extends MovieClip;
var v2 = v1.prototype;
ASSetPropFlags(_global.Arrow.prototype, null, 1);
}
#endinitclip
}
movieClip 150 __Packages.Player {
#initclip
if (!_global.Player) {
var v1 = function () {
super();
};
_global.Player = v1;
_global.Player extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.resetLevel(0);
_root.setUpScreen(1);
};
v2.onEnterFrame = function () {
var v3 = 0;
for (var v6 in this.cones) {
if (this.cones[v6].live == true) {
v3 += 1;
}
}
for (v6 in this.targets) {
if (this.targets[v6].live == true) {
v3 += 1;
}
}
var v8 = this.balls.length;
_root.MyBalls.text = 'x ' + v8;
switch (this.level) {
case 0:
return undefined;
break;
case 1:
if (v3 > 0) {
if (_root.imgBoss1._x < 110) {
_root.imgBoss1._x += 20;
}
} else {
if (_root.imgBoss1._x > -220) {
_root.imgBoss1._x -= 20;
}
}
break;
case 2:
if (v3 > 0) {
if (_root.imgBoss2._x < 110) {
_root.imgBoss2._x += 20;
}
} else {
if (_root.imgBoss2._x > -220) {
_root.imgBoss2._x -= 20;
}
}
break;
case 3:
if (v3 > 0) {
if (_root.imgBoss3._x < 110) {
_root.imgBoss3._x += 20;
}
} else {
if (_root.imgBoss3._x > -220) {
_root.imgBoss3._x -= 20;
}
}
break;
case 4:
if (v3 > 0) {
if (_root.imgBoss5._x < 110) {
_root.imgBoss5._x += 20;
}
} else {
if (_root.imgBoss5._x > -220) {
_root.imgBoss5._x -= 20;
}
}
}
if (_root.pageScreenResult._visible) {
return undefined;
}
if (Key.isDown(27) || v8 > 100) {
this.level = 0;
this.resetLevel();
_root.setUpScreen(3);
return undefined;
}
_root.textScore.text = 'Score: ' + this.score;
_root.textLevel.text = 'Level: ' + this.level + '/10';
var v11 = _root._xmouse - this._x;
var v10 = -1 * (_root._ymouse - this._y - 12);
var v7 = Math.atan2(v10, v11);
v7 = Math.round((v7 / Math.PI) * 180);
_root.myarrow._rotation = -1 * v7;
_root.myarrow._x = this._x + Math.cos(_root.myarrow._rotation * Math.PI / 180) * 30;
_root.myarrow._y = this._y + 12 + Math.sin(_root.myarrow._rotation * Math.PI / 180) * 30;
var v4 = _root.myarrow._rotation;
if (this.kickanimcounter > 0) {
this.kickanimcounter -= 1;
if (v4 > -135 && v4 < -45) {
this.gotoAndStop(7);
}
if (v4 < -135 || v4 > 135) {
this.gotoAndStop(6);
}
if (v4 > -45 && v4 < 45) {
this.gotoAndStop(5);
}
if (v4 > 45 && v4 < 135) {
this.gotoAndStop(8);
}
} else {
if (v4 > -135 && v4 < -45) {
this.gotoAndStop(3);
}
if (v4 < -135 || v4 > 135) {
this.gotoAndStop(2);
}
if (v4 > -45 && v4 < 45) {
this.gotoAndStop(1);
}
if (v4 > 45 && v4 < 135) {
this.gotoAndStop(4);
}
}
var v5 = true;
for (v6 in this.balls) {
if (this.balls[v6].speed > 0.05) {
v5 = false;
}
}
if (v3 == 0) {
if (v5) {
this.levelComplete();
}
}
this.kicking = 0;
if (v3 > 0) {
if (Key.isDown(90) || this.mouse == 1) {
this.kicking = 1;
this.kicktype = 2;
this.kickpower += 0.25;
}
if (Key.isDown(88) || this.mouse == 2) {
this.kicking = 1;
this.kicktype = 1;
this.kickpower += 0.25;
}
if (this.kickpower > 10) {
this.kickpower = 10;
}
_root.powerBar.bar._yscale = this.kickpower * 51.5;
if (this.kicking == 0 && this.kickpower > 0) {
var v9 = _root.attachMovie('Shadow', 'Ball' + v6, _root.getNextHighestDepth());
this.balls.push(v9);
v9.Kick(this._x, this._y + 12, _root.myarrow._rotation, this.kickpower, this.kicktype);
this.kicking = 0;
this.kickpower = 0;
this.kickanimcounter = 30;
}
}
};
v2.setUpLevel = function () {
this.gotoAndStop(1);
_root.myarrow._rotation = -90;
_root.imgBoss1._x = -200;
_root.imgBoss2._x = -200;
_root.imgBoss3._x = -200;
_root.imgBoss5._x = -200;
switch (this.level) {
case 1:
this.setUpCones(3);
break;
case 2:
this.setUpTargets(1, 1);
break;
case 3:
this.setUpTargets(1, 2);
break;
case 4:
this.setUpCones(5);
break;
case 5:
this.setUpCones(5);
this.setUpTargets(2, 1);
break;
case 6:
this.setUpCones(5);
this.setUpTargets(2, 2);
break;
case 7:
this.setUpCones(7);
this.setUpTargets(1, 1);
this.setUpTargets(1, 2);
break;
case 8:
this.setUpCones(7);
this.setUpTargets(2, 1);
this.setUpTargets(2, 2);
break;
case 9:
this.setUpCones(10);
this.setUpTargets(2, 1);
this.setUpTargets(2, 2);
break;
case 10:
this.setUpCones(15);
this.setUpTargets(3, 1);
this.setUpTargets(3, 2);
}
_root.myCursor.swapDepths(_root.getNextHighestDepth());
};
v2.setUpCones = function (num) {
var v3 = 1;
while (v3 < num + 1) {
var v4 = _root.attachMovie('Cone', 'Cone' + v3, _root.getNextHighestDepth());
this.cones.push(v4);
++v3;
}
};
v2.setUpTargets = function (num, typ) {
var v3 = 1;
while (v3 < num + 1) {
var v4 = _root.attachMovie('Target', 'Target' + typ + '_' + v3, _root.getNextHighestDepth());
v4.targettype = typ;
this.targets.push(v4);
++v3;
}
};
v2.levelComplete = function () {
trace('levelComplete: ' + this.level);
this.level += 1;
this.bonusballs = this.balls.length;
this.bonus = 5100 - this.bonusballs * 100;
if (this.bonus < 0) {
this.bonus = 0;
}
this.score += this.bonus;
this.resetLevel(1);
_root.setUpScreen(4);
_root.soundFX.attachSound('Goal.wav');
_root.soundFX.start();
};
v2.resetLevel = function () {
trace('resetLevel');
for (var v2 in this.cones) {
this.cones[v2].removeMovieClip();
}
for (v2 in this.targets) {
this.targets[v2].removeMovieClip();
}
for (v2 in this.balls) {
this.balls[v2].ball.removeMovieClip();
this.balls[v2].removeMovieClip();
}
this.cones = [];
this.targets = [];
this.balls = [];
this.kicktype = 0;
this.kickpower = 0;
this.kickanimcounter = 0;
};
v2.continueGame = function () {
trace('ContinueGame');
if (this.level == 11) {
_root.pageScreenComplete.textFinalScore.text = this.score;
this.level = 0;
_root.setUpScreen(5);
} else {
this.setUpLevel();
_root.setUpScreen(0);
}
};
v2.newGame = function () {
trace('New Game');
this.score = 0;
this.level = 1;
this.setUpLevel();
_root.setUpScreen(0);
};
v1.playerName = 'Name';
v2.score = 0;
v2.kicking = 0;
v2.kicktype = 0;
v2.kickpower = 0;
v2.kickanimcounter = 0;
v2.level = 0;
v2.bonusballs = 0;
v2.bonus = 0;
v2.mouse = 0;
ASSetPropFlags(_global.Player.prototype, null, 1);
}
#endinitclip
}
movieClip 151 __Packages.Cone {
#initclip
if (!_global.Cone) {
var v1 = function () {
super();
};
_global.Cone = v1;
_global.Cone extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.live = true;
this.gotoAndStop(1);
var v3 = false;
do {
v3 = false;
if (_root.myPlayer.level < 5) {
this._x = _root.myPlayer._x + Math.random() * 200 - 100;
this._y = 200 + Math.random() * 100;
} else {
this._x = _root.myPlayer._x + Math.random() * 400 - 200;
this._y = 120 + Math.random() * 180;
}
for (var v4 in _root.myPlayer.cones) {
if (this != _root.myPlayer.cones[v4]) {
if (_root.getDistance(this._x, this._y, _root.myPlayer.cones[v4]._x, _root.myPlayer.cones[v4]._y) < 32) {
v3 = true;
}
}
}
} while (v3 == true);
};
v2.KnockDown = function (side, multi) {
_root.soundFX.attachSound('Cone.wav');
_root.soundFX.start();
switch (multi) {
break;
case 1:
case 2:
_root.soundFX2.attachSound('multi1.wav');
_root.soundFX2.start();
break;
case 3:
_root.soundFX2.attachSound('multi2.wav');
_root.soundFX2.start();
break;
case 4:
_root.soundFX2.attachSound('multi3.wav');
_root.soundFX2.start();
break;
default:
_root.soundFX2.attachSound('multi4.wav');
_root.soundFX2.start();
}
this.live = false;
this.gotoAndStop(side);
var v4 = 250 * multi;
_root.myPlayer.score += v4;
var v3 = _root.attachMovie('Points', 'Points' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x + 16;
v3._y = this._y;
v3.textPoints.text = '+' + v4;
};
ASSetPropFlags(_global.Cone.prototype, null, 1);
}
#endinitclip
}
movieClip 152 __Packages.mochi.MochiScores {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.MochiScores) {
var v1 = function () {};
mochi.MochiScores = v1;
var v2 = v1.prototype;
v1.setBoardID = function (boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send('scores_setBoardID', {'boardID': boardID});
};
v1.showLeaderboard = function (options) {
if (options.clip == null || options.clip == undefined) {
options.clip = mochi.MochiServices.clip;
}
if (options.clip != mochi.MochiServices.__get__clip() || (mochi.MochiServices.__get__childClip())._target == undefined) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof options.name == 'object') {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else {
if (options.score instanceof mochi.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.MochiServices.__get__clip()).stop();
}
if (options.onClose != null) {
mochi.MochiScores.onClose = options.onClose;
} else {
mochi.MochiScores.onClose = function () {
(mochi.MochiServices.__get__clip()).play();
};
}
if (options.onError != null) {
mochi.MochiScores.onError = options.onError;
} else {
mochi.MochiScores.onError = mochi.MochiScores.onClose;
}
if (options.boardID == null) {
if (mochi.MochiScores.boardID != null) {
options.boardID = mochi.MochiScores.boardID;
}
}
mochi.MochiServices.send('scores_showLeaderboard', {'options': options}, null, mochi.MochiScores.doClose);
};
v1.closeLeaderboard = function () {
mochi.MochiServices.send('scores_closeLeaderboard');
};
v1.getPlayerInfo = function (callbackObj, callbackMethod) {
mochi.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.MochiServices.send('scores_submit', {'score': score, 'name': name}, callbackObj, callbackMethod);
};
v1.requestList = function (callbackObj, callbackMethod) {
mochi.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.MochiScores.onError.apply(null, [args.errorCode]);
} else {
mochi.MochiScores.onClose.apply();
}
};
ASSetPropFlags(mochi.MochiScores.prototype, null, 1);
}
#endinitclip
}
movieClip 153 __Packages.mochi.MochiDigits {
#initclip
if (!_global.mochi) {
_global.mochi = new Object();
}
if (!_global.mochi.MochiDigits) {
var v1 = function (digit, index) {
this.Encoder = 0;
this.setValue(digit, index);
};
mochi.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.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.MochiDigits.prototype, null, 1);
}
#endinitclip
}
frame 2 {
function setUpScreen(num, submit) {
trace('setUpScreen: ' + num);
_root.myCursor._visible = false;
Mouse.show();
_root.pageScreenTitle._visible = false;
_root.pageScreenInstrucs._visible = false;
_root.pageScreenAdvert._visible = false;
_root.pageScreenResult._visible = false;
_root.pageScreenComplete._visible = false;
_root.pageScreenHiScores._visible = false;
switch (num) {
case 0:
Mouse.hide();
_root.myCursor._visible = true;
_root.myCursor.gotoAndStop(2);
_root.soundFX.attachSound('Referee.wav');
_root.soundFX.start();
break;
case 1:
_root.pageScreenTitle._visible = true;
break;
case 2:
_root.pageScreenInstrucs._visible = true;
_root.pageScreenInstrucs.inputNameBox.inputName.text = Player.playerName;
break;
case 3:
_root.pageScreenAdvert._visible = true;
break;
case 4:
_root.pageScreenResult._visible = true;
_root.pageScreenResult.textBonus.text = 'x ' + _root.myPlayer.bonusballs + ' = ' + _root.myPlayer.bonus;
_root.pageScreenResult.textScore1.text = 'Score = ' + _root.myPlayer.score;
_root.pageScreenResult.textScore2.text = 'Score = ' + _root.myPlayer.score;
_root.myPlayer.bonusballs = 0;
_root.myPlayer.bonus = 0;
break;
case 5:
_root.pageScreenComplete._visible = true;
break;
case 6:
if (kongregate) {
setUpScreen(3);
_root.kongregateScores.submit(_root.myPlayer.score);
return undefined;
}
_root.pageScreenHiScores._visible = true;
if (submit) {
if (_root.playername != '' && _root.playername != 'Name') {
mochi.MochiScores.showLeaderboard({'boardID': '25cc29f0367caf45', 'score': _root.myPlayer.score, 'name': _root.playername});
} else {
mochi.MochiScores.showLeaderboard({'boardID': '25cc29f0367caf45'});
}
} else {
mochi.MochiScores.showLeaderboard({'boardID': '25cc29f0367caf45'});
}
}
_root.myCursor.swapDepths(_root.getNextHighestDepth());
}
_root.soundFX = new Sound();
_root.soundFX2 = new Sound();
if (kongregate) {
_root.pageScreenTitle.btnHiScores._visible = false;
_root.pageScreenTitle.btnPlay._x = 110;
_root.pageScreenInstrucs.inputNameBox._visible = false;
_root.pageScreenComplete.textSubmit._visible = false;
}
onMouseDown = function () {
_root.myPlayer.mouse = 1;
};
onMouseUp = function () {
_root.myPlayer.mouse = 0;
};
_root.getDistance = function (x1, y1, x2, y2) {
return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
};
_root.pageScreenTitle.btnPlay.onRelease = function () {
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
_root.setUpScreen(2);
};
_root.pageScreenTitle.btnHiScores.onRelease = function () {
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
_root.setUpScreen(6);
};
_root.pageScreenInstrucs.btnContinue.onRelease = function () {
Player.playerName = _root.pageScreenInstrucs.inputNameBox.inputName.text;
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
_root.myPlayer.newGame();
};
_root.pageScreenAdvert.btnContinue.onRelease = function () {
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
_root.setUpScreen(1);
};
_root.pageScreenHiScores.btnContinue.onRelease = function () {
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
_root.setUpScreen(1);
};
_root.pageScreenResult.btnContinue.onRelease = function () {
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
_root.myPlayer.continueGame();
};
_root.pageScreenComplete.btnContinue.onRelease = function () {
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
_root.setUpScreen(6, true);
};
_root.pageScreenContinue.btnNSS4.onRelease = function () {
_root.getURL('http://www.newstargames.com/nss4.html', '_blank');
};
_root.pageScreenAdvert.btnNSS4.onRelease = function () {
_root.getURL('http://www.newstargames.com/nss4.html', '_blank');
};
_root.pageScreenAdvert.btnNSS3.onRelease = function () {
_root.getURL('http://www.newstargames.com/nss3.html', '_blank');
};
_root.gotoAndStop(2);
}
instance myCursor of movieClip 110 Mouse {
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}
}
movieClip 139 {
}
movieClip 140 {
}