[Tools][Expand/Collapse All]Note that automatic extraction of ActionScript 3 is still pretty much unsupported by swfchan. AS1/AS2 works okay most of the time.Frame 1 (2.08 KiB) ●
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
mochi.as2.MochiServices.connect("8af6a5a83d8a6436", _root.lh, onConnectError);
mochi.as2.MochiAd.showPreGameAd({id:"ec3462d993d89b39", res:"640x480"});
_root.alltrace.text = System.security.sandboxType;
if (System.security.sandboxType == "localWithFile") {
_root.mochiconnect = false;
}
_root.onConnectError = function (status) {
_root.main.rollbutton._visible = false;
_root.mochiconnect = false;
};
_root.mochimenu = function () {
if (_root.curmenu != mochiundefined) {
_root.curmenu.oef = true;
_root.curmenu = mochiundefined;
_root.apple._visible = false;
_root.soundtoggle._visible = false;
} else if (_root.curmenu == mochiundefined) {
_root.curmenu = _root.gobackto;
_root.gobackto.oef = true;
_root.apple._visible = true;
_root.soundtoggle._visible = true;
}
};
__com_mochibot__("b158e4b6", this, 10301, true);
Frame 15 (12.63 KiB) ● ●
_root.clayouts = new Array();
_root.clayouts[1] = new Array(7, 11, 15, 19);
_root.clayouts[2] = new Array(8, 12, 16, 20);
_root.clayouts[3] = new Array(9, 13, 17, 21);
_root.clayouts[4] = new Array(10, 14, 18, 22);
_root.clayouts[5] = new Array(7, 8, 9, 10);
_root.clayouts[6] = new Array(11, 12, 13, 14);
_root.clayouts[7] = new Array(15, 16, 17, 18);
_root.clayouts[8] = new Array(19, 20, 21, 22);
_root.clayouts[9] = new Array(7, 8, 11, 12);
_root.clayouts[10] = new Array(11, 12, 15, 16);
_root.clayouts[11] = new Array(15, 16, 19, 20);
_root.clayouts[12] = new Array(8, 9, 12, 13);
_root.clayouts[13] = new Array(12, 13, 16, 17);
_root.clayouts[14] = new Array(16, 17, 20, 21);
_root.clayouts[15] = new Array(9, 10, 13, 14);
_root.clayouts[16] = new Array(13, 14, 17, 18);
_root.clayouts[17] = new Array(17, 18, 21, 22);
_root.clayouts[18] = new Array(7, 12, 17, 22);
_root.clayouts[19] = new Array(10, 13, 16, 19);
_root.clayouts[20] = new Array(7, 10, 19, 22);
_root.ctypes = new Array();
typeindx = 0;
_root.firstload = false;
_root.loaddata = function () {
_root.highscore = _root.myLocalSO.data.highscore;
_root.updateHighscore();
_root.dieindex = 0;
ld = 1;
while (ld <= 22) {
if (_root.myLocalSO.data["odie" + ld] != undefined) {
ds = ld;
targeto = _root.main.attachMovie("die", "die" + _root.dieindex, _root.dieindex, {_x:_root.main.grid["g" + ds]._x + _root.main.grid._x, _y:_root.main.grid["g" + ds]._y + _root.main.grid._y});
_root.dieindex++;
targeto.gridpoint = _root.main.grid["g" + ds];
targeto.dietype = _root.myLocalSO.data["odie" + ld].dietype;
targeto.gposition = _root.myLocalSO.data["odie" + ld].gposition;
targeto.gotoAndStop(targeto.dietype);
targeto._alpha = 100;
if (_root.myLocalSO.data["odie" + ld].locked) {
targeto.locked = true;
}
}
if (_root.myLocalSO.data["die" + ld] != undefined) {
ds = ld;
target = _root.main.attachMovie("die", "die" + _root.dieindex, _root.dieindex, {_x:_root.main.grid["g" + ds]._x + _root.main.grid._x, _y:_root.main.grid["g" + ds]._y + _root.main.grid._y});
_root.dieindex++;
target.gridpoint = _root.main.grid["g" + ds];
_root.main.grid["g" + ds].occupied = true;
_root.main.grid["g" + ds].occupier = target;
target.dietype = _root.myLocalSO.data["die" + ld].dietype;
target.gposition = _root.myLocalSO.data["die" + ld].gposition;
target.gotoAndStop(target.dietype);
target._alpha = 100;
if (_root.myLocalSO.data["die" + ld].locked) {
target.locked = true;
}
if (_root.myLocalSO.data["odie" + ld] != undefined) {
target.overwriting = targeto;
}
}
ld++;
}
_root.availrollslots = _root.myLocalSO.data.availrollslots;
_root.availgridslots = _root.myLocalSO.data.availgridslots;
_root.score = _root.myLocalSO.data.score;
_root.main.scoreholder.update(_root.score);
_root.jokers = _root.myLocalSO.data.jokers;
_root.jokerpoints = _root.myLocalSO.data.jokerpoints;
_root.jokerlimit = _root.myLocalSO.data.jokerlimit;
_root.main.jokerbar.updatebar();
if (_root.myLocalSO.data.gameover) {
_root.main.gameover.ready = true;
_root.main.gameover._visible = true;
_root.main.gameover.dontplay = true;
}
_root.firsttime = _root.myLocalSO.data.firsttime;
if (_root.firsttime != undefined) {
_root.mainmenu.rulestipsbutton.helper._visible = false;
}
_root.splash.ready = true;
trace("HIHI");
if (_root.firstload == false) {
trace("START");
_root.firstload = true;
_root.savedataslim = function () {
_root.myLocalSO2.data = new Object();
trace("+" + _root.myLocalSO2.data);
_root.myLocalSO2.data.thisid = _root.thisid;
trace("+" + _root.myLocalSO2.data.thisid);
_root.myLocalSO2.flush();
};
_root.thisid = (_root.newid = String(Math.random() * 1000000));
_root.savedataslim();
_root.checkId = setInterval(_root, "checkit", 200);
}
};
_root.loaddataslim = function () {
_root.newid = _root.myLocalSO2.data.thisid;
};
_root.executeCallback = function () {
if (_root.myLocalSO.data.dataloaded == true) {
_root.loaddata();
clearInterval(intervalId);
} else {
_root.timeout++;
}
if (_root.timeout >= 120) {
_root.splash.ready = true;
if (_root.firstload == false) {
trace("START");
_root.firstload = true;
_root.savedataslim = function () {
_root.myLocalSO2.data = new Object();
trace("+" + _root.myLocalSO2.data);
_root.myLocalSO2.data.thisid = _root.thisid;
trace("+" + _root.myLocalSO2.data.thisid);
_root.myLocalSO2.flush();
};
_root.thisid = (_root.newid = String(Math.random() * 1000000));
_root.savedataslim();
_root.checkId = setInterval(_root, "checkit", 200);
}
clearInterval(intervalId);
}
};
_root.checkit = function () {
_root.myLocalSO2 = undefined;
_root.myLocalSO2 = SharedObject.getLocal("lockrollcookie2");
if (_root.myLocalSO2 == null) {
_root.SOdisabled = true;
} else {
_root.SOdisabled = false;
}
_root.timeout2 = 0;
_root.checkId2 = setInterval(_root, "executecheckback", 20);
};
_root.executecheckback = function () {
if (_root.myLocalSO2.data.dataloaded == true) {
_root.loaddataslim();
_root.checkit2();
clearInterval(checkId2);
} else {
_root.timeout2++;
}
if (_root.timeout2 >= 120) {
clearInterval(checkId2);
}
};
_root.checkit2 = function () {
_root.cctext.text = (("this: " + _root.thisid) + " , new:") + _root.newid;
if (_root.thisid != _root.newid) {
clearInterval(checkId);
_root.ccmenu.oef = true;
_root.curmenu.oef = true;
_root.curmenu = _root.ccmenu;
}
};
_root.refreshdata = function () {
_root.myLocalSO = SharedObject.getLocal("lockrollcookie");
_root.myLocalSO2 = SharedObject.getLocal("lockrollcookie2");
if (_root.myLocalSO == null) {
_root.SOdisabled = true;
} else {
_root.SOdisabled = false;
}
_root.timeout = 0;
_root.intervalId = setInterval(_root, "executeCallback", 20);
};
_root.refreshdata();
_root.savedata = function () {
if (_root.SOdisabled != true) {
_root.myLocalSO.data = new Object();
_root.myLocalSO2.data = new Object();
_root.myLocalSO.data.highscore = _root.highscore;
ld = 1;
while (ld <= 22) {
_root.myLocalSO.data["die" + ld] = undefined;
_root.myLocalSO.data["odie" + ld] = undefined;
if (_root.main.grid["g" + ld].occupied == true) {
_root.myLocalSO.data["die" + ld] = new Object();
_root.myLocalSO.data["die" + ld].dietype = _root.main.grid["g" + ld].occupier.dietype;
_root.myLocalSO.data["die" + ld].gposition = _root.main.grid["g" + ld].occupier.gposition;
_root.myLocalSO.data["die" + ld].locked = _root.main.grid["g" + ld].occupier.locked;
if (_root.main.grid["g" + ld].occupier.overwriting != undefined) {
_root.myLocalSO.data["odie" + ld] = new Object();
_root.myLocalSO.data["odie" + ld].dietype = _root.main.grid["g" + ld].occupier.overwriting.dietype;
_root.myLocalSO.data["odie" + ld].gposition = _root.main.grid["g" + ld].occupier.overwriting.gposition;
_root.myLocalSO.data["odie" + ld].locked = _root.main.grid["g" + ld].occupier.overwriting.locked;
}
}
ld++;
}
_root.myLocalSO.data.score = _root.score;
_root.myLocalSO.data.jokerpoints = _root.jokerpoints;
_root.myLocalSO.data.jokerlimit = _root.jokerlimit;
_root.myLocalSO.data.jokers = _root.jokers;
_root.myLocalSO.data.availrollslots = _root.availrollslots;
_root.myLocalSO.data.availgridslots = _root.availgridslots;
if (_root.main.gameover.ready) {
_root.myLocalSO.data.gameover = true;
} else {
_root.myLocalSO.data.gameover = false;
}
_root.myLocalSO.data.firsttime = _root.firsttime;
_root.myLocalSO2.data.thisid = _root.thisid;
trace(_root.myLocalSO2.data.thisid);
_root.myLocalSO.data.dataloaded = true;
_root.myLocalSO2.data.dataloaded = true;
_root.myLocalSO.flush();
_root.myLocalSO2.flush();
}
};
stop();
_root.faderate = 5;
_root.highscore = 0;
_root.soundon = true;
_root.resetgame = function () {
_root.availrollslots = 4;
_root.availgridslots = 16;
_root.control = true;
_root.dieindex = 1;
_root.combotester.swapDepths(9000);
_root.combotester.testing = false;
_root.combotester._alpha = 0;
_root.combotester._visible = false;
_root.combotester.bonusing = false;
_root.combotester.area = undefined;
_root.combotester.wait = 14;
_root.arealist = undefined;
_root.recentlocks = undefined;
_root.combotester.movecount = 0;
trace("arealist: " + _root.arealist);
_root.main.gameover.swapDepths(9000);
_root.main.plus1000.swapDepths(9001);
_root.main.gameover.ready = false;
_root.main.gameover.waiting = 0;
_root.main.waiting = 0;
_root.jokers = 0;
_root.jokerpoints = 0;
_root.jokerlimit = 250;
_root.justgameover = true;
_root.score = 0;
_root.main.scoreholder.update(_root.score);
_root.main.jokerbar.updatebar();
_root.curmenu = _root.main;
ld = 1;
while (ld <= 22) {
if (_root.main.grid["g" + ld].occupied != undefined) {
_root.main.grid["g" + ld].occupied = false;
_root.main.grid["g" + ld].occupier.goaway();
_root.main.grid["g" + ld].occupier = undefined;
}
ld++;
}
};
_root.resetgame();
_root.curmenu = _root.splash;
_root.curmenu.oef = true;
gi = 1;
while (gi <= 6) {
_root.main.grid["g" + gi].indx = 0;
gi++;
}
gi = 7;
while (gi <= 22) {
_root.main.grid["g" + gi].indx = gi;
gi++;
}
_root.lockit = function () {
trace("LOCK");
lockcount = 0;
_root.recentlocks = new Array();
ld = 7;
while (ld <= 22) {
if (_root.main.grid["g" + ld].occupier != undefined) {
if (_root.main.grid["g" + ld].occupier.locked != true) {
lockcount++;
_root.main.grid["g" + ld].occupier.lockdown(false);
if (_root.main.grid["g" + ld].occupier.dietype == 17) {
_root.jokers--;
}
}
}
ld++;
}
if (lockcount != 0) {
if (_root.soundon) {
hit2 = new Sound(this);
hit2.attachSound("Lock.mp3");
hit2.setVolume(75);
hit2.start();
}
} else if (_root.main.gameover.ready != true) {
if (_root.justgameover) {
_root.justgameover = false;
} else {
if (_root.soundon) {
hit = new Sound(this);
hit.attachSound("Error.mp3");
hit.start();
}
_root.shakefrees();
}
}
};
_root.rollit = function () {
_root.main.rollbutton.onEnterFrame = undefined;
if (_root.availrollslots == 4) {
if (_root.availgridslots >= 1) {
if (_root.soundon) {
hit = new Sound(this);
hit.attachSound("Roll.mp3");
hit.start();
}
stopat = _root.availgridslots;
if (stopat > 4) {
stopat = 4;
}
ds = 1;
while (ds <= stopat) {
_root.availrollslots--;
target = _root.main.attachMovie("die", "die" + _root.dieindex, _root.dieindex, {_x:_root.main.grid["g" + ds]._x + _root.main.grid._x, _y:_root.main.grid["g" + ds]._y + _root.main.grid._y});
_root.dieindex++;
target.gridpoint = _root.main.grid["g" + ds];
_root.main.grid["g" + ds].occupied = true;
_root.main.grid["g" + ds].occupier = target;
target.dietype = Math.floor(Math.random() * 16) + 1;
target.gposition = 0;
target.gotoAndStop(target.dietype);
target._alpha = 0;
target.soef = true;
ds++;
}
}
}
if ((_root.availgridslots == 0) && (_root.jokers == 0)) {
_root.main.gameover.ready = true;
_root.main.gameover.waiting = 0;
}
_root.savedata();
};
_root.shakefrees = function () {
ld = 1;
while (ld <= 6) {
if (_root.main.grid["g" + ld].occupier != undefined) {
_root.main.grid["g" + ld].occupier.shake();
}
ld++;
}
};
_root.spawnjoker = function () {
if (_root.jokers < 2) {
_root.jokers = _root.jokers + 1;
if (_root.main.grid.g5.occupied == true) {
ds = 6;
} else {
ds = 5;
}
target = _root.main.attachMovie("die", "die" + _root.dieindex, _root.dieindex, {_x:_root.main.grid["g" + ds]._x + _root.main.grid._x, _y:_root.main.grid["g" + ds]._y + _root.main.grid._y});
_root.dieindex++;
target.gridpoint = _root.main.grid["g" + ds];
_root.main.grid["g" + ds].occupied = true;
_root.main.grid["g" + ds].occupier = target;
target.dietype = 17;
target.gposition = 0;
target.gotoAndStop(target.dietype);
_root.main.jokermaker.jokerfade.glow();
} else {
_root.score = _root.score + 1000;
_root.main.plus1000.curstage = 1;
_root.combotester.wait = _root.combotester.wait + 50;
if (_root.score > _root.highscore) {
_root.highscore = _root.score;
}
_root.updateHighscore();
_root.main.scoreholder.update(_root.score);
}
if (_root.jokerlimit < 1500) {
_root.jokerlimit = _root.jokerlimit + 250;
}
};
_root.hi = function () {
trace("HI");
};
_root.updateHighscore = function () {
_root.mainmenu.scoreholder.update(_root.highscore);
};
Instance of Symbol 94 MovieClip [main] "main" in Frame 15 (21 B)
/* no clip actions */
Symbol 8 MovieClip [soundtoggle] Frame 1 (732 B)
this._visible = false;
this._alpha = 100;
this.fading = true;
this.onEnterFrame = function () {
if ((_root.curmenu == _root.main) && (_root.curmenu != undefined)) {
this._visible = true;
}
if ((this.fading == true) && (_root.curmenu != _root.splash)) {
if (this._alpha > 50) {
this._alpha = this._alpha - 5;
}
} else if (this._alpha < 100) {
this._alpha = this._alpha + 13;
}
};
this.onRollOver = function () {
this.fading = false;
};
this.onRollOut = function () {
this.fading = true;
};
this.onRelease = function () {
if (this._currentframe == 2) {
_root.soundon = false;
this.gotoAndStop(3);
} else {
_root.soundon = true;
this.gotoAndStop(2);
}
};
Symbol 8 MovieClip [soundtoggle] Frame 2 (8 B)
stop();
Symbol 11 MovieClip [ccmenu] Frame 1 (621 B)
this.xscale = 50;
this._visible = false;
this._alpha = 0;
this.onEnterFrame = function () {
if (this.oef == true) {
if (_root.curmenu == this) {
if (this.xscale < 100) {
this._visible = true;
this.xscale = this.xscale + _root.faderate;
this._alpha = this._alpha + (_root.faderate * 3);
} else if (this.xscale == 100) {
this.oef = false;
}
} else if (this.xscale > 50) {
this.xscale = this.xscale - _root.faderate;
this._alpha = this._alpha - (_root.faderate * 3);
} else if (this.xscale <= 50) {
this._visible = false;
this.oef = false;
}
}
};
Symbol 225 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0 (16.56 KiB) ● ● ●
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("3.0 as2");
}
static function showPreGameAd(options) {
var _local26 = {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 = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
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 _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.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 _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {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 = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
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 _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {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 = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.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 _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
if (_local7._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.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 _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(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);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 226 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0 (9.87 KiB) ● ●
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.0");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local3 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servicesURL != undefined) {
_servicesURL = urlOptions().servicesURL;
}
allowDomains(_servicesURL);
_clip = clip.createEmptyMovieClip(_local3, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip((((_servicesURL + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
trace("connected!");
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
if (_root.mochiad_options) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static var _servicesURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
}
Symbol 227 MovieClip [__Packages.mochi.as2.MochiScores] Frame 0 (4.6 KiB) ●
class mochi.as2.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.as2.MochiScores.boardID = boardID;
mochi.as2.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if ((options.clip == null) || (options.clip == undefined)) {
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();
mochi.as2.MochiServices.connect(mochi.as2.MochiServices.__get__id(), options.clip);
}
delete options.clip;
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (options.score instanceof TextField) {
if (options.score.text != undefined) {
options.score = options.score.text;
}
} else if (options.score instanceof mochi.as2.MochiDigits) {
options.score = options.score.value;
}
var _local1 = Number(options.score);
if (isNaN(_local1)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'");
} else if ((_local1 == Number.NEGATIVE_INFINITY) || (_local1 == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(_local1) != _local1) {
trace(("WARNING: Submitted score '" + options.score) + "' will be truncated");
}
options.score = _local1;
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.as2.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.as2.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
mochi.as2.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.as2.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
score = Number(score);
if (isNaN(score)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is 'Not a Number'");
} else if ((score == Number.NEGATIVE_INFINITY) || (score == Number.POSITIVE_INFINITY)) {
trace(("ERROR: Submitted score '" + String(score)) + "' will be rejected, score is an infinite");
} else {
if (Math.floor(score) != score) {
trace(("WARNING: Submitted score '" + String(score)) + "' will be truncated");
}
score = Number(score);
}
mochi.as2.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.as2.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 228 MovieClip [__Packages.mochi.as2.MochiDigits] Frame 0 (987 B)
class mochi.as2.MochiDigits
{
var Encoder, Fragment, Sibling;
function MochiDigits (digit, index) {
Encoder = 0;
setValue(digit, index);
}
function get value() {
return(Number(toString()));
}
function set value(v) {
setValue(v);
//return(value);
}
function addValue(v) {
value = value + v;
}
function setValue(digit, index) {
var _local3 = digit.toString();
if ((index == undefined) || (isNaN(index))) {
index = 0;
}
Fragment = _local3.charCodeAt(index++) ^ Encoder;
if (index < _local3.length) {
Sibling = new mochi.as2.MochiDigits(digit, index);
} else {
Sibling = null;
}
reencode();
}
function reencode() {
var _local2 = int(2147483647 * Math.random());
Fragment = Fragment ^ (_local2 ^ Encoder);
Encoder = _local2;
}
function toString() {
var _local2 = String.fromCharCode(Fragment ^ Encoder);
return(((Sibling != null) ? (_local2.concat(Sibling.toString())) : (_local2)));
}
}
Symbol 17 MovieClip [gamebg] Frame 1 (8 B)
stop();
Symbol 17 MovieClip [gamebg] Frame 10 (8 B)
stop();
Symbol 19 MovieClip [gamefade] Frame 1 (8 B)
stop();
Symbol 52 MovieClip [rulesinner] Frame 1 (91 B)
this.onEnterFrame = function () {
this._x = this._x + (0.25 * (this.sbx - this._x));
};
Symbol 54 MovieClip [ruletipsmenu] Frame 1 (887 B)
this.xscale = 50;
this._visible = false;
this._alpha = 0;
this.curmenu = 1;
this.menux = new Array();
this.menux[1] = (-1 * this.rulesinner.rule1._x) + 20;
this.menux[2] = (-1 * this.rulesinner.rule2._x) + 20;
this.menux[3] = (-1 * this.rulesinner.rule3._x) + 20;
this.menux[4] = (-1 * this.rulesinner.rule4._x) + 20;
this.onEnterFrame = function () {
if (this.oef == true) {
if (_root.curmenu == this) {
if (this.xscale < 100) {
this._visible = true;
this.xscale = this.xscale + _root.faderate;
this._alpha = this._alpha + (_root.faderate * 3);
} else if (this.xscale == 100) {
this.oef = false;
}
} else if (this.xscale > 50) {
this.xscale = this.xscale - _root.faderate;
this._alpha = this._alpha - (_root.faderate * 3);
} else if (this.xscale <= 50) {
this._visible = false;
this.oef = false;
}
}
};
Instance of Symbol 25 MovieClip [donebutton] in Symbol 54 MovieClip [ruletipsmenu] Frame 1 (159 B)
on (release) {
if (_root.curmenu == _root.ruletipsmenu) {
_root.ruletipsmenu.oef = true;
_root.mainmenu.oef = true;
_root.curmenu = _root.mainmenu;
}
}
Instance of Symbol 28 MovieClip [arrow button] in Symbol 54 MovieClip [ruletipsmenu] Frame 1 (215 B)
on (release) {
if (this._parent.curmenu > 1) {
this._parent.curmenu--;
this._parent.menuat.text = this._parent.curmenu + " of 4";
}
this._parent.rulesinner.sbx = this._parent.menux[this._parent.curmenu];
}
Instance of Symbol 28 MovieClip [arrow button] in Symbol 54 MovieClip [ruletipsmenu] Frame 1 (215 B)
on (release) {
if (this._parent.curmenu < 4) {
this._parent.curmenu++;
this._parent.menuat.text = this._parent.curmenu + " of 4";
}
this._parent.rulesinner.sbx = this._parent.menux[this._parent.curmenu];
}
Symbol 62 MovieClip [gridpoint] Frame 1 (52 B)
this.occupied = false;
this.occurpier = undefined;
Symbol 63 MovieClip [grid] Frame 1 (23 B)
this._visible = false;
Symbol 68 MovieClip Frame 1 (568 B)
this.glow = function () {
this.glowingup = true;
this.glowcount = 0;
this.glowcounter = 0;
this.oef = true;
};
this._alpha = 0;
this.onEnterFrame = function () {
if (this.oef) {
if (this.glowcount < 8) {
if (this.glowingup == true) {
if (this._alpha < 100) {
this._alpha = this._alpha + 8;
} else {
this.glowingup = false;
}
} else if (this._alpha > 0) {
this._alpha = this._alpha - 8;
} else {
this.glowingup = true;
this.glowcount++;
}
} else {
this.oef = false;
}
}
};
Symbol 75 MovieClip [jokerbar] Frame 1 (125 B)
stop();
this.updatebar = function () {
this.gotoAndStop(Math.ceil((_root.jokerpoints / _root.jokerlimit) * 100) + 1);
};
Symbol 78 MovieClip [jokerprogress] Frame 1 (718 B)
this._visible = false;
this.swapDepths(10000);
this.wide = 15;
this.updateProgress = function (progstring) {
ds = 1;
while (ds <= 9) {
this["number" + ds]._visible = false;
ds++;
}
digits = progstring.length;
this.progback._width = (this.wide * digits) + 10;
pp = 1;
while (pp <= progstring.length) {
newdigit = this.attachMovie("number", "number" + pp, pp, {_x:((((-1 * this.wide) * digits) / 2) + (pp * this.wide)) - 7});
if (isNaN(Number(progstring.charAt(pp - 1)))) {
newdigit.gotoAndStop(11);
} else if (Number(progstring.charAt(pp - 1)) == 0) {
newdigit.gotoAndStop(10);
} else {
newdigit.gotoAndStop(Number(progstring.charAt(pp - 1)));
}
pp++;
}
};
Symbol 83 MovieClip [numberholder] Frame 1 (949 B)
this.spacing = 5;
this.wide = 15;
this.update = function (number) {
ds = 1;
while (ds <= 7) {
this["number" + ds]._visible = false;
ds++;
}
if (number < 10000000) {
digits = 7;
}
if (number < 1000000) {
digits = 6;
}
if (number < 100000) {
digits = 5;
}
if (number < 10000) {
digits = 4;
}
if (number < 1000) {
digits = 3;
}
if (number < 100) {
digits = 2;
}
if (number < 10) {
digits = 1;
}
numString = String(number);
this._parent.pointsback._width = (this.wide * digits) + 10;
di = 1;
while (di <= digits) {
newdigit = this.attachMovie("number", "number" + di, di, {_x:((((-1 * this.wide) * digits) / 2) + (di * this.wide)) - 7.5});
single = numString.charAt(di - 1);
if (single == 0) {
newdigit.gotoAndStop(10);
} else {
newdigit.gotoAndStop(Number(single));
}
newdigit._visible = true;
di++;
}
};
this.update(0);
Symbol 85 MovieClip [gridlight] Frame 1 (373 B)
this._visible = false;
this.onEnterFrame = function () {
if (this.activated && (this._visible == false)) {
this._visible = true;
this._alpha = 25;
}
if ((this.activated != true) && (this._alpha > 0)) {
this._alpha = this._alpha - 5;
}
if ((this.activated != true) && (this._alpha <= 0)) {
this._visible = false;
}
};
Symbol 88 MovieClip [plus1000] Frame 1 (845 B)
this.curstage = 0;
this.origy = this._y;
this._visible = false;
this._alpha = 0;
this.waiting = 0;
this.onEnterFrame = function () {
if (this.curstage == 1) {
if (this._visible == false) {
this._visible = true;
}
if (this._alpha < 100) {
this._alpha = this._alpha + 5;
this._y = this._y - 1;
} else if ((this._alpha >= 100) && (this.waiting == 0)) {
this.waiting++;
} else if ((this._alpha >= 100) && (this.waiting < 30)) {
this.waiting++;
} else if (this.waiting == 30) {
this.waiting = 0;
this.curstage = 2;
}
}
if (this.curstage == 2) {
if (this._alpha > 0) {
this._alpha = this._alpha - 5;
this._y = this._y - 1;
} else if (this._alpha <= 0) {
this.curstage = 0;
this._visible = false;
this._y = this.origy;
}
}
};
Symbol 93 MovieClip Frame 1 (863 B)
this._visible = false;
this.ready = false;
this.waiting = 0;
this.onEnterFrame = function () {
if (this.ready) {
this.waiting++;
if (this.waiting >= 30) {
this._visible = true;
}
if ((this.waiting == 30) && (this.dontplay != true)) {
if (_root.soundon) {
hit = new Sound(this);
hit.attachSound("GameOver.mp3");
hit.start();
}
} else if ((this.dontplay == true) && (this.waiting == 30)) {
this.dontplay = false;
}
if (((this.waiting == 90) && (_root.mochiconnect != false)) && (_root.score != 0)) {
if (_root.curmenu == _root.main) {
_root.main.oef = true;
_root.submitmenu.oef = true;
_root.curmenu = _root.submitmenu;
_root.submitmenu.scoreholder.update(_root.score);
}
}
}
if (this.ready == false) {
this._visible = false;
}
};
Symbol 94 MovieClip [main] Frame 1 (624 B)
this.xscale = 50;
this._visible = false;
this._alpha = 0;
this.onEnterFrame = function () {
if (this.oef == true) {
if (_root.curmenu == this) {
if (this.xscale < 100) {
this._visible = true;
this.xscale = this.xscale + _root.faderate;
this._alpha = this._alpha + (_root.faderate * 3);
} else if (this.xscale >= 100) {
this.oef = false;
}
} else if (this.xscale > 50) {
this.xscale = this.xscale - _root.faderate;
this._alpha = this._alpha - (_root.faderate * 3);
} else if (this.xscale <= 50) {
this._visible = false;
this.oef = false;
}
}
};
Instance of Symbol 60 MovieClip [rollbutton] "rollbutton" in Symbol 94 MovieClip [main] Frame 1 (1.27 KiB) ●
on (release) {
if (_root.main.gameover.ready) {
_root.resetgame();
_root.justgameover = true;
}
if ((_root.combotester.testing != true) && (_root.combotester.bonusing != true)) {
_root.lockit();
_root.areatry = new Array();
ct = 1;
while (ct <= 20) {
_root.areatry[ct] = false;
ct++;
}
ct = 1;
while (ct <= 20) {
cc = 0;
while (cc <= 3) {
ccc = 0;
while (ccc <= (_root.recentlocks.length - 1)) {
if (_root.recentlocks[ccc] == _root.clayouts[ct][cc]) {
_root.areatry[ct] = true;
}
ccc++;
}
cc++;
}
ct++;
}
ct = 1;
while (ct <= 20) {
cc = 0;
while (cc <= 3) {
if (_root.main.grid["g" + _root.clayouts[ct][cc]].occupier == undefined) {
_root.areatry[ct] = false;
}
cc++;
}
ct++;
}
_root.arealist = new Array();
ct = 1;
while (ct <= 20) {
if (_root.areatry[ct]) {
_root.arealist.push(ct);
}
ct++;
}
if (_root.arealist[0] == undefined) {
if (_root.recentlocks[0] == undefined) {
this.wait = 0;
} else {
this.wait = 15;
}
this.onEnterFrame = function () {
if (this.wait > 0) {
this.wait--;
} else if (this.wait == 0) {
_root.rollit();
}
};
} else {
_root.combotester.testcombos();
}
}
}
Instance of Symbol 69 MovieClip [jokermaker] "jokermaker" in Symbol 94 MovieClip [main] Frame 1 (445 B)
on (release) {
if (_root.debug) {
_root.spawnjoker();
}
_root.main.jokerprogress._visible = true;
_root.main.jokerprogress.timer = 60;
_root.main.jokerprogress.updateProgress((String(_root.jokerpoints) + "/") + String(_root.jokerlimit));
_root.main.jokerprogress.onEnterFrame = function () {
if (this.timer > 0) {
this.timer--;
} else if (this.timer == 0) {
this._visible = false;
this.onEnterFrame = undefined;
}
};
}
Instance of Symbol 80 MovieClip [infobutton] "infobutton" in Symbol 94 MovieClip [main] Frame 1 (168 B)
on (press) {
if (_root.curmenu == _root.main) {
_root.main.oef = true;
_root.mainmenu.oef = true;
_root.curmenu = _root.mainmenu;
_root.updateHighscore();
}
}
Instance of Symbol 90 MovieClip [cannedlink] in Symbol 94 MovieClip [main] Frame 1 (69 B)
on (release) {
getURL ("http://www.canned-bananas.com", "_blank");
}
Symbol 105 MovieClip [namebutton] Frame 1 (554 B)
this.shake = function () {
this.shaking = true;
this.shakeindex = 0;
};
this.origx = this._x;
this.onEnterFrame = function () {
if (this.shaking) {
this.shakeindex++;
if (this.shakeindex == 17) {
this.shaking = false;
} else {
if ((this.shakeindex % 4) == 1) {
this._x = this.origx - 1;
}
if ((this.shakeindex % 8) == 2) {
this._x = this.origx;
}
if ((this.shakeindex % 8) == 3) {
this._x = this.origx + 1;
}
if ((this.shakeindex % 8) == 0) {
this._x = this.origx;
}
}
}
};
Symbol 114 MovieClip [submitmenu] Frame 1 (817 B)
this.xscale = 50;
this._visible = false;
this._alpha = 0;
this.onEnterFrame = function () {
if (this.oef == true) {
if (_root.curmenu == this) {
if (this.xscale < 100) {
this._visible = true;
this.xscale = this.xscale + _root.faderate;
this._alpha = this._alpha + (_root.faderate * 3);
} else if (this.xscale >= 100) {
this.oef = false;
}
} else if (this.xscale > 50) {
this.xscale = this.xscale - _root.faderate;
this._alpha = this._alpha - (_root.faderate * 3);
} else if (this.xscale <= 50) {
this._visible = false;
this.oef = false;
}
}
};
this.nameinput.text.restrict = " -~";
this.nameinput.onChanged = function () {
if (this.text.length > 12) {
this.text = this.text.substring(0, 12);
}
};
this.nameinput.text = "";
Instance of Symbol 97 MovieClip [submitbutton] in Symbol 114 MovieClip [submitmenu] Frame 1 (549 B)
on (release) {
if ((_root.curmenu == _root.submitmenu) && (this._parent.nameinput.text != "")) {
mochi.as2.MochiScores.showLeaderboard({score:_root.score, name:this._parent.nameinput.text, boardID:"8af6a5a83d8a6436", width:"500", height:"400", onDisplay:_root.mochimenu, onClose:_root.mochimenu});
_root.gobackto = _root.main;
} else if ((_root.curmenu == _root.submitmenu) && (this._parent.nameinput.text == "")) {
this._parent.namebutton.shake();
hit = new Sound(this);
hit.attachSound("Error.mp3");
hit.start();
}
}
Instance of Symbol 100 MovieClip [cancelbutton] in Symbol 114 MovieClip [submitmenu] Frame 1 (147 B)
on (release) {
if (_root.curmenu == _root.submitmenu) {
_root.main.oef = true;
_root.submitmenu.oef = true;
_root.curmenu = _root.main;
}
}
Symbol 128 MovieClip [die] Frame 1 (5.74 KiB) ● ●
this.lockbox._visible = false;
this.oef = false;
this.loef = false;
stop();
this.lockdown = function (fast) {
this.locked = true;
this.lockbox._visible = true;
if (this.dietype == 17) {
this.overwriting.goaway();
}
if (fast) {
} else {
this.lockbox._alpha = 0;
this.loef = true;
}
this.onPress = undefined;
this.onRelease = (this.onReleaseOutside = undefined);
_root.recentlocks.push(this.gposition);
};
this.shake = function () {
this.shaking = true;
this.shakeindex = 0;
};
this.goaway = function () {
this.removing = true;
};
this.onPress = function () {
if ((_root.combotester.testing != true) && (_root.combotester.bonusing != true)) {
this.startDrag();
this.shaking = false;
this.dragging = true;
this._alpha = 50;
this.swapDepths(_root.dieindex);
_root.dieindex++;
if (_root.soundon) {
hit = new Sound(this);
hit.attachSound("Grab.mp3");
hit.start();
}
}
};
this.onRelease = (this.onReleaseOutside = (this.loadSO = function () {
if ((_root.combotester.testing != true) && (_root.combotester.bonusing != true)) {
this.stopDrag();
this.dragging = false;
gc = 7;
while (gc <= 22) {
_root.main["l" + gc].activated = false;
gc++;
}
this._alpha = 100;
candidate = this.gridpoint;
candidatedist = (_root.main.grid.g8._x - _root.main.grid.g7._x) * 0.75;
gc = 1;
while (gc <= 22) {
if ((_root.main.grid["g" + gc].occupied == false) || ((this.dietype == 17) && (_root.main.grid["g" + gc].occupier.dietype != 17))) {
if (((this.dietype != 17) && ((gc <= 4) || (gc >= 7))) || ((this.dietype == 17) && (gc >= 5))) {
xdist = Math.abs(this._x - (_root.main.grid._x + _root.main.grid["g" + gc]._x));
ydist = Math.abs(this._y - (_root.main.grid._y + _root.main.grid["g" + gc]._y));
dist = Math.sqrt(Math.pow(xdist, 2) + Math.pow(ydist, 2));
if (dist < candidatedist) {
candidate = _root.main.grid["g" + gc];
candidatedist = dist;
}
}
}
gc++;
}
if ((this.dietype == 17) && (this.overwriting != undefined)) {
this.gridpoint.occupier = this.overwriting;
this.overwriting = undefined;
} else {
this.gridpoint.occupier = undefined;
this.gridpoint.occupied = false;
if (this.gposition == 0) {
if (this.dietype != 17) {
_root.availrollslots++;
}
} else {
_root.availgridslots++;
}
}
if (this.gridpoint == candidate) {
if (_root.soundon) {
hit = new Sound(this);
hit.attachSound("Error.mp3");
hit.start();
}
}
this.gridpoint = candidate;
if ((this.dietype == 17) && (this.gridpoint.occupier != undefined)) {
this.overwriting = this.gridpoint.occupier;
this.gridpoint.occupier = this;
this.gposition = this.gridpoint.indx;
} else {
this.gridpoint.occupier = this;
this.gridpoint.occupied = true;
this.gposition = this.gridpoint.indx;
if (this.gposition == 0) {
if (this.dietype != 17) {
_root.availrollslots--;
}
} else {
_root.availgridslots--;
}
}
this.oef = true;
if (_root.soundon) {
hit = new Sound(this);
hit.attachSound("Drop.mp3");
hit.start();
}
}
_root.savedata();
}));
this.onEnterFrame = function () {
if (this.shaking) {
this.shakeindex++;
if (this.shakeindex == 17) {
this.shaking = false;
} else {
if ((this.shakeindex % 4) == 1) {
this._x = (this.gridpoint._x + _root.main.grid._x) - 1;
}
if ((this.shakeindex % 8) == 2) {
this._x = this.gridpoint._x + _root.main.grid._x;
}
if ((this.shakeindex % 8) == 3) {
this._x = (this.gridpoint._x + _root.main.grid._x) + 1;
}
if ((this.shakeindex % 8) == 0) {
this._x = this.gridpoint._x + _root.main.grid._x;
}
}
}
if (this.oef) {
this._x = this._x + (0.5 * ((this.gridpoint._x + _root.main.grid._x) - this._x));
this._y = this._y + (0.5 * ((this.gridpoint._y + _root.main.grid._y) - this._y));
if ((Math.abs(0.25 * (this._y - (this.gridpoint._y + _root.main.grid._y))) + Math.abs(0.25 * (this._x - (this.gridpoint._x + _root.main.grid._x)))) < 0.25) {
this.oef = false;
this._x = this.gridpoint._x + _root.main.grid._x;
this._y = this.gridpoint._y + _root.main.grid._y;
}
}
if (this.loef && (this.lockbox._alpha < 100)) {
this.lockbox._alpha = this.lockbox._alpha + 20;
} else {
this.loef = false;
}
if (this.removing && (this._alpha > 0)) {
this._alpha = this._alpha - 10;
} else if (this.removing && (this._alpha <= 0)) {
this.removeMovieClip();
this.unloadMovie();
}
if (this.soef == true) {
if (this._alpha < 100) {
this._alpha = this._alpha + 10;
} else {
this.soef = false;
}
}
if (this.dragging) {
if (this._xscale < 120) {
this._xscale = this._xscale + 6;
this._yscale = this._yscale + 6;
}
} else if (this._xscale > 100) {
this._xscale = this._xscale - 6;
this._yscale = this._yscale - 6;
}
if (this.dragging) {
candidate = this.gridpoint;
candidatedist = (_root.main.grid.g8._x - _root.main.grid.g7._x) * 0.75;
gc = 7;
while (gc <= 22) {
_root.main["l" + gc].activated = false;
if ((_root.main.grid["g" + gc].occupied == false) || (_root.main.grid["g" + gc].occupier == this)) {
xdist = Math.abs(this._x - (_root.main.grid._x + _root.main.grid["g" + gc]._x));
ydist = Math.abs(this._y - (_root.main.grid._y + _root.main.grid["g" + gc]._y));
dist = Math.sqrt(Math.pow(xdist, 2) + Math.pow(ydist, 2));
if (dist < candidatedist) {
candidate = _root.main["l" + gc];
candidatedist = dist;
}
}
gc++;
}
candidate.activated = true;
}
};
if (this.locked) {
this.lockdown(true);
}
Symbol 154 MovieClip [splashmenu] Frame 1 (1.16 KiB) ●
this._xscale = 50;
this._yscale = 50;
this._alpha = 0;
this.xscale = 50;
this.waiting = 0;
this.onEnterFrame = function () {
this.waiting++;
if (this.waiting == 15) {
_root.titlelogo.ready = true;
}
if (this.oef == true) {
if (_root.curmenu == this) {
if (this.xscale < 100) {
this._visible = true;
this.xscale = this.xscale + _root.faderate;
this._xscale = this._xscale + _root.faderate;
this._yscale = this._yscale + _root.faderate;
this._alpha = this._alpha + (_root.faderate * 3);
} else if (this.xscale == 100) {
this.oef = false;
}
} else if (this.xscale > 50) {
this.xscale = this.xscale - _root.faderate;
this._xscale = this._xscale - _root.faderate;
this._yscale = this._yscale - _root.faderate;
this._alpha = this._alpha - (_root.faderate * 3);
} else if (this.xscale <= 50) {
this._visible = false;
this.oef = false;
}
}
if (((this.ready == true) && (this.xscale >= 100)) && (this.waiting >= 120)) {
_root.curmenu = _root.main;
this.oef = true;
_root.main.oef = true;
_root.titlebar.play();
_root.titlelogo.ready2 = true;
}
};
Symbol 156 MovieClip [title] Frame 1 (244 B)
this._alpha = 0;
this.onEnterFrame = function () {
if ((this._alpha < 100) && (this.ready)) {
this._alpha = this._alpha + 5;
}
if ((this._alpha > 0) && (this.ready2)) {
this._alpha = this._alpha - 10;
}
};
Symbol 166 MovieClip [sounds] Frame 1 (8 B)
stop();
Symbol 170 MovieClip [fader] Frame 1 (460 B)
this.onEnterFrame = function () {
if ((this.goingup == true) && (this._alpha < 50)) {
this._alpha = this._alpha + 10;
} else if (this.goingup && (this._alpha >= 50)) {
this.goingup = false;
} else if ((this.goingup == false) && (this._alpha > 0)) {
this._alpha = this._alpha - 10;
} else if ((this.goingup == false) && (this._alpha <= 0)) {
this.unloadMovie();
this.removeMovieClip();
}
};
Symbol 172 MovieClip [combotester] Frame 1 (10.8 KiB) ● ●
this._alpha = 0;
this._visible = false;
this.movespeed = 5;
this.movecount = 0;
this.testcombos = function () {
this.testing = true;
this._visible = true;
this.area = _root.arealist[0];
this._x = (_root.main._x + _root.main.grid["g" + _root.clayouts[area][0]]._x) + ((_root.main.grid["g" + _root.clayouts[area][3]]._x - _root.main.grid["g" + _root.clayouts[area][0]]._x) / 2);
this._x = this._x + _root.main.grid._x;
this._y = _root.main.grid["g" + _root.clayouts[area][0]]._y + ((_root.main.grid["g" + _root.clayouts[area][3]]._y - _root.main.grid["g" + _root.clayouts[area][0]]._y) / 2);
this._y = this._y + (_root.main._y + _root.main.grid._y);
this.sbx = this._x;
this.sby = this._y;
this.wait = 14;
};
this.onEnterFrame = function () {
if (this.testing && (this.wait == 0)) {
if (this._alpha < 100) {
this._alpha = this._alpha + 10;
} else if (this.movecount == 0) {
_root.arealist.shift();
this.area = _root.arealist[0];
this.xmove = 0;
this.ymove = 0;
if (_root.arealist[0] == undefined) {
trace("HI");
this.testing = false;
this.wait = 14;
forbonus = new Array();
cleared = 0;
rc = 7;
while (rc <= 22) {
if (_root.main.grid["g" + rc].occupier.remove) {
cleared++;
forbonus.push(rc);
_root.main.grid["g" + rc].occupier.goaway();
_root.main.grid["g" + rc].occupier = undefined;
_root.main.grid["g" + rc].occupied = false;
_root.availgridslots++;
}
rc++;
}
if (cleared > 4) {
trace("MOVE");
this.bonusing = true;
rc = 7;
while (rc <= 22) {
if (_root.main.grid["g" + rc].occupier.remove) {
fade = _root.attachMovie("fader", "fader" + rc, (_root.dieindex + rc) + 8000, {_x:(_root.main.grid["g" + rc]._x + _root.main.grid._x) + _root.main._x, _y:(_root.main.grid["g" + rc]._y + _root.main.grid._y) + _root.main._y});
fade.goingup = true;
fade._alpha = 0;
fade.gotoAndStop(3);
}
rc++;
}
this.sbx = 350;
this.sby = 377;
this.xmove = (this.sbx - this._x) / this.movespeed;
this.movecount = this.movespeed;
this.ymove = (this.sby - this._y) / this.movespeed;
this.wait = 14;
} else {
_root.rollit();
}
} else {
trace("KEEP");
this.sbx = (_root.main._x + _root.main.grid["g" + _root.clayouts[area][0]]._x) + ((_root.main.grid["g" + _root.clayouts[area][3]]._x - _root.main.grid["g" + _root.clayouts[area][0]]._x) / 2);
this.sbx = this.sbx + _root.main.grid._x;
this.sby = (_root.main._y + _root.main.grid["g" + _root.clayouts[area][0]]._y) + ((_root.main.grid["g" + _root.clayouts[area][3]]._y - _root.main.grid["g" + _root.clayouts[area][0]]._y) / 2);
this.sby = this.sby + _root.main.grid._y;
this.xmove = (this.sbx - this._x) / this.movespeed;
this.ymove = (this.sby - this._y) / this.movespeed;
this.movecount = this.movespeed;
this.wait = 14;
}
} else {
this._x = this._x + this.xmove;
this._y = this._y + this.ymove;
this.movecount--;
}
} else if ((((this.testing == false) && (this._alpha > 0)) && (this.wait == 0)) && (this.bonusing != true)) {
if (this._alpha > 100) {
_root.rollit();
}
this._alpha = this._alpha - 10;
} else if (((this.testing == false) && (this._alpha <= 0)) && (this.bonusing != true)) {
this._visible = false;
} else if (this.wait > 0) {
if (((this.wait == 1) && (_root.arealist[0] != undefined)) && (this.bonusing != true)) {
points = this.calculatepoints(_root.main.grid["g" + _root.clayouts[area][0]].occupier.dietype, _root.main.grid["g" + _root.clayouts[area][1]].occupier.dietype, _root.main.grid["g" + _root.clayouts[area][2]].occupier.dietype, _root.main.grid["g" + _root.clayouts[area][3]].occupier.dietype);
sf = 0;
while (sf <= 3) {
fade = _root.attachMovie("fader", "fader" + sf, (_root.dieindex + sf) + 8000, {_x:(_root.main.grid["g" + _root.clayouts[area][sf]]._x + _root.main.grid._x) + _root.main._x, _y:(_root.main.grid["g" + _root.clayouts[area][sf]]._y + _root.main.grid._y) + _root.main._y});
fade.goingup = true;
fade._alpha = 0;
if (points == 0) {
fade.gotoAndStop(1);
} else if ((points > 0) && (points < 100)) {
fade.gotoAndStop(2);
} else if (points >= 100) {
fade.gotoAndStop(3);
_root.main.grid["g" + _root.clayouts[area][sf]].occupier.remove = true;
}
sf++;
}
if (points >= 100) {
if (_root.soundon) {
hit = new Sound(this);
hit.attachSound("Score2.mp3");
hit.start();
}
} else if (points > 0) {
if (_root.soundon) {
hit = new Sound(this);
hit.attachSound("Score1.mp3");
hit.start();
}
}
jokersused = 0;
jp = 0;
while (jp <= 3) {
if (_root.main.grid["g" + _root.clayouts[area][jp]].occupier.dietype == 17) {
jokersused++;
}
jp++;
}
points = points - Math.ceil((points * 0.25) * jokersused);
this.scoreholder.update(points);
_root.score = _root.score + points;
if (_root.score > _root.highscore) {
_root.highscore = _root.score;
}
_root.main.scoreholder.update(_root.score);
_root.jokerpoints = _root.jokerpoints + points;
jp = 1;
while (jp <= 20) {
if (_root.jokerpoints >= _root.jokerlimit) {
_root.jokerpoints = _root.jokerpoints - _root.jokerlimit;
_root.spawnjoker();
}
jp++;
}
_root.main.jokerbar.updatebar();
} else if ((this.wait == 1) && (this.bonusing == true)) {
points = (cleared - 4) * 50;
this.scoreholder.update(points);
_root.score = _root.score + points;
if (_root.score > _root.highscore) {
_root.highscore = _root.score;
}
_root.main.scoreholder.update(_root.score);
_root.jokerpoints = _root.jokerpoints + points;
jp = 1;
while (jp <= 20) {
if (_root.jokerpoints >= _root.jokerlimit) {
_root.jokerpoints = _root.jokerpoints - _root.jokerlimit;
_root.spawnjoker();
}
jp++;
}
_root.main.jokerbar.updatebar();
bf = 0;
while (bf <= (forbonus.length - 1)) {
sf = forbonus[bf];
fade = _root.attachMovie("fader", "fader" + sf, (_root.dieindex + sf) + 8000, {_x:(_root.main.grid["g" + sf]._x + _root.main.grid._x) + _root.main._x, _y:(_root.main.grid["g" + sf]._y + _root.main.grid._y) + _root.main._y});
fade.goingup = true;
fade._alpha = 0;
fade.gotoAndStop(3);
bf++;
}
if (_root.soundon) {
hit = new Sound(this);
hit.attachSound("Score2.mp3");
hit.start();
}
}
this.wait--;
} else if (this.bonusing) {
if (this.movecount == 0) {
this.xmove = 0;
this.ymove = 0;
this.bonusing = false;
this.bonused = true;
this.wait = 14;
} else {
this._x = this._x + this.xmove;
this._y = this._y + this.ymove;
this.movecount--;
}
}
};
this.calculatepoints = function (d1, d2, d3, d4) {
t = new Array(d1, d2, d3, d4);
to = new Array(d1, d2, d3, d4);
to.sort(16);
n = new Array();
if (to[0] == 17) {
n[0] = 5;
} else {
n[0] = ((to[0] - 1) % 4) + 1;
}
if (to[1] == 17) {
n[1] = 5;
} else {
n[1] = ((to[1] - 1) % 4) + 1;
}
if (to[2] == 17) {
n[2] = 5;
} else {
n[2] = ((to[2] - 1) % 4) + 1;
}
if (to[3] == 17) {
n[3] = 5;
} else {
n[3] = ((to[3] - 1) % 4) + 1;
}
no = new Array(n[0], n[1], n[2], n[3]);
no.sort(16);
c = new Array((((to[0] - ((to[0] - 1) % 4)) - 1) / 4) + 1, (((to[1] - ((to[1] - 1) % 4)) - 1) / 4) + 1, (((to[2] - ((to[2] - 1) % 4)) - 1) / 4) + 1, (((to[3] - ((to[3] - 1) % 4)) - 1) / 4) + 1);
combofound = false;
pointsreward = 0;
if ((((combofound == false) && ((to[0] == to[1]) || (to[1] == 17))) && ((to[0] == to[2]) || (to[2] == 17))) && ((to[0] == to[3]) || (to[3] == 17))) {
combofound = true;
pointsreward = 400;
trace("four of a kind of a kind");
}
if ((combofound == false) && ((((((c[0] == c[1]) && ((c[0] == c[2]) || (c[2] == 5))) && ((c[0] == c[3]) || (c[3] == 5))) && (no[1] > no[0])) && ((no[2] > no[1]) || (no[2] == 5))) && ((no[3] > no[2]) || (no[3] == 5)))) {
trace("same color, each number");
combofound = true;
pointsreward = 200;
}
if ((combofound == false) && ((((((c[1] > c[0]) && ((c[2] > c[1]) || (c[2] == 5))) && ((c[3] > c[2]) || (c[3] == 5))) && (n[0] == n[1])) && ((no[0] == no[2]) || (no[2] == 5))) && ((no[0] == no[3]) || (no[3] == 5)))) {
trace("same number, each color");
combofound = true;
pointsreward = 200;
}
if ((combofound == false) && ((((((c[1] > c[0]) && ((c[2] > c[1]) || (c[2] == 5))) && ((c[3] > c[2]) || (c[3] == 5))) && (no[1] > no[0])) && ((no[2] > no[1]) || (no[2] == 5))) && ((no[3] > no[2]) || (no[3] == 5)))) {
trace("each color, each number");
combofound = true;
pointsreward = 100;
}
if ((combofound == false) && (((to[0] == to[1]) && ((to[2] == to[3]) || (to[3] == 17))) || (((to[0] != to[1]) && (to[1] == to[2])) && (to[3] == 17)))) {
trace("two pair");
combofound = true;
pointsreward = 60;
}
if ((((combofound == false) && (c[0] == c[1])) && (c[0] == c[2])) && (c[0] == c[3])) {
trace("same color only");
combofound = true;
pointsreward = 40;
}
if ((((combofound == false) && (n[0] == n[1])) && (n[0] == n[2])) && (n[0] == n[3])) {
trace("same number only");
combofound = true;
pointsreward = 40;
}
if ((combofound == false) && ((((no[0] == no[1]) && ((no[2] == no[3]) || (no[3] == 5))) || (((no[0] != no[1]) && (no[1] == no[2])) && (no[3] == 5))) && (((c[0] == c[1]) && ((c[2] == c[3]) || (c[3] == 5))) || (((c[0] != c[1]) && (c[1] == c[2])) && (c[3] == 5))))) {
trace("pair color pair number");
combofound = true;
pointsreward = 20;
}
if ((((combofound == false) && (c[1] > c[0])) && (c[2] > c[1])) && ((c[3] > c[2]) || (c[3] == 5))) {
trace("each color only");
combofound = true;
pointsreward = 10;
}
if ((((combofound == false) && (no[1] > no[0])) && (no[2] > no[1])) && ((no[3] > no[2]) || (no[3] == 5))) {
trace("each number only");
combofound = true;
pointsreward = 10;
}
if (((combofound == false) && (c[0] == c[1])) && (c[2] == c[3])) {
trace("color two pair");
combofound = true;
pointsreward = 5;
}
if (((combofound == false) && (no[0] == no[1])) && (no[2] == no[3])) {
trace("number two pair");
combofound = true;
pointsreward = 5;
}
return(pointsreward);
};
Symbol 177 MovieClip [creditsmenu] Frame 1 (621 B)
this.xscale = 50;
this._visible = false;
this._alpha = 0;
this.onEnterFrame = function () {
if (this.oef == true) {
if (_root.curmenu == this) {
if (this.xscale < 100) {
this._visible = true;
this.xscale = this.xscale + _root.faderate;
this._alpha = this._alpha + (_root.faderate * 3);
} else if (this.xscale == 100) {
this.oef = false;
}
} else if (this.xscale > 50) {
this.xscale = this.xscale - _root.faderate;
this._alpha = this._alpha - (_root.faderate * 3);
} else if (this.xscale <= 50) {
this._visible = false;
this.oef = false;
}
}
};
Instance of Symbol 25 MovieClip [donebutton] "donebutton" in Symbol 177 MovieClip [creditsmenu] Frame 1 (188 B)
on (release) {
if (_root.curmenu == _root.creditsmenu) {
_root.creditsmenu.oef = true;
_root.mainmenu.oef = true;
_root.curmenu = _root.mainmenu;
_root.apple._visible = true;
}
}
Symbol 182 MovieClip [high scores] Frame 1 (8 B)
stop();
Symbol 188 MovieClip [rules tips] Frame 1 (8 B)
stop();
Symbol 191 MovieClip [canned bananas] Frame 1 (8 B)
stop();
Symbol 194 MovieClip [credits] Frame 1 (8 B)
stop();
Symbol 203 MovieClip [fulladdbutton] Frame 1 (8 B)
stop();
Symbol 206 MovieClip [more games] Frame 1 (8 B)
stop();
Symbol 207 MovieClip [menu] Frame 1 (621 B)
this.xscale = 50;
this._visible = false;
this._alpha = 0;
this.onEnterFrame = function () {
if (this.oef == true) {
if (_root.curmenu == this) {
if (this.xscale < 100) {
this._visible = true;
this.xscale = this.xscale + _root.faderate;
this._alpha = this._alpha + (_root.faderate * 3);
} else if (this.xscale == 100) {
this.oef = false;
}
} else if (this.xscale > 50) {
this.xscale = this.xscale - _root.faderate;
this._alpha = this._alpha - (_root.faderate * 3);
} else if (this.xscale <= 50) {
this._visible = false;
this.oef = false;
}
}
};
Instance of Symbol 25 MovieClip [donebutton] "donebutton" in Symbol 207 MovieClip [menu] Frame 1 (143 B)
on (release) {
if (_root.curmenu == _root.mainmenu) {
_root.main.oef = true;
_root.mainmenu.oef = true;
_root.curmenu = _root.main;
}
}
Instance of Symbol 182 MovieClip [high scores] in Symbol 207 MovieClip [menu] Frame 1 (547 B)
on (press) {
this.pressing = true;
this.gotoAndStop(2);
}
on (dragOut) {
if (this.pressing) {
this.gotoAndStop(1);
}
}
on (dragOver) {
if (this.pressing) {
this.gotoAndStop(2);
}
}
on (release) {
this.pressing = false;
this.gotoAndStop(1);
if (_root.mochiconnect != false) {
mochi.as2.MochiScores.showLeaderboard({boardID:"8af6a5a83d8a6436", width:"500", height:"400", onDisplay:_root.mochimenu, onClose:_root.mochimenu});
_root.gobackto = _root.mainmenu;
}
}
on (releaseOutside) {
this.pressing = false;
this.gotoAndStop(1);
}
Instance of Symbol 188 MovieClip [rules tips] "rulestipsbutton" in Symbol 207 MovieClip [menu] Frame 1 (622 B)
on (press) {
this.pressing = true;
this.gotoAndStop(2);
this.helper._y = 11;
}
on (dragOut) {
if (this.pressing) {
this.gotoAndStop(1);
this.helper._y = 0;
}
}
on (dragOver) {
if (this.pressing) {
this.gotoAndStop(2);
this.helper._y = 11;
}
}
on (release) {
if (_root.curmenu == _root.mainmenu) {
_root.ruletipsmenu.oef = true;
_root.mainmenu.oef = true;
_root.curmenu = _root.ruletipsmenu;
_root.firsttime = false;
_root.savedata();
}
this.pressing = false;
this.gotoAndStop(1);
this.helper._y = 0;
}
on (releaseOutside) {
this.pressing = false;
this.gotoAndStop(1);
this.helper._y = 0;
}
Instance of Symbol 191 MovieClip [canned bananas] in Symbol 207 MovieClip [menu] Frame 1 (376 B)
on (press) {
this.pressing = true;
this.gotoAndStop(2);
}
on (dragOut) {
if (this.pressing) {
this.gotoAndStop(1);
}
}
on (dragOver) {
if (this.pressing) {
this.gotoAndStop(2);
}
}
on (release) {
this.pressing = false;
getURL ("http://www.canned-bananas.com", "_blank");
this.gotoAndStop(1);
}
on (releaseOutside) {
this.pressing = false;
this.gotoAndStop(1);
}
Instance of Symbol 194 MovieClip [credits] in Symbol 207 MovieClip [menu] Frame 1 (464 B)
on (press) {
this.pressing = true;
this.gotoAndStop(2);
}
on (dragOut) {
if (this.pressing) {
this.gotoAndStop(1);
}
}
on (dragOver) {
if (this.pressing) {
this.gotoAndStop(2);
}
}
on (release) {
if (_root.curmenu == _root.mainmenu) {
_root.creditsmenu.oef = true;
_root.mainmenu.oef = true;
_root.curmenu = _root.creditsmenu;
}
this.pressing = false;
this.gotoAndStop(1);
}
on (releaseOutside) {
this.pressing = false;
this.gotoAndStop(1);
}
Instance of Symbol 197 MovieClip [resetbutton] in Symbol 207 MovieClip [menu] Frame 1 (174 B)
on (press) {
if (_root.curmenu == _root.mainmenu) {
_root.resetmenu.oef = true;
_root.mainmenu.oef = true;
_root.curmenu = _root.resetmenu;
_root.mainbg.play();
}
}
Instance of Symbol 203 MovieClip [fulladdbutton] in Symbol 207 MovieClip [menu] Frame 1 (384 B)
on (press) {
this.pressing = true;
this.gotoAndStop(2);
}
on (dragOut) {
if (this.pressing) {
this.gotoAndStop(1);
}
}
on (dragOver) {
if (this.pressing) {
this.gotoAndStop(2);
}
}
on (release) {
this.pressing = false;
getURL ("http://canned-bananas.com/lock-n-roll", "_blank");
this.gotoAndStop(1);
}
on (releaseOutside) {
this.pressing = false;
this.gotoAndStop(1);
}
Instance of Symbol 206 MovieClip [more games] in Symbol 207 MovieClip [menu] Frame 1 (616 B)
on (press) {
this.pressing = true;
this.gotoAndStop(2);
}
on (dragOut) {
if (this.pressing) {
this.gotoAndStop(1);
}
}
on (dragOver) {
if (this.pressing) {
this.gotoAndStop(2);
}
}
on (release) {
this.pressing = false;
getURL ("http://click.linksynergy.com/fs-bin/stat?id=CHQ9Cdfc/Dg&offerid=146261&type=3&subid=0&tmpid=1826&RD_PARM1=http%253A%252F%252Fitunes.apple.com%252FWebObjects%252FMZStore.woa%252Fwa%252FviewArtist%253Fid%253D296595378%2526uo%253D6%2526partnerId%253D30", "_blank");
this.gotoAndStop(1);
}
on (releaseOutside) {
this.pressing = false;
this.gotoAndStop(1);
}
Symbol 214 MovieClip [resetmenu] Frame 1 (621 B)
this.xscale = 50;
this._visible = false;
this._alpha = 0;
this.onEnterFrame = function () {
if (this.oef == true) {
if (_root.curmenu == this) {
if (this.xscale < 100) {
this._visible = true;
this.xscale = this.xscale + _root.faderate;
this._alpha = this._alpha + (_root.faderate * 3);
} else if (this.xscale == 100) {
this.oef = false;
}
} else if (this.xscale > 50) {
this.xscale = this.xscale - _root.faderate;
this._alpha = this._alpha - (_root.faderate * 3);
} else if (this.xscale <= 50) {
this._visible = false;
this.oef = false;
}
}
};
Instance of Symbol 209 MovieClip [yesbutton] in Symbol 214 MovieClip [resetmenu] Frame 1 (187 B)
on (press) {
if (_root.curmenu == _root.resetmenu) {
_root.resetmenu.oef = true;
_root.main.oef = true;
_root.curmenu = _root.main;
_root.resetgame();
_root.mainbg.play();
}
}
Instance of Symbol 209 MovieClip [yesbutton] in Symbol 214 MovieClip [resetmenu] Frame 1 (174 B)
on (press) {
if (_root.curmenu == _root.resetmenu) {
_root.resetmenu.oef = true;
_root.mainmenu.oef = true;
_root.curmenu = _root.mainmenu;
_root.mainbg.play();
}
}
Symbol 220 MovieClip Frame 1 (8 B)
stop();
Symbol 220 MovieClip Frame 30 (8 B)
stop();
Symbol 224 MovieClip [itunes_button] Frame 1 (852 B)
this._visible = false;
this._alpha = 100;
this.fading = true;
this.onEnterFrame = function () {
if (_root.curmenu == _root.main) {
this._visible = true;
}
if ((this.fading == true) && (_root.curmenu != _root.splash)) {
if (this._alpha > 50) {
this._alpha = this._alpha - 5;
}
} else if (this._alpha < 100) {
this._alpha = this._alpha + 13;
}
};
this.onRollOver = function () {
this.fading = false;
};
this.onRollOut = function () {
this.fading = true;
};
this.onRelease = function () {
getURL ("http://click.linksynergy.com/fs-bin/stat?id=CHQ9Cdfc/Dg&offerid=146261&type=3&subid=0&tmpid=1826&RD_PARM1=http%253A%252F%252Fitunes.apple.com%252FWebObjects%252FMZStore.woa%252Fwa%252FviewSoftware%253Fid%253D303476518%2526mt%253D8%2526uo%253D6%2526partnerId%253D30", "_blank");
};