Combined Code
movieClip 1 __Packages.mochi.as2.MochiAd {
#initclip
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (mochi == undefined) {
_global.mochi = {};
}
if (!_global.mochi.hasOwnProperty('as2')) {
_global.mochi.as2 = {};
}
_global.mochi.as2.MochiAd = function () {
with (this) {
}
};
mochi.as2.MochiAd.getVersion = function () {
with (this) {
return mochi.as2.MochiServices.getVersion();
}
};
mochi.as2.MochiAd.showPreGameAd = function (options) {
with (this) {
var DEFAULTS = {'ad_progress': function (percent) {}, 'ad_skipped': function () {}, 'ad_loaded': function (width, height) {}, 'ad_failed': function () {}, 'ad_finished': function () {
this.clip.play();
}, 'ad_started': function () {
this.clip.stop();
}, 'no_progress_bar': false, 'outline': 13994812, 'background': 16777161, 'color': 16747008, 'method': 'showPreloaderAd', 'regpt': 'o', 'fadeout_time': 250, 'ad_timeout': 3000, 'clip': _root};
options = mochi.as2.MochiAd._parseOptions(options, DEFAULTS);
var clip = options.clip;
var ad_msec = 11000;
var ad_timeout = options.ad_timeout;
if (options.skip) {
ad_timeout = 0;
} else {}
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;
} else {}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var wh = mochi.as2.MochiAd._getRes(options);
var w = wh[0];
var h = wh[1];
mc._x = w * 0.5;
mc._y = h * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk._x = w * -0.5;
chk._y = h * -0.5;
var bar = chk.createEmptyMovieClip('_mochiad_bar', 4);
if (options.no_progress_bar) {
bar._visible = false;
delete options.no_progress_bar;
} else {
bar._x = 10;
bar._y = h - 20;
}
var bar_color = options.color;
delete options.color;
var bar_background = options.background;
delete options.background;
var bar_outline = options.outline;
delete options.outline;
var backing = bar.createEmptyMovieClip('_outline', 1);
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo(w - 20, 0);
backing.lineTo(w - 20, 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside = bar.createEmptyMovieClip('_inside', 2);
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo(w - 20, 0);
inside.lineTo(w - 20, 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside._xscale = 0;
var outline = bar.createEmptyMovieClip('_outline', 3);
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo(w - 20, 0);
outline.lineTo(w - 20, 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var p = 100 * (1 - (getTimer() - this.fadeout_start) / this.fadeout_time);
if (p > 0) {
this._parent._alpha = p;
} else {
var _clip = this._parent._parent;
mochi.as2.MochiAd.unload(_clip);
delete this.onEnterFrame;
}
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _chk = this.mc._mochiad_wait;
_chk.server_control = true;
_chk.started = getTimer();
_chk.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
chk.onEnterFrame = function () {
var _clip = this._parent._parent;
var loader = _clip;
for (;;) {
if (loader.getBytesTotal() || !loader) break;
loader = loader._parent;
}
if (!loader) {
loader = _root;
} else {}
var ad_clip = this._parent._mochiad_ctr;
var elapsed = getTimer() - this.started;
var finished = false;
var clip_total = loader.getBytesTotal();
var clip_loaded = loader.getBytesLoaded();
var clip_pcnt = 100 * clip_loaded / clip_total;
var ad_pcnt = 100 * elapsed / chk.ad_msec;
var _inside = this._mochiad_bar._inside;
var pcnt = Math.min(Math.min(ad_pcnt, clip_pcnt || 0), 100);
pcnt = Math.max(pcnt, this.last_pcnt);
this.last_pcnt = pcnt;
_inside._xscale = pcnt;
options.ad_progress(pcnt);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {'pcnt': clip_pcnt, 'id': 'hostLoadPcnt'}, clip._mochiad._containerLCName);
if (clip_pcnt == 100) {
sendHostProgress = false;
} else {}
} else {}
if (!chk.showing) {
var total = ad_clip.getBytesTotal();
if (!(total <= 0 && typeof total != 'undefined')) {
chk.showing = true;
chk.started = getTimer();
} else {
if (!(elapsed <= chk.ad_timeout || clip_pcnt != 100)) {
options.ad_failed();
finished = true;
} else {}
}
} else {}
if (elapsed > chk.ad_msec) {
finished = true;
} else {}
if (!(clip_total <= 0 || (clip_loaded < clip_total || !finished))) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
} else {}
};
}
};
mochi.as2.MochiAd.showClickAwayAd = function (options) {
with (this) {
var DEFAULTS = {'ad_skipped': function () {}, 'ad_failed': function () {}, 'ad_loaded': function (width, height) {}, 'ad_finished': function () {}, 'ad_started': function () {}, 'no_bg': true, 'res': '300x250', 'method': 'showClickAwayAd', 'regpt': 'o', 'fadeout_time': 250, 'ad_timeout': 2000, 'clip': _root};
options = mochi.as2.MochiAd._parseOptions(options, DEFAULTS);
var clip = options.clip;
var ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!mochi.as2.MochiAd.load(options)) {
options.ad_failed();
options.ad_finished();
return undefined;
} else {}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var wh = mochi.as2.MochiAd._getRes(options);
var w = wh[0];
var h = wh[1];
mc._x = w * 0.5;
mc._y = h * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk.ad_timeout = ad_timeout;
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);
};
var sendHostProgress = false;
chk.onEnterFrame = function () {
var ad_clip = this._parent._mochiad_ctr;
var elapsed = getTimer() - this.started;
var finished = false;
if (!chk.showing) {
var total = ad_clip.getBytesTotal();
if (!(total <= 0 && typeof total != 'undefined')) {
finished = true;
chk.showing = true;
chk.started = getTimer();
} else {
if (elapsed > chk.ad_timeout) {
options.ad_failed();
finished = true;
} else {}
}
} else {}
if (finished) {
delete this.onEnterFrame;
} else {}
};
}
};
mochi.as2.MochiAd.showInterLevelAd = function (options) {
with (this) {
var DEFAULTS = {'ad_skipped': function () {}, 'ad_loaded': function (width, height) {}, 'ad_failed': function () {}, 'ad_finished': function () {
this.clip.play();
}, 'ad_started': function () {
this.clip.stop();
}, 'method': 'showTimedAd', 'regpt': 'o', 'fadeout_time': 250, 'ad_timeout': 2000, 'clip': _root};
options = mochi.as2.MochiAd._parseOptions(options, DEFAULTS);
var clip = options.clip;
var ad_msec = 11000;
var ad_timeout = 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;
} else {}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var wh = mochi.as2.MochiAd._getRes(options);
var w = wh[0];
var h = wh[1];
mc._x = w * 0.5;
mc._y = h * 0.5;
var chk = mc.createEmptyMovieClip('_mochiad_wait', 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var p = 100 * (1 - (getTimer() - this.fadeout_start) / this.fadeout_time);
if (p > 0) {
this._parent._alpha = p;
} else {
var _clip = this._parent._parent;
mochi.as2.MochiAd.unload(_clip);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _chk = this.mc._mochiad_wait;
_chk.server_control = true;
_chk.started = getTimer();
_chk.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
chk.onEnterFrame = function () {
var ad_clip = this._parent._mochiad_ctr;
var elapsed = getTimer() - this.started;
var finished = false;
if (!chk.showing) {
var total = ad_clip.getBytesTotal();
if (!(total <= 0 && typeof total != 'undefined')) {
chk.showing = true;
chk.started = getTimer();
} else {
if (elapsed > chk.ad_timeout) {
options.ad_failed();
finished = true;
} else {}
}
} else {}
if (elapsed > chk.ad_msec) {
finished = true;
} else {}
if (finished) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
} else {}
};
}
};
mochi.as2.MochiAd.showPreloaderAd = function (options) {
with (this) {
mochi.as2.MochiAd.showPreGameAd(options);
}
};
mochi.as2.MochiAd.showTimedAd = function (options) {
with (this) {
mochi.as2.MochiAd.showInterLevelAd(options);
}
};
mochi.as2.MochiAd._allowDomains = function (server) {
with (this) {
var hostname = ((server.split('/'))[2].split(':'))[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain('*');
System.security.allowDomain(hostname);
} else {}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain('*');
System.security.allowInsecureDomain(hostname);
} else {}
return hostname;
}
return hostname;
}
};
mochi.as2.MochiAd.load = function (options) {
with (this) {
var DEFAULTS = {'id': '_UNKNOWN_', 'depth': 10333, 'method': 'load', 'server': 'http://x.mochiads.com/srv/1/', 'clip': _root};
options = mochi.as2.MochiAd._parseOptions(options, DEFAULTS);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = mochi.as2.MochiAd.getVersion();
var clip = options.clip;
if (!mochi.as2.MochiAd._isNetworkAvailable()) {
return null;
} else {}
if (clip._mochiad_loaded) {
return null;
} else {}
var depth = options.depth;
delete options.depth;
var mc = clip.createEmptyMovieClip('_mochiad', depth);
var wh = mochi.as2.MochiAd._getRes(options);
options.res = wh[0] + 'x' + wh[1];
var v1 = 'server';
options[v1] += options.id;
delete options.id;
clip._mochiad_loaded = true;
if (clip._url.indexOf('http') != 0) {
} else {}
var lv = mc.createEmptyMovieClip('_mochiad_ctr', 1);
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (k == undefined) {
var k = null;
}
for (k in enumerate options) {
options;
lv[k] = options[k];
}
// An attempt to read a value from empty stack
while (undefined != null) {
}
var server = lv.server;
delete lv.server;
var hostname = mochi.as2.MochiAd._allowDomains(server);
mc.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
} else {}
};
} else {}
};
var lc = new Object();
var name = ['', Math.floor((new Date()).getTime()), random(999999)].join('_');
lc.mc = mc;
lc.name = name;
lc.hostname = hostname;
lc.allowDomain = function (d) {
return true;
};
lc.allowInsecureDomain = lc.allowDomain;
lc.connect(name);
mc.lc = lc;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
lv.lc = name;
lv.st = getTimer();
if (!options.skip) {
lv.loadMovie(server + '.swf', 'POST');
return mc;
}
return mc;
}
};
mochi.as2.MochiAd.unload = function (clip) {
with (this) {
if (typeof clip == 'undefined') {
clip = _root;
} else {}
if (!(!clip.clip || !clip.clip._mochiad)) {
clip = clip.clip;
} else {}
if (!clip._mochiad) {
return false;
containerNotify(clip, {'id': 'unload'}, clip._mochiad._containerLCName);
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return true;
}
containerNotify(clip, {'id': 'unload'}, clip._mochiad._containerLCName);
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return true;
}
};
mochi.as2.MochiAd._isNetworkAvailable = function () {
with (this) {
if (System.security) {
var o = System.security;
if (o.sandboxType == 'localWithFile') {
return false;
} else {}
return true;
}
return true;
}
};
mochi.as2.MochiAd._getRes = function (options) {
with (this) {
var b = options.clip.getBounds();
var w = 0;
var h = 0;
if (typeof options.res != 'undefined') {
var xy = options.res.split('x');
w = parseFloat(xy[0]);
h = parseFloat(xy[1]);
} else {
w = b.xMax - b.xMin;
h = b.yMax - b.yMin;
}
if (!(w != 0 && h != 0)) {
w = Stage.width;
h = Stage.height;
return [w, h];
}
return [w, h];
}
};
mochi.as2.MochiAd._parseOptions = function (options, defaults) {
with (this) {
var optcopy = {};
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (k == undefined) {
var k = null;
}
for (k in enumerate defaults) {
defaults;
optcopy[k] = defaults[k];
}
// An attempt to read a value from empty stack
while (undefined != null) {
}
if (options) {
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (k == undefined) {
var k = null;
}
for (k in enumerate options) {
options;
optcopy[k] = options[k];
}
// An attempt to read a value from empty stack
while (undefined != null) {
}
} else {}
if (_root.mochiad_options) {
var pairs = _root.mochiad_options.split('&');
var i = 0;
goto 10485;
for (;;) {
++i;
label 10485:
if (i >= pairs.length) break;
var kv = pairs[i].split('=');
optcopy[unescape(kv[0])] = unescape(kv[1]);
}
} else {}
if (optcopy.id == 'test') {
return optcopy;
}
return optcopy;
}
};
mochi.as2.MochiAd.rpc = function (clip, callbackID, arg) {
with (this) {
if (arg.id != 'setValue') {
} else {
if (arg.id != 'getValue') {
} else {
mochi.as2.MochiAd.setValue(clip, arg.objectName, arg.value);
if (arg.id != 'runMethod') {
var val = mochi.as2.MochiAd.getValue(clip, arg.objectName);
mochi.as2.MochiAd.containerRpcResult(clip, callbackID, val, clip._mochiad._containerLCName);
} else {
var ret = mochi.as2.MochiAd.runMethod(clip, arg.method, arg.args);
mochi.as2.MochiAd.containerRpcResult(clip, callbackID, ret, clip._mochiad._containerLCName);
}
}
}
}
};
mochi.as2.MochiAd.setValue = function (base, objectName, value) {
with (this) {
var nameArray = Array(objectName.split('.'));
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (i == undefined) {
var i = NaN;
}
i = 0;
goto 11208;
for (;;) {
++i;
label 11208:
if (i >= nameArray.length - 1) break;
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (!(base[nameArray[i]] != undefined && base[nameArray[i]] != null)) {
return undefined;
} else {}
base = base[nameArray[i]];
}
base[nameArray[i]] = value;
}
};
mochi.as2.MochiAd.getValue = function (base, objectName) {
with (this) {
var nameArray = Array(objectName.split('.'));
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (i == undefined) {
var i = NaN;
}
i = 0;
goto 11579;
for (;;) {
++i;
label 11579:
if (i >= nameArray.length - 1) break;
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (!(base[nameArray[i]] != undefined && base[nameArray[i]] != null)) {
return undefined;
} else {}
base = base[nameArray[i]];
}
return base[nameArray[i]];
}
};
mochi.as2.MochiAd.runMethod = function (base, methodName, argsArray) {
with (this) {
var nameArray = Array(methodName.split('.'));
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (i == undefined) {
var i = NaN;
}
i = 0;
goto 11955;
for (;;) {
++i;
label 11955:
if (i >= nameArray.length - 1) break;
delete _global.__resolve;
_global.__resolve = _global.__debugResolve;
if (!(base[nameArray[i]] != undefined && base[nameArray[i]] != null)) {
return undefined;
} else {}
base = base[nameArray[i]];
}
if (typeof base[nameArray[i]] == 'function') {
return base[nameArray[i]].apply(base, argsArray);
} else {
return undefined;
}
}
};
mochi.as2.MochiAd.containerNotify = function (clip, args, lcName) {
with (this) {
var container = clip._mochiad._mochiad_ctr.ad.app;
if (container.notify) {
container.notify(args);
} else {
(new LocalConnection()).send(lcName, 'notify', args);
}
}
};
mochi.as2.MochiAd.containerRpcResult = function (clip, callbackID, val, lcName) {
with (this) {
var container = clip._mochiad._mochiad_ctr.ad.app;
if (container.rpcResult) {
container.rpcResult(callbackID, val);
} else {
(new LocalConnection()).send(lcName, 'rpcResult', callbackID, val);
}
}
};
#endinitclip
}
movieClip 2 {
frame 1 {
_visible = false;
stop();
}
frame 2 {
// An attempt to read a value from empty stack
tellTarget ('undefined') {
if (!hasOwnProperty('_physicsInit')) {
_physicsInit = true;
_time = getTimer() / 1000;
_birth = _time;
_delta = 0;
_age = 0;
if (!hasOwnProperty('_fx')) {
_fx = 0;
}
if (!hasOwnProperty('_fy')) {
_fy = 0;
}
if (!hasOwnProperty('_fxscale')) {
_fxscale = 0;
}
if (!hasOwnProperty('_fyscale')) {
_fyscale = 0;
}
if (!hasOwnProperty('_frotation')) {
_frotation = 0;
}
if (!hasOwnProperty('_falpha')) {
_falpha = 0;
}
if (!hasOwnProperty('_vx')) {
_vx = 0;
}
if (!hasOwnProperty('_vy')) {
_vy = 0;
}
if (!hasOwnProperty('_vxscale')) {
_vxscale = 0;
}
if (!hasOwnProperty('_vyscale')) {
_vyscale = 0;
}
if (!hasOwnProperty('_vrotation')) {
_vrotation = 0;
}
if (!hasOwnProperty('_valpha')) {
_valpha = 0;
}
if (!hasOwnProperty('_ax')) {
_ax = 0;
}
if (!hasOwnProperty('_ay')) {
_ay = 0;
}
if (!hasOwnProperty('_axscale')) {
_axscale = 0;
}
if (!hasOwnProperty('_ayscale')) {
_ayscale = 0;
}
if (!hasOwnProperty('_arotation')) {
_arotation = 0;
}
if (!hasOwnProperty('_aalpha')) {
_aalpha = 0;
}
}
}
}
frame 3 {
// An attempt to read a value from empty stack
tellTarget ('undefined') {
if (!hasOwnProperty('_physicsInit')) {
call('/_phy:2');
_target;
}
_tt = getTimer() / 1000;
_delta = _tt - _time;
_age = _tt - _birth;
_time = _tt;
}
}
frame 4 {
// An attempt to read a value from empty stack
tellTarget ('undefined') {
_ffx = (100 - _fx * _delta) / 100;
_ffy = (100 - _fy * _delta) / 100;
_ffxscale = (100 - _fxscale * _delta) / 100;
_ffyscale = (100 - _fyscale * _delta) / 100;
_ffrotation = (100 - _frotation * _delta) / 100;
_ffalpha = (100 - _falpha * _delta) / 100;
_vx_was = _vx;
_vx = (_vx + _ax * _delta) * _ffx;
_vy_was = _vy;
_vy = (_vy + _ay * _delta) * _ffy;
_vxscale_was = _vxscale;
_vxscale = (_vxscale + _axscale * _delta) * _ffxscale;
_vyscale_was = _vyscale;
_vyscale = (_vyscale + _ayscale * _delta) * _ffyscale;
_vrotation_was = _vrotation;
_vrotation = (_vrotation + _arotation * _delta) * _ffrotation;
_valpha_was = _valpha;
_valpha = (_valpha + _aalpha * _delta) * _ffalpha;
_x = _x + (_vx_was + _vx) * _delta / 2;
_y = _y + (_vy_was + _vy) * _delta / 2;
_xscale = _xscale + (_vxscale_was + _vxscale) * _delta / 2;
_yscale = _yscale + (_vyscale_was + _vyscale) * _delta / 2;
_rotation = _rotation + (_vrotation_was + _vrotation) * _delta / 2;
_alpha = _alpha + (_valpha_was + _valpha) * _delta / 2;
}
}
}
movieClip 4 {
frame 2 {
tellTarget ('..') {
lader._xscale = int(100 * getBytesLoaded() / getBytesTotal() + 0.5);
if (int(100 * getBytesLoaded() / getBytesTotal() + 0.5) == 100) {
gotoAndPlay('/:2');
} else {}
}
gotoAndPlay(1);
}
}
frame 1 {
stop();
}
movieClip 7 {
}
frame 141 {
gotoAndPlay('/:142');
}
frame 142 {
stop();
mochi.as2.MochiAd.showPreGameAd({'res': '800x600', 'id': '3a454ac428ec3f40'});
stop();
}
frame 143 {
musik = _root.musik;
}
movieClip 19 {
frame 1 {
if (!hasOwnProperty('_load')) {
_load = true;
tellTarget ('..') {
filters = [new flash.filters.GlowFilter(31149, 1, 20, 20, 2, 2, false, false)];
} else {
goto 166;
}
}
label 166:
stop();
}
}
movieClip 20 {
}
button 22 {
on (press) {
gotoAndPlay('/:172');
}
}
movieClip 23 {
frame 2 {
tellTarget ('..') {
_root.musik = new Sound();
_root.musik.setVolume(tap._x);
_root.musik = tap._x;
}
gotoAndPlay(1);
}