[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 (1.51 KiB) ●
function cam(cx, gameover) {
_root.camera._x = cx;
camadd = Math.floor(_root.camera._x / 10);
_root.camera._y = 0;
if (gameover == 1) {
_root.camera._width = 935;
_root.camera._height = 400;
} else if (gameover == 2) {
_root.camera._width = 187;
_root.camera._height = 80;
}
_root._x = ((-_root.camera._x) * Stage.width) / _root.camera._width;
_root._y = ((-_root.camera._y) * Stage.height) / _root.camera._height;
_root._xscale = (Stage.width / _root.camera._width) * 100;
_root._yscale = (Stage.height / _root.camera._height) * 100;
blockcheck(1);
}
_root.camera._visible = false;
cam(0);
contextmenu = new ContextMenu();
contextmenu.hideBuiltInItems();
_root.menu = contextmenu;
loadem = 1;
savedeath = SharedObject.getLocal("lastman");
if (savedeath.data.deaths) {
deaths = savedeath.data.deaths;
} else {
deaths = 0;
}
timetaken = 0;
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
newgroundin = (((domain == "newgrounds.com") || (domain == "ungrounded.net")) ? 1 : 0);
function loadcheck() {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
clearInterval(loadint);
_root.gotoAndStop("menu");
}
}
stop();
loadint = setInterval(loadcheck, 100);
_root.API_Settings = {movie_id:7112, enc_key:"W7jfPe9zSBTYWTJR4sdbyETWp8EAeeMG", debug_mode:false, movie_version:""};
Frame 9 (1.8 KiB) ●
cam(0);
menukeys = new Object();
menukeys.onKeyDown = function () {
if (Key.isDown(83)) {
select.start();
Key.removeListener(menukeys);
var _local2 = ((_root.selections._currentframe == 1) ? "game" : "instructions");
_root.gotoAndStop(_local2);
} else if (Key.isDown(38) || (Key.isDown(40))) {
toggled.start();
var _local2 = ((_root.selections._currentframe == 1) ? 2 : 1);
_root.selections.gotoAndStop(_local2);
}
};
Key.addListener(menukeys);
if (loadem) {
loadem = 0;
all = new Sound();
toggled = new Sound();
toggled.attachSound("toggled");
select = new Sound();
select.attachSound("select");
gameovermusic = new Sound();
gameovermusic.attachSound("gameovermusic");
athomeatlast = new Sound();
athomeatlast.attachSound("athomeatlast");
ajump = new Sound();
ajump.attachSound("jump");
anmedeath = new Sound();
anmedeath.attachSound("nmedeath");
ayourdeath = new Sound();
ayourdeath.attachSound("yourdeath");
ahiddenbox = new Sound();
ahiddenbox.attachSound("hiddenbox");
ashootem = new Sound();
ashootem.attachSound("shootem");
aportal = new Sound();
aportal.attachSound("portal");
armadillohit = new Sound();
armadillohit.attachSound("armadillohit");
bulletturn = new Sound();
bulletturn.attachSound("bulletturn");
menuscreen = new Sound();
menuscreen.attachSound("menuscreen");
}
all.stop();
menuscreen.start();
_root.small._visible = true;
bgmove = new Object();
bgmove.onMouseMove = function () {
_root.small._visible = false;
_root.big._x = ((_root._xmouse / _root.camera._width) * _root.camera._width) - ((_root._xmouse / _root.camera._width) * _root.big._width);
_root.big._y = ((_root._ymouse / _root.camera._height) * _root.camera._height) - ((_root._ymouse / _root.camera._height) * _root.big._height);
};
Mouse.addListener(bgmove);
Instance of Symbol 109 MovieClip in Frame 9 (148 B)
on (rollOver) {
_root.selections.gotoAndStop(1);
}
on (press) {
select.start();
Key.removeListener(_root.menukeys);
_root.gotoAndStop("game");
}
Instance of Symbol 109 MovieClip in Frame 9 (156 B)
on (rollOver) {
_root.selections.gotoAndStop(2);
}
on (press) {
select.start();
Key.removeListener(_root.menukeys);
_root.gotoAndStop("instructions");
}
Frame 17 (616 B)
cam(0);
instructionkeys = new Object();
instructionkeys.onKeyDown = function () {
if (Key.isDown(83)) {
select.start();
Key.removeListener(instructionkeys);
var _local2 = ((_root.selections._currentframe == 1) ? "game" : "menu");
_root.gotoAndStop(_local2);
} else if (Key.isDown(38) || (Key.isDown(40))) {
toggled.start();
var _local2 = ((_root.selections._currentframe == 1) ? 2 : 1);
_root.selections.gotoAndStop(_local2);
} else if (Key.isDown(39)) {
_root.manual.nextFrame();
} else if (Key.isDown(37)) {
_root.manual.prevFrame();
}
};
Key.addListener(instructionkeys);
Instance of Symbol 109 MovieClip in Frame 17 (155 B)
on (rollOver) {
_root.selections.gotoAndStop(1);
}
on (press) {
select.start();
Key.removeListener(_root.instructionkeys);
_root.gotoAndStop("game");
}
Instance of Symbol 109 MovieClip in Frame 17 (155 B)
on (rollOver) {
_root.selections.gotoAndStop(2);
}
on (press) {
select.start();
Key.removeListener(_root.instructionkeys);
_root.gotoAndStop("menu");
}
Frame 27 (981 B)
function adloadad() {
Key.addListener(gameoverkeys);
_root.selections.gotoAndStop(2);
clearInterval(gameoverint);
}
cam(0, 1);
gameoverkeys = new Object();
gameoverkeys.onKeyDown = function () {
if (Key.isDown(83)) {
select.start();
Key.removeListener(gameoverkeys);
var _local2 = ((_root.selections._currentframe == 2) ? "game" : "instructions");
cam(0, 2);
_root.gotoAndStop(_local2);
} else if (Key.isDown(38) || (Key.isDown(40))) {
toggled.start();
var _local2 = ((_root.selections._currentframe == 2) ? 3 : 2);
_root.selections.gotoAndStop(_local2);
}
};
gameovermusic.start();
deaths++;
savedeath.data.deaths = deaths;
savedeath.flush();
if ((deaths == 127) && (newgroundin)) {
_root.medal_popup._x = 14;
_root.medal_popup.unlockMedal("Harder Than Lost Levels");
} else if ((deaths % 5) == 0) {
Key.removeListener(gameoverkeys);
_root.gotoAndStop("aids");
} else {
gameoverint = setInterval(adloadad, 10);
}
Frame 36 (399 B)
function waitinad() {
clearInterval(returnint);
waittimeb = false;
if (!waittimea) {
_root.gotoAndStop("gameover");
}
}
waittimea = true;
waittimeb = true;
mochi.as2.MochiAd.showInterLevelAd({id:"7a6bdf57e392ba47", res:"935x400", ad_finished:function () {
waittimea = false;
if (!waittimeb) {
_root.gotoAndStop("gameover");
}
}});
returnint = setInterval(waitinad, 10000);
Frame 41 (412 B)
cam(0);
athomeatlast.start();
if (newgroundin) {
_root.medal_popup._x = 14;
_root.medal_popup.unlockMedal("Go Home");
}
_root.tt.text = "";
if (_root.timetaken > 3600) {
_root.tt.text = Math.floor(_root.timetaken / 3600) + "hours, ";
}
_root.tt.text = _root.tt.text + (((Math.floor(_root.timetaken / 60) + "minutes, ") + (_root.timetaken - (Math.floor(_root.timetaken / 60) * 60))) + "seconds");
Frame 50 (61.84 KiB) ● ● ● ●
function turnright() {
rawdesign[addx][addy][1] = 1;
}
function turnleft() {
rawdesign[addx][addy][1] = 0;
}
function faller() {
rawdesign[addx][addy][2] = 0;
}
function pacer() {
rawdesign[addx][addy][2] = 1;
}
function empty() {
}
function keys() {
if (!doorknob) {
var _local2 = 0;
while (_local2 < controls.length) {
controls[_local2][1] = ((!Key.isDown(controls[_local2][0])) ? 0 : (controls[_local2][1]));
controls[_local2][1] = ((Key.isDown(controls[_local2][0]) && (controls[_local2][1] != 2)) ? 1 : (controls[_local2][1]));
_local2++;
}
onground = checktiles(0, 0);
if (doorknob) {
return(0);
}
dir = (vars[0][7] ? "" : "b");
if (onground) {
if (vars[0][2] == vars[0][0]) {
if (controls[1][1] == 1) {
ajump.start();
controls[1][1] = 2;
vars[0][6] = -(Math.ceil(Math.abs(vars[0][4]) / 2) + 7);
if (vars[0][2] == vars[0][0]) {
_root.nmes.pc.gotoAndStop(dir + "jump");
}
} else if (controls[3][1]) {
_root.nmes.pc.gotoAndStop(dir + "crouch");
vars[0][2] = vars[0][1];
} else if (controls[4][1]) {
vars[0][7] = 1;
walkin();
if (controls[0][1]) {
vars[0][4] = vars[0][4] + ((vars[0][4] < maxdash) ? 0.5 : 0);
} else {
vars[0][4] = vars[0][4] + ((vars[0][4] < maxwalk) ? 0.5 : 0);
vars[0][4] = vars[0][4] - ((vars[0][4] > maxwalk) ? 0.5 : 0);
}
} else if (controls[5][1]) {
vars[0][7] = 0;
walkin();
if (controls[0][1]) {
vars[0][4] = vars[0][4] - ((vars[0][4] > (-maxdash)) ? 0.5 : 0);
} else {
vars[0][4] = vars[0][4] - ((vars[0][4] > (-maxwalk)) ? 0.5 : 0);
vars[0][4] = vars[0][4] + ((vars[0][4] < (-maxwalk)) ? 0.5 : 0);
}
} else {
walkanim = 0;
_root.nmes.pc.gotoAndStop(dir + "stand");
decrease(2);
}
} else if (controls[1][1] == 1) {
ajump.start();
controls[1][1] = 2;
vars[0][6] = -(Math.ceil(Math.abs(vars[0][4]) / 2) + 7);
if (vars[0][2] == vars[0][0]) {
_root.nmes.pc.gotoAndStop(dir + "jump");
}
} else if (!controls[3][1]) {
_root.nmes.pc.gotoAndStop(dir + "stand");
vars[0][2] = vars[0][0];
} else {
decrease(1);
}
} else if ((timer % 2) == 0) {
decker = 2;
decrease(1);
if (controls[4][1]) {
vars[0][4]++;
} else if (controls[5][1]) {
vars[0][4]--;
}
}
}
if (Key.isDown(49) && (!fourtynine)) {
fourtynine = 1;
designit();
} else if (!Key.isDown(49)) {
fourtynine = 0;
}
if (dev) {
if (Key.isDown(48) && (!fourtyeight)) {
fourtyeight = 1;
ingame = (ingame ? 0 : 1);
blockcheck();
} else if (!Key.isDown(48)) {
fourtyeight = 0;
}
if (Key.isDown(57) && (!fourtyseven)) {
fourtyseven = 1;
forward = (forward ? 0 : 1);
} else if (!Key.isDown(57)) {
fourtyseven = 0;
}
}
if (!ingame) {
if (ASnative(800, 2) /* [Key] isDown */(4) && (!middleclick)) {
middleclick = 1;
bx = Math.floor(_root._xmouse / 10);
by = Math.floor(_root._ymouse / 10);
seto = rawdesign[bx][by];
mdown = 1;
} else if ((!ASnative(800, 2) /* [Key] isDown */(4)) && (middleclick)) {
middleclick = 0;
seto = 0;
mdown = 0;
}
}
}
function rightstuff() {
prepx = Math.floor(_root._xmouse / 10);
prepy = Math.floor(_root._ymouse / 10);
if ((addx != prepx) || (addy != prepy)) {
addx = prepx;
addy = prepy;
if (rawdesign[addx][addy] < 11) {
menuname0.visible = false;
menuname1.visible = false;
menuname2.visible = false;
menuname3.visible = false;
menuname4.caption = "Cancel";
} else {
menuname0.visible = false;
menuname1.visible = false;
menuname2.visible = false;
menuname3.visible = false;
if (rawdesign[addx][addy][1] != 1) {
menuname0.visible = true;
}
if (rawdesign[addx][addy][1] != 0) {
menuname1.visible = true;
}
if (rawdesign[addx][addy][2] != 0) {
menuname2.visible = true;
}
if (rawdesign[addx][addy][2] != 1) {
menuname3.visible = true;
}
var _local2 = "";
_local2 = _local2 + ((rawdesign[addx][addy][1] == 1) ? "Right::" : "");
_local2 = _local2 + ((rawdesign[addx][addy][1] == 0) ? "Left::" : "");
_local2 = _local2 + ((rawdesign[addx][addy][2] == 0) ? "Fall" : "");
_local2 = _local2 + ((rawdesign[addx][addy][2] == 1) ? "Pace" : "");
_local2 = _local2 + ((_local2 == "") ? "Cancel" : "");
menuname4.caption = _local2;
}
}
}
function blockset(nokill) {
bx = Math.floor(_root._xmouse / 10);
by = Math.floor(_root._ymouse / 10);
if (rawdesign[bx] == undefined) {
rawdesign[bx] = new Array();
var _local2 = 0;
while (_local2 < levelh) {
rawdesign[bx][_local2] = 0;
_local2++;
}
}
if (nokill) {
rawdesign[bx][by] = seto;
} else {
rawdesign[bx][by] = ((rawdesign[bx][by] == 1) ? 0 : 1);
seto = rawdesign[bx][by];
}
blockcheck();
}
function blockcheck(nodesign) {
var _local3 = 0;
while (_local3 < blocklist.length) {
var _local8 = blocklist[_local3][0];
var _local7 = blocklist[_local3][1];
var _local9 = (("b" + _local8) + "") + _local7;
if (((design[_local8][_local7] != rawdesign[_local8][_local7]) || (_root.bg[_local9]._x < (_root.camera._x - 10))) || (_root.bg[_local9]._x > ((_root.camera._x + _root.camera._width) + 10))) {
_root.bg[_local9].removeMovieClip();
blocklist.splice(_local3, 1);
}
_local3++;
}
if (!nodesign) {
design = rawdesign.copyarray();
_local3 = 1;
while (_local3 < vars.length) {
_root.nmes[vars[_local3][8]].removeMovieClip();
_local3++;
}
vars = new Array();
vars[0] = new Array(15, 9, 15, 6, 0, 0, 0, 1, "pc");
}
dshots = new Array();
_local3 = camadd;
while (_local3 < (levelw + camadd)) {
var _local2 = 0;
while (_local2 < levelh) {
if (design[_local3][_local2] && ((!_root.bg[(("b" + _local3) + "") + _local2]) || (tileset[design[_local3][_local2]] == "diamondshot"))) {
_root.bg[(("b" + _local3) + "") + _local2].removeMovieClip();
k++;
_root.bg.attachMovie("block", (("b" + _local3) + "") + _local2, k);
blocklist.push(new Array(_local3, _local2));
if (tileset[design[_local3][_local2]] == "diamondshot") {
dshots.push(new Array(_local3, _local2));
} else if (tileset[design[_local3][_local2]] == "warp") {
warpzones.push((_local3 * 10) + 5, rl);
}
if (typeof(design[_local3][_local2]) == "number") {
var _local6 = design[_local3][_local2];
} else {
var _local6 = design[_local3][_local2][0];
}
_root.bg[(("b" + _local3) + "") + _local2].gotoAndStop(tileset[_local6]);
_root.bg[(("b" + _local3) + "") + _local2]._x = _local3 * 10;
_root.bg[(("b" + _local3) + "") + _local2]._y = _local2 * 10;
} else if (((design[_local3][_local2][1] != undefined) && (design[_local3][_local2][2] != undefined)) && (ingame)) {
var _local4 = (design[_local3][_local2][1] ? 1 : -1);
if (tileset[design[_local3][_local2][0]] == "crab") {
vars.push(new Array(design[_local3][_local2][0], design[_local3][_local2][2], 5, 6, _local4, 0, 0, design[_local3][_local2][1], "nme" + nmez));
var _local5 = 1;
} else if (tileset[design[_local3][_local2][0]] == "snail") {
vars.push(new Array(design[_local3][_local2][0], design[_local3][_local2][2], 5, 11, _local4, 0, 0, design[_local3][_local2][1], "nme" + nmez, 0));
var _local5 = (design[_local3][_local2][1] ? 1 : 2);
} else if (tileset[design[_local3][_local2][0]] == "porcupine") {
vars.push(new Array(design[_local3][_local2][0], design[_local3][_local2][2], 6, 6, _local4, 0, 0, design[_local3][_local2][1], "nme" + nmez));
var _local5 = (design[_local3][_local2][1] ? 1 : 3);
} else if (tileset[design[_local3][_local2][0]] == "armadillo") {
vars.push(new Array(design[_local3][_local2][0], design[_local3][_local2][2], 4, 6, _local4, 0, 0, design[_local3][_local2][1], "nme" + nmez));
var _local5 = (design[_local3][_local2][1] ? 1 : 3);
}
_root.bg[(("b" + _local3) + "") + _local2].removeMovieClip();
_root.nmes.attachMovie(tileset[design[_local3][_local2][0]], "nme" + nmez, _root.nmes.getNextHighestDepth());
_root.nmes["nme" + nmez].gotoAndStop(_local5);
_root.nmes["nme" + nmez]._x = _local3 * 10;
_root.nmes["nme" + nmez]._y = (_local2 * 10) + 9;
nmez++;
design[_local3][_local2] = 0;
}
_local2++;
}
_local3++;
}
}
function designit() {
designtxt = "rawdesign = [";
var _local3 = 0;
while (_local3 < rawdesign.length) {
if (_local3) {
designtxt = designtxt + ",";
}
designtxt = designtxt + "[";
var _local2 = 0;
while (_local2 < levelh) {
if (_local2) {
designtxt = designtxt + ",";
}
if (typeof(rawdesign[_local3][_local2]) == "number") {
designtxt = designtxt + rawdesign[_local3][_local2];
} else {
designtxt = designtxt + (("[" + rawdesign[_local3][_local2].join(",")) + "]");
}
_local2++;
}
designtxt = designtxt + "]";
_local3++;
}
designtxt = designtxt + "];";
trace(designtxt);
trace((("_x:" + _root.boss._x) + " _y:") + _root.boss._y);
trace((("_px:" + _root.nmes.pc._x) + " _py:") + _root.nmes.pc._y);
}
function death(id) {
var _local2 = vars[id][8];
_root.nmes[_local2].gotoAndStop("death");
obits.push(new Array(_local2, -8));
if (id == 0) {
if (!dev) {
ayourdeath.start();
doorknob = 1;
}
} else {
anmedeath.start();
vars.splice(id, 1);
}
}
function mainscript() {
timer++;
keys();
movement(0);
if ((timer % 2) == 0) {
var _local3 = 1;
while (_local3 < vars.length) {
movement(_local3);
_local3++;
}
}
if (((!forward) && (_root.nmes.pc._x < 60)) && (_root.nmes.pc._y < 50)) {
clearInterval(intcall);
_root.timetaken = Math.floor(timer / 31.25);
_root.gotoAndStop("youwin");
}
if ((forward && (_root.nmes.pc._x > 8110)) && (_root.nmes.pc._y > 60)) {
forward = 0;
_root.boss.play();
}
if ((_root.nmes.pc._y > (_root.camera._height + 80)) && (!dev)) {
clearInterval(intcall);
_root.gotoAndStop("gameover");
}
var _local3 = 0;
while (_local3 < obits.length) {
var _local2 = obits[_local3][0];
_root.nmes[_local2]._y = _root.nmes[_local2]._y + obits[_local3][1];
obits[_local3][1] = obits[_local3][1] + ((obits[_local3][1] < maxfall) ? 1 : 0);
if (_root.nmes[_local2]._y > (_root.camera._height + 80)) {
if ((_local2 == "pc") && (!dev)) {
clearInterval(intcall);
_root.gotoAndStop("gameover");
} else {
_root.nmes[_local2].removeMovieClip();
}
obits.splice(_local3, 1);
}
_local3++;
}
if (ingame) {
if (forward) {
if ((_root.nmes.pc._x > (_root.camera._x + 70)) || (_root.nmes.pc._x < _root.camera._x)) {
cam(_root.nmes.pc._x - 70);
}
} else if (((_root.nmes.pc._x < (_root.camera._x + 90)) || (_root.nmes.pc._x > (_root.camera._x + _root.camera._width))) && ((_root.nmes.pc._x - 90) > -1)) {
cam(_root.nmes.pc._x - 90);
}
} else {
if (_root.nmes.pc._x > (_root.camera._x + 110)) {
cam(_root.nmes.pc._x - 110);
}
if ((_root.nmes.pc._x < (_root.camera._x + 70)) && ((_root.nmes.pc._x - 70) > 0)) {
cam(_root.nmes.pc._x - 70);
}
}
_local3 = 0;
while (_local3 < dbullets.length) {
bullethit(_local3);
_local3++;
}
if (((timer % 50) == 0) && (dshots.length > 0)) {
_local3 = 0;
while (_local3 < dshots.length) {
setdshot(_local3);
_local3++;
}
ashootem.start();
}
killkill = new Array();
_local3 = 0;
while (_local3 < killblock.length) {
killblock[_local3][2]--;
if (killblock[_local3][2] == 0) {
if (typeof(killblock[_local3][0]) == "string") {
_root.bg[killblock[_local3][0]].gotoAndStop("spring");
killkill.push(_local3);
} else {
design[killblock[_local3][0]][killblock[_local3][1]] = 0;
_root.bg[(("b" + killblock[_local3][0]) + "") + killblock[_local3][1]].gotoAndStop("breakaway2");
}
} else if (killblock[_local3][2] == -2) {
_root.bg[(("b" + killblock[_local3][0]) + "") + killblock[_local3][1]].removeMovieClip();
killkill.push(_local3);
}
_local3++;
}
_local3 = 0;
while (_local3 < killkill.length) {
killblock.splice(_local3, 1);
_local3++;
}
}
function bullethit(i) {
if ((timer % 10) == 0) {
_root.dee[dbullets[i][0]].gotoAndStop(1);
} else if ((timer % 10) == 5) {
_root.dee[dbullets[i][0]].gotoAndStop(2);
}
bx = Math.floor(_root.dee[dbullets[i][0]]._x / 10);
by = Math.floor(_root.dee[dbullets[i][0]]._y / 10);
cx = _root.dee[dbullets[i][0]]._x - (bx * 10);
cy = _root.dee[dbullets[i][0]]._y - (by * 10);
oldflip = dbullets[i][1];
if ((dbullets[i][1] == 0) && ((cx == 9) || (cy == 0))) {
var _local4 = design[bx + 1][by];
var _local3 = design[bx][by - 1];
_local4 = ((((_local4 == 3) || (_local4[0] > 11)) || (_local4 == 7)) ? 0 : (_local4));
_local3 = ((((_local3 == 3) || (_local3[0] > 11)) || (_local3 == 7)) ? 0 : (_local3));
dbullets[i][1] = (((cx == 9) && (_local4)) ? 3 : (dbullets[i][1]));
dbullets[i][1] = (((cy == 0) && (_local3)) ? 1 : (dbullets[i][1]));
if (oldflip != dbullets[i][1]) {
_root.dee[dbullets[i][0]]._xscale = ((dbullets[i][1] == 3) ? 100 : -100);
_root.dee[dbullets[i][0]]._yscale = ((dbullets[i][1] == 3) ? 100 : -100);
}
} else if ((dbullets[i][1] == 1) && ((cx == 9) || (cy == 9))) {
var _local4 = design[bx + 1][by];
var _local3 = design[bx][by + 1];
_local4 = ((((_local4 == 3) || (_local4[0] > 11)) || (_local4 == 7)) ? 0 : (_local4));
_local3 = ((((_local3 == 3) || (_local3[0] > 11)) || (_local3 == 7)) ? 0 : (_local3));
dbullets[i][1] = (((cx == 9) && (_local4)) ? 2 : (dbullets[i][1]));
dbullets[i][1] = (((cy == 9) && (_local3)) ? 0 : (dbullets[i][1]));
if (oldflip != dbullets[i][1]) {
_root.dee[dbullets[i][0]]._xscale = ((dbullets[i][1] == 0) ? -100 : 100);
_root.dee[dbullets[i][0]]._yscale = ((dbullets[i][1] == 0) ? 100 : -100);
}
} else if ((dbullets[i][1] == 2) && ((cx == 0) || (cy == 9))) {
var _local4 = design[bx - 1][by];
var _local3 = design[bx][by + 1];
_local4 = ((((_local4 == 3) || (_local4[0] > 11)) || (_local4 == 7)) ? 0 : (_local4));
_local3 = ((((_local3 == 3) || (_local3[0] > 11)) || (_local3 == 7)) ? 0 : (_local3));
dbullets[i][1] = (((cx == 0) && (_local4)) ? 1 : (dbullets[i][1]));
dbullets[i][1] = (((cy == 9) && (_local3)) ? 3 : (dbullets[i][1]));
if (oldflip != dbullets[i][1]) {
_root.dee[dbullets[i][0]]._xscale = ((dbullets[i][1] == 3) ? 100 : -100);
_root.dee[dbullets[i][0]]._yscale = ((dbullets[i][1] == 3) ? 100 : -100);
}
} else if ((dbullets[i][1] == 3) && ((cx == 0) || (cy == 0))) {
var _local4 = design[bx - 1][by];
var _local3 = design[bx][by - 1];
_local4 = ((((_local4 == 3) || (_local4[0] > 11)) || (_local4 == 7)) ? 0 : (_local4));
_local3 = ((((_local3 == 3) || (_local3[0] > 11)) || (_local3 == 7)) ? 0 : (_local3));
dbullets[i][1] = (((cx == 0) && (_local4)) ? 0 : (dbullets[i][1]));
dbullets[i][1] = (((cy == 0) && (_local3)) ? 2 : (dbullets[i][1]));
if (oldflip != dbullets[i][1]) {
_root.dee[dbullets[i][0]]._xscale = ((dbullets[i][1] == 0) ? -100 : 100);
_root.dee[dbullets[i][0]]._yscale = ((dbullets[i][1] == 0) ? 100 : -100);
}
}
if (oldflip != dbullets[i][1]) {
bulletturn.start();
}
if (dbullets[i][1] == 0) {
_root.dee[dbullets[i][0]]._x++;
_root.dee[dbullets[i][0]]._y--;
} else if (dbullets[i][1] == 1) {
_root.dee[dbullets[i][0]]._x++;
_root.dee[dbullets[i][0]]._y++;
} else if (dbullets[i][1] == 2) {
_root.dee[dbullets[i][0]]._x--;
_root.dee[dbullets[i][0]]._y++;
} else if (dbullets[i][1] == 3) {
_root.dee[dbullets[i][0]]._x--;
_root.dee[dbullets[i][0]]._y--;
}
if ((((_root.dee[dbullets[i][0]]._x > _root.nmes.pc._x) && (_root.dee[dbullets[i][0]]._x < (_root.nmes.pc._x + vars[0][3]))) && (_root.dee[dbullets[i][0]]._y < _root.nmes.pc._y)) && (_root.dee[dbullets[i][0]]._y > (_root.nmes.pc._y - vars[0][2]))) {
death(0);
var _local5 = 1;
}
if ((((_local5 || (_root.dee[dbullets[i][0]]._x < (_root.camera._x - 10))) || (_root.dee[dbullets[i][0]]._x > ((_root.camera._x + _root.camera._width) + 10))) || (_root.dee[dbullets[i][0]]._y < (_root.camera._y - 10))) || (_root.dee[dbullets[i][0]]._y > ((_root.camera._y + _root.camera._height) + 10))) {
_root.dee[dbullets[i][0]].removeMovieClip();
dbullets.splice(i, 1);
}
}
function setdshot(i) {
var _local5 = design[dshots[i][0]][dshots[i][1] - 1];
var _local8 = design[dshots[i][0] + 1][dshots[i][1] - 1];
var _local4 = design[dshots[i][0] + 1][dshots[i][1]];
var _local7 = design[dshots[i][0] + 1][dshots[i][1] + 1];
var _local3 = design[dshots[i][0]][dshots[i][1] + 1];
var _local10 = design[dshots[i][0] - 1][dshots[i][1] + 1];
var _local6 = design[dshots[i][0] - 1][dshots[i][1]];
var _local9 = design[dshots[i][0] - 1][dshots[i][1] - 1];
_local5 = ((((_local5 == 3) || (_local5[0] > 11)) || (_local5 == 7)) ? 0 : (_local5));
_local8 = ((((_local8 == 3) || (_local8[0] > 11)) || (_local8 == 7)) ? 0 : (_local8));
_local4 = ((((_local4 == 3) || (_local4[0] > 11)) || (_local4 == 7)) ? 0 : (_local4));
_local7 = ((((_local7 == 3) || (_local7[0] > 11)) || (_local7 == 7)) ? 0 : (_local7));
_local3 = ((((_local3 == 3) || (_local3[0] > 11)) || (_local3 == 7)) ? 0 : (_local3));
_local10 = ((((_local10 == 3) || (_local10[0] > 11)) || (_local10 == 7)) ? 0 : (_local10));
_local6 = ((((_local6 == 3) || (_local6[0] > 11)) || (_local6 == 7)) ? 0 : (_local6));
_local9 = ((((_local9 == 3) || (_local9[0] > 11)) || (_local9 == 7)) ? 0 : (_local9));
if (((!_local5) && (!_local8)) && (!_local4)) {
_root.dee.attachMovie("dshot", "d" + deez, deez);
_root.dee["d" + deez]._xscale = -100;
_root.dee["d" + deez].gotoAndStop(1);
_root.dee["d" + deez]._x = (dshots[i][0] * 10) + 15;
_root.dee["d" + deez]._y = (dshots[i][1] * 10) - 5;
dbullets.push(new Array("d" + deez, 0));
deez++;
}
if (((!_local4) && (!_local7)) && (!_local3)) {
_root.dee.attachMovie("dshot", "d" + deez, deez);
_root.dee["d" + deez]._xscale = -100;
_root.dee["d" + deez]._yscale = -100;
_root.dee["d" + deez].gotoAndStop(1);
_root.dee["d" + deez]._x = (dshots[i][0] * 10) + 15;
_root.dee["d" + deez]._y = (dshots[i][1] * 10) + 15;
dbullets.push(new Array("d" + deez, 1));
deez++;
}
if (((!_local3) && (!_local10)) && (!_local6)) {
_root.dee.attachMovie("dshot", "d" + deez, deez);
_root.dee["d" + deez]._yscale = -100;
_root.dee["d" + deez].gotoAndStop(1);
_root.dee["d" + deez]._x = (dshots[i][0] * 10) - 5;
_root.dee["d" + deez]._y = (dshots[i][1] * 10) + 15;
dbullets.push(new Array("d" + deez, 2));
deez++;
}
if (((!_local6) && (!_local9)) && (!_local5)) {
_root.dee.attachMovie("dshot", "d" + deez, deez);
_root.dee["d" + deez].gotoAndStop(1);
_root.dee["d" + deez]._x = (dshots[i][0] * 10) - 5;
_root.dee["d" + deez]._y = (dshots[i][1] * 10) - 5;
dbullets.push(new Array("d" + deez, 3));
deez++;
}
}
function checktiles(checking, id) {
var _local3 = vars[id][8];
bx = Math.floor(_root.nmes[_local3]._x / 10);
by = Math.floor(_root.nmes[_local3]._y / 10);
dx = Math.floor((_root.nmes[_local3]._x + vars[id][3]) / 10);
dy = Math.floor((_root.nmes[_local3]._y - vars[id][2]) / 10);
cx = _root.nmes[_local3]._x - (bx * 10);
cy = _root.nmes[_local3]._y - (by * 10);
ex = (_root.nmes[_local3]._x + vars[id][3]) - (dx * 10);
ey = (_root.nmes[_local3]._y - vars[id][2]) - (dy * 10);
if (checking == 0) {
var _local6 = design[bx][by + 1];
var _local7 = design[dx][by + 1];
_local6 = ((((_local6 == 3) || (_local6[0] > 11)) || (_local6 == 7)) ? 0 : (_local6));
_local7 = ((((_local7 == 3) || (_local7[0] > 11)) || (_local7 == 7)) ? 0 : (_local7));
var _local12 = (((cy == 9) && (_local6 || (_local7))) ? 1 : 0);
if (id == 0) {
var _local2 = 1;
while (_local2 < vars.length) {
if ((_root.nmes.pc._y > (_root.nmes[vars[_local2][8]]._y - vars[_local2][2])) && ((_root.nmes.pc._y - vars[0][2]) < _root.nmes[vars[_local2][8]]._y)) {
if (((tileset[vars[_local2][0]] == "crab") && ((_root.nmes[vars[_local2][8]]._x + 11) > _root.nmes.pc._x)) && ((_root.nmes[vars[_local2][8]]._x - 4) < (_root.nmes.pc._x + vars[0][3]))) {
death(0);
} else if (((tileset[vars[_local2][0]] == "snail") && ((_root.nmes[vars[_local2][8]]._x + 10) > _root.nmes.pc._x)) && (_root.nmes[vars[_local2][8]]._x < (_root.nmes.pc._x + vars[0][3]))) {
death(0);
} else if (((tileset[vars[_local2][0]] == "porcupine") && ((_root.nmes[vars[_local2][8]]._x + 9) > _root.nmes.pc._x)) && ((_root.nmes[vars[_local2][8]]._x - 2) < (_root.nmes.pc._x + vars[0][3]))) {
death(0);
} else if ((((tileset[vars[_local2][0]] == "armadillo") && (vars[_local2][2] == 4)) && ((_root.nmes[vars[_local2][8]]._x + 9) > _root.nmes.pc._x)) && ((_root.nmes[vars[_local2][8]]._x - 3) < (_root.nmes.pc._x + vars[0][3]))) {
death(0);
} else if (((((tileset[vars[_local2][0]] == "armadillo") && (vars[_local2][2] == 5)) && (vars[_local2][4] == 0)) && ((_root.nmes[vars[_local2][8]]._x + 6) > _root.nmes.pc._x)) && (_root.nmes[vars[_local2][8]]._x < (_root.nmes.pc._x + vars[0][3]))) {
vars[_local2][4] = (((_root.nmes.pc._x + Math.floor(vars[0][3] / 2)) < (_root.nmes[vars[_local2][8]]._x + 3)) ? 8 : -8);
}
} else if ((!_local12) && (_root.nmes.pc._y == (_root.nmes[vars[_local2][8]]._y - vars[_local2][2]))) {
if (((tileset[vars[_local2][0]] == "snail") && (_root.nmes.pc._x < (_root.nmes[vars[_local2][8]]._x + 9))) && ((_root.nmes.pc._x + vars[0][3]) > (_root.nmes[vars[_local2][8]]._x + 3))) {
_local12 = 1;
vars[_local2][9] = 1;
} else if (((tileset[vars[_local2][0]] == "crab") && (_root.nmes.pc._x < (_root.nmes[vars[_local2][8]]._x + 7))) && ((_root.nmes.pc._x + vars[0][3]) > _root.nmes[vars[_local2][8]]._x)) {
if (vars[0][2] == vars[0][0]) {
_root.nmes.pc.gotoAndStop(dir + "jump");
}
vars[0][6] = -(Math.ceil(Math.abs(vars[0][4]) / 2) + 5);
death(_local2);
} else if ((((tileset[vars[_local2][0]] == "armadillo") && (vars[_local2][2] == 4)) && (_root.nmes.pc._x < (_root.nmes[vars[_local2][8]]._x + 6))) && ((_root.nmes.pc._x + vars[0][3]) > _root.nmes[vars[_local2][8]]._x)) {
if (vars[0][2] == vars[0][0]) {
_root.nmes.pc.gotoAndStop(dir + "jump");
}
vars[0][6] = -(Math.ceil(Math.abs(vars[0][4]) / 2) + 5);
_root.nmes.pc._y = _root.nmes.pc._y - 3;
vars[_local2][2] = 5;
vars[_local2][1] = 0;
vars[_local2][4] = 0;
_root.nmes[vars[_local2][8]].gotoAndStop(5);
}
}
_local2++;
}
}
if (_local12) {
if (tileset[_local6] == "breakaway") {
killblock.push(new Array(bx, by + 1, 25));
}
if (tileset[_local7] == "breakaway") {
killblock.push(new Array(dx, by + 1, 25));
}
if (id == 0) {
if (tileset[_local6] == "killbox") {
death(0);
}
if (tileset[_local7] == "killbox") {
death(0);
}
if (tileset[_local6] == "spring") {
spring(bx, by + 1, 15);
}
if (tileset[_local7] == "spring") {
spring(dx, by + 1, 15);
}
if (tileset[_local6] == "goodbox") {
spring(bx, by + 1, 20);
}
if (tileset[_local7] == "goodbox") {
spring(dx, by + 1, 20);
}
if ((tileset[_local6] == "slime") || (tileset[_local7] == "slime")) {
decker = ((vars[0][2] == vars[0][1]) ? 20 : 15);
} else {
decker = 2;
}
if (!warped) {
if ((tileset[_local6] == "portalred") || (tileset[_local7] == "portalred")) {
aportal.start();
var _local5 = bx;
while (tileset[design[_local5][by + 1]] != "portalblue") {
_local5++;
}
warped = 6;
warp(_local5);
} else if ((tileset[_local6] == "portalblue") || (tileset[_local7] == "portalblue")) {
aportal.start();
var _local5 = dx;
while (tileset[design[_local5][by + 1]] != "portalred") {
_local5--;
}
warped = 5;
warp(_local5);
}
} else {
warped = (((_local6 != warped) && (_local7 != warped)) ? 0 : (warped));
}
} else {
if (tileset[_local6] == "spring") {
vars[id][6] = -8;
_root.bg[(("b" + bx) + "") + (by + 1)].gotoAndStop("spring2");
killblock.push(new Array((("b" + bx) + "") + (by + 1), 0, 5));
}
if (tileset[_local7] == "spring") {
vars[id][6] = -8;
_root.bg[(("b" + dx) + "") + (by + 1)].gotoAndStop("spring2");
killblock.push(new Array((("b" + dx) + "") + (by + 1), 0, 5));
}
if (tileset[vars[id][0]] == "snail") {
if ((_local6 == 1) && (vars[id][7])) {
design[bx][by + 1] = 8;
_root.bg[(("b" + bx) + "") + (by + 1)].gotoAndStop("slime");
}
if ((_local7 == 1) && (!vars[id][7])) {
design[dx][by + 1] = 8;
_root.bg[(("b" + dx) + "") + (by + 1)].gotoAndStop("slime");
}
}
}
} else {
warped = 0;
}
} else if (checking == 1) {
var _local6 = design[bx][dy - 1];
var _local7 = design[dx][dy - 1];
_local6 = (((_local6[0] > 11) || (_local6 == 7)) ? 0 : (_local6));
_local7 = (((_local7[0] > 11) || (_local7 == 7)) ? 0 : (_local7));
var _local12 = (((ey == 0) && (_local6 || (_local7))) ? 1 : 0);
if (_local12) {
if (_local6 == 3) {
design[bx][dy - 1] = 1;
_root.bg[(("b" + bx) + "") + (dy - 1)].gotoAndStop(1);
}
if (_local7 == 3) {
design[dx][dy - 1] = 1;
_root.bg[(("b" + dx) + "") + (dy - 1)].gotoAndStop(1);
}
if ((_local6 == 3) || (_local7 == 3)) {
ahiddenbox.start();
}
}
} else if (checking == 2) {
var _local6 = design[bx - 1][by];
var _local7 = design[bx - 1][dy];
var _local10 = design[bx - 1][by - 1];
var _local9 = design[bx - 1][by + 1];
var _local8 = design[bx][by + 1];
var _local11 = design[dx][by + 1];
_local6 = ((((_local6 == 3) || (_local6[0] > 11)) || (_local6 == 7)) ? 0 : (_local6));
_local7 = ((((_local7 == 3) || (_local7[0] > 11)) || (_local7 == 7)) ? 0 : (_local7));
_local10 = ((((_local10 == 3) || (_local10[0] > 11)) || (_local10 == 7)) ? 0 : (_local10));
_local9 = ((((_local9 == 3) || (_local9[0] > 11)) || (_local9 == 7)) ? 0 : (_local9));
_local8 = ((((_local8 == 3) || (_local8[0] > 11)) || (_local8 == 7)) ? 0 : (_local8));
_local11 = ((((_local11 == 3) || (_local11[0] > 11)) || (_local11 == 7)) ? 0 : (_local11));
if (id == 0) {
if (vars[id][2] == vars[id][0]) {
var _local12 = (((cx == 0) && ((_local6 || (_local7)) || (_local10))) ? 1 : 0);
} else {
var _local12 = (((cx == 0) && (_local6 || (_local7))) ? 1 : 0);
}
} else {
var _local12 = (((cx == 0) && (_local6)) ? 1 : 0);
if (((((vars[id][1] == 1) && (!_local12)) && (cx == 0)) && (!_local9)) && (_local8 || (_local11))) {
vars[id][4] = vars[id][4] * -1;
vars[id][7] = (vars[id][7] ? 0 : 1);
turning = 1;
}
if (((tileset[vars[id][0]] == "armadillo") && (vars[id][2] == 5)) && (vars[_local2][4] != 0)) {
var _local2 = 0;
while (_local2 < vars.length) {
if (_local2 == id) {
if ((_local2 + 1) < vars.length) {
_local2++;
} else {
break;
}
}
if ((_local2 != 0) || (!doorknob)) {
if (((((_root.nmes[_local3]._x + 3) > _root.nmes[vars[_local2][8]]._x) && ((_root.nmes[_local3]._x - 1) < (_root.nmes[vars[_local2][8]]._x + vars[_local2][3]))) && (_root.nmes[_local3]._y > (_root.nmes[vars[_local2][8]]._y - vars[_local2][2]))) && ((_root.nmes[_local3]._y - 4) < _root.nmes[vars[_local2][8]]._y)) {
death(_local2);
}
}
_local2++;
}
}
}
} else if (checking == 3) {
var _local6 = design[dx + 1][by];
var _local7 = design[dx + 1][dy];
var _local10 = design[dx + 1][by - 1];
var _local9 = design[dx + 1][by + 1];
var _local8 = design[bx][by + 1];
var _local11 = design[dx][by + 1];
_local6 = ((((_local6 == 3) || (_local6[0] > 11)) || (_local6 == 7)) ? 0 : (_local6));
_local7 = ((((_local7 == 3) || (_local7[0] > 11)) || (_local7 == 7)) ? 0 : (_local7));
_local10 = ((((_local10 == 3) || (_local10[0] > 11)) || (_local10 == 7)) ? 0 : (_local10));
_local9 = ((((_local9 == 3) || (_local9[0] > 11)) || (_local9 == 7)) ? 0 : (_local9));
_local8 = ((((_local8 == 3) || (_local8[0] > 11)) || (_local8 == 7)) ? 0 : (_local8));
_local11 = ((((_local11 == 3) || (_local11[0] > 11)) || (_local11 == 7)) ? 0 : (_local11));
if (id == 0) {
if (vars[id][2] == vars[id][0]) {
var _local12 = (((ex == 9) && ((_local6 || (_local7)) || (_local10))) ? 1 : 0);
} else {
var _local12 = (((ex == 9) && (_local6 || (_local7))) ? 1 : 0);
}
} else {
var _local12 = (((ex == 9) && (_local6)) ? 1 : 0);
if (((((vars[id][1] == 1) && (!_local12)) && (ex == 9)) && (!_local9)) && (_local8 || (_local11))) {
vars[id][4] = vars[id][4] * -1;
vars[id][7] = (vars[id][7] ? 0 : 1);
turning = 1;
}
if (((tileset[vars[id][0]] == "armadillo") && (vars[id][2] == 5)) && (vars[_local2][4] != 0)) {
var _local2 = 0;
while (_local2 < vars.length) {
if (_local2 == id) {
if ((_local2 + 1) < vars.length) {
_local2++;
} else {
break;
}
}
if ((_local2 != 0) || (!doorknob)) {
if (((((_root.nmes[_local3]._x + 7) > _root.nmes[vars[_local2][8]]._x) && ((_root.nmes[_local3]._x + 4) < (_root.nmes[vars[_local2][8]]._x + vars[_local2][3]))) && (_root.nmes[_local3]._y > (_root.nmes[vars[_local2][8]]._y - vars[_local2][2]))) && ((_root.nmes[_local3]._y - 4) < _root.nmes[vars[_local2][8]]._y)) {
death(_local2);
}
}
_local2++;
}
}
}
}
return(_local12);
}
function warp(ex) {
var _local2 = 1;
while (_local2 < vars.length) {
_root.nmes[vars[_local2][8]].removeMovieClip();
vars.splice(_local2, 1);
_local2++;
}
design = rawdesign.copyarray();
blockcheck();
_root.nmes.pc._x = ex * 10;
}
function spring(ex, ey, speed) {
if (vars[0][2] == vars[0][0]) {
_root.nmes.pc.gotoAndStop(dir + "jump");
}
vars[0][6] = -(Math.ceil(Math.abs(vars[0][4]) / 2) + speed);
_root.bg[(("b" + ex) + "") + ey].gotoAndStop("spring2");
killblock.push(new Array((("b" + ex) + "") + ey, 0, 5));
}
function decrease(amount) {
if ((timer % decker) == 0) {
if (vars[0][4] > 0) {
vars[0][4] = vars[0][4] - amount;
vars[0][4] = ((vars[0][4] < 0) ? 0 : (vars[0][4]));
} else if (vars[0][4] < 0) {
vars[0][4] = vars[0][4] + amount;
vars[0][4] = ((vars[0][4] > 0) ? 0 : (vars[0][4]));
}
}
}
function walkin() {
if ((timer % 3) == 0) {
if (walkanim) {
_root.nmes.pc.gotoAndStop(dir + "stand");
walkanim = 0;
} else {
_root.nmes.pc.gotoAndStop(dir + "walk");
walkanim = 1;
}
}
}
function movement(id) {
var _local3 = vars[id][8];
if (id == 0) {
if ((_root.nmes[_local3]._y > ((_root.camera._y + _root.camera._height) + 80)) || (doorknob)) {
return(0);
}
} else if (((forward && (_root.nmes[_local3]._x < (_root.camera._x - 30))) || ((!forward) && (_root.nmes[_local3]._x > ((_root.camera._x + _root.camera._width) + 20)))) || (_root.nmes[_local3]._y > ((_root.camera._y + _root.camera._height) + 20))) {
_root.nmes[_local3].removeMovieClip();
vars.splice(id, 1);
return(0);
}
onground = checktiles(0, id);
if ((id == 0) && (doorknob)) {
return(0);
}
if (vars[id][4] > 0) {
var _local5 = 0;
while (_local5 < vars[id][4]) {
if (checktiles(3, id) || ((_local3 == "pc") && (_root.nmes.pc._x == (_root.camera._x + (_root.camera._width - vars[0][3]))))) {
if (id == 0) {
vars[id][4] = (onground ? 0 : (vars[id][4]));
} else {
vars[id][4] = vars[id][4] * -1;
vars[id][7] = (vars[id][7] ? 0 : 1);
turning = 1;
}
break;
}
_root.nmes[_local3]._x++;
if (vars[id][9]) {
_root.nmes.pc._x++;
vars[id][9] = 0;
}
_local5++;
}
if (id == 0) {
if (forward) {
var _local4 = 0;
while (_local4 < warpzones.length) {
if (_root.nmes.pc._x > warpzones[_local4]) {
warpzone = (warpzone ? 0 : 1);
warpzones.splice(_local4, 1);
}
_local4++;
}
}
} else {
if (((timer % 8) == 0) || (turning)) {
if (tileset[vars[id][0]] == "crab") {
var _local6 = ((_root.nmes[_local3]._currentframe == 1) ? 2 : 1);
} else if (tileset[vars[id][0]] == "porcupine") {
var _local6 = ((_root.nmes[_local3]._currentframe == 1) ? 2 : 1);
} else if (tileset[vars[id][0]] == "snail") {
var _local6 = 1;
} else if ((tileset[vars[id][0]] == "armadillo") && (_root.nmes[_local3]._currentframe < 5)) {
var _local6 = ((_root.nmes[_local3]._currentframe == 1) ? 2 : 1);
}
}
if (((timer % 4) == 0) || (turning)) {
if ((tileset[vars[id][0]] == "armadillo") && (_root.nmes[_local3]._currentframe > 4)) {
var _local6 = (((_root.nmes[_local3]._currentframe + 1) > 8) ? 5 : (_root.nmes[_local3]._currentframe + 1));
if (turning) {
armadillohit.start();
}
}
}
_root.nmes[_local3].gotoAndStop(_local6);
}
} else if (vars[id][4] < 0) {
var _local5 = 0;
while (_local5 < Math.abs(vars[id][4])) {
if (checktiles(2, id) || ((_local3 == "pc") && (_root.nmes.pc._x == _root.camera._x))) {
if (id == 0) {
vars[id][4] = (onground ? 0 : (vars[id][4]));
} else {
vars[id][4] = vars[id][4] * -1;
vars[id][7] = (vars[id][7] ? 0 : 1);
turning = 1;
}
break;
}
_root.nmes[_local3]._x--;
if (vars[id][9]) {
_root.nmes.pc._x = _root.nmes.pc._x - ((_root.nmes.pc._x == _root.camera._x) ? 0 : 1);
vars[id][9] = 0;
}
_local5++;
}
if (id == 0) {
if (!forward) {
var _local4 = 0;
while (_local4 < warpzones.length) {
if (_root.nmes.pc._x < warpzones[_local4]) {
warpzone = (warpzone ? 0 : 1);
warpzones.splice(_local4, 1);
}
_local4++;
}
}
} else {
if (((timer % 8) == 0) || (turning)) {
if (tileset[vars[id][0]] == "crab") {
var _local6 = ((_root.nmes[_local3]._currentframe == 1) ? 2 : 1);
} else if (tileset[vars[id][0]] == "porcupine") {
var _local6 = ((_root.nmes[_local3]._currentframe == 3) ? 4 : 3);
} else if (tileset[vars[id][0]] == "snail") {
var _local6 = 2;
} else if ((tileset[vars[id][0]] == "armadillo") && (_root.nmes[_local3]._currentframe < 5)) {
var _local6 = ((_root.nmes[_local3]._currentframe == 3) ? 4 : 3);
}
}
if (((timer % 4) == 0) || (turning)) {
if ((tileset[vars[id][0]] == "armadillo") && (_root.nmes[_local3]._currentframe > 4)) {
if (turning) {
armadillohit.start();
}
var _local6 = (((_root.nmes[_local3]._currentframe - 1) < 5) ? 8 : (_root.nmes[_local3]._currentframe - 1));
}
}
_root.nmes[_local3].gotoAndStop(_local6);
}
}
if ((!onground) || (vars[id][6] < 0)) {
if (vars[id][6] == 0) {
if (id == 0) {
vars[id][6] = 0.5;
} else {
vars[id][6] = 1;
}
} else if (vars[id][6] == 0.5) {
vars[id][6] = 1;
} else {
ydir = ((vars[id][6] < 0) ? -1 : 1);
var _local5 = 0;
while (_local5 < Math.abs(vars[id][6])) {
if (ydir == -1) {
hitting = checktiles(1, id);
} else {
hitting = checktiles(0, id);
if ((id == 0) && (doorknob)) {
return(0);
}
}
if (hitting) {
vars[id][6] = 0;
break;
}
_root.nmes[_local3]._y = _root.nmes[_local3]._y + ydir;
if ((id == 0) && (warpzone)) {
if (_root.nmes.pc._y < -1) {
_root.nmes.pc._y = _root.camera._height + 20;
vars[id][6] = vars[id][6] - 2;
canfall = 1;
} else if (canfall && (_root.nmes.pc._y < _root.camera._height)) {
canfall = 0;
} else if ((canfall && (ydir == 1)) && ((_root.nmes.pc._y - 20) > _root.camera._height)) {
canfall = 0;
_root.nmes.pc._y = -1;
}
}
_local5++;
}
vars[id][6] = vars[id][6] + ((vars[id][6] < maxfall) ? 1 : 0);
}
}
}
rawdesign = [[0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0, [12, 0, 1], 1], [0, 0, 0, [14, 1, 0], 1, 0, 0, 1], [0, 0, 0, 0, 1, 0, [12, 0, 1], 1], [0, 0, 0, 0, 1, 0, 0, 1], [0, 0, 0, [14, 0, 1], 1, 0, [12, 1, 1], 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 2], [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, 0, 0, 0, [13, 0, 0], 1, 1], [0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, [12, 0, 1], 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, [12, 0, 1], 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, [12, 0, 1], 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, [13, 1, 1], 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, [12, 0, 1], 1, 1], [0, 0, 0, [12, 0, 1], [12, 0, 1], [12, 0, 1], 1, 1], [0, 0, 0, [12, 0, 1], 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, [12, 0, 1], 0, 0, 0, 0], [0, 0, 0, [12, 0, 1], [12, 0, 1], [12, 0, 1], [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [15, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [15, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 0, [12, 0, 1], 1], [0, 0, 0, 0, 0, 7, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 10, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 4, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 5, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 5, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 6, 1, 0, 0, 5], [0, 0, 0, 0, 0, 0, 0, 5], [0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 1, 1, 1, 0, 0, 0], [0, 0, 4, 1, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0, 0, 1], [9, 0, 0, 0, 0, 0, 0, 1], [9, 0, 0, 0, 0, 0, 0, 1], [9, 0, 0, 0, 0, 0, [14, 0, 1], 1], [9, 0, 0, 0, 0, 0, 0, 1], [9, 0, 0, 0, 0, 0, 0, 1], [9, 0, 0, 0, 0, 0, [14, 1, 1], 1], [9, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 0, 0, 0, 0, 1], [5, 1, 1, 0, 8, 1, 1, 1], [0, 0, 5, 0, 8, 0, 0, 6], [0, 0, 1, 0, 8, 0, 0, 1], [0, 0, 1, 0, 8, 0, 0, 0], [0, 0, 1, 0, 8, 1, 0, 0], [0, 0, 1, 0, 0, 8, 1, 1], [0, 0, 1, 0, 0, 0, 0, 8], [0, 0, 1, 0, 0, 0, [15, 1, 0], 1], [0, 0, 1, 0, 0, 0, 0, 1], [6, 5, 1, 1, 0, 0, 0, 1], [0, 0, 1, 11, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 1], [0, 0, 1, 0, 0, 1, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0], [9, 1, 1, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 1, 1, 1, 0, 0], [0, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0, 0, 1], [0, 6, 0, [14, 0, 0], 1, 0, 0, 1], [0, 6, 0, 0, 1, 0, 0, 1], [0, 6, 0, 0, 1, 0, 0, 1], [0, 6, 0, [14, 0, 0], 1, 0, 0, 1], [[13, 0, 0], 6, 0, 0, 1, 0, 0, 1], [6, 1, 1, 1, 1, 0, 0, 1], [0, 1, [12, 1, 0], 1, 0, 0, 0, 1], [[12, 0, 1], 1, 0, 0, [12, 0, 0], 1, 0, 1], [0, 1, 0, 0, 1, 1, [12, 0, 0], 1], [0, 1, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 1, 0,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, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 4, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, [13, 0, 0], 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [1, 0, 0, 0, [12, 0, 0], 1, 0, 0], [1, 0, 0, 0, [12, 0, 0], 1, 1, 1], [1, 0, 0, 0, [12, 0, 0], 1, [12, 0, 0], 1], [1, 0, 0, 0, [12, 0, 0], 1, [12, 0, 0], 1], [1, 0, 0, 0, [12, 0, 0], 1, [12, 0, 0], 1], [1, 0, 0, 0, [12, 0, 0], 4, [12, 0, 0], 1], [1, 0, 0, 0, [12, 0, 0], 1, [12, 0, 0], 1], [1, 0, 0, 0, [12, 0, 0], 1, [12, 0, 0], 1], [1, 0, 0, 0, 0, 0, [12, 0, 0], 1], [1, 0, 0, 0, 0, 0, [12, 0, 0], 1], [1, 0, 0, 0, 0, 0, [12, 0, 0], 1], [0, 0, 0, 0, 0, 0, [12, 0, 0], 1], [0, 0, 0, 0, 0, 11, [12, 0, 0], 1], [0, 0, 0, 0, 0, 0, [12, 0, 0], 0], [0, 0, 0, 0, 0, 0, [12, 0, 0], 0], [0, 0, 0, 0, 0, 0, [12, 0, 0], 0], [1, 0, 0, 0, 0, 0, [12, 0, 0], 1], [0, 0, 0, 0, 0, 0, [12, 0, 0], 1], [0, 0, 0, 11, 0, 0, [12, 0, 0], 1], [0, 0, 0, 1, 0, 0, [12, 0, 0], 1], [0, 0, 0, 1, 0, 0, [12, 0, 0], 1], [0, 0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 0, 0, 1, 1], [0, 0, 0, 1, 1, 0, 1, 1], [0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, 0, 1, 1]];
stop();
dev = 0;
ingame = 1;
_root.boss._x = 8113;
_root.boss._y = 70;
if (dev) {
menuname0 = new ContextMenuItem("right", turnright);
menuname1 = new ContextMenuItem("left", turnleft);
menuname2 = new ContextMenuItem("fall", faller);
menuname3 = new ContextMenuItem("pace", pacer);
menuname4 = new ContextMenuItem("cancel", empty);
contextmenu.customItems.push(menuname4, menuname0, menuname1, menuname2, menuname3);
_root.menu = contextmenu;
vars = [[15, 9, 15, 6, 0, 0, 0, 1, "pc"]];
}
Array.prototype.copyarray = function () {
var _local2 = [];
for (var _local3 in this) {
if (this[_local3] instanceof Array) {
_local2[_local3] = this[_local3].slice();
} else {
_local2[_local3] = this[_local3];
}
}
return(_local2);
};
fourtyseven = 0;
fourtyeight = 0;
fourtynine = 0;
middleclick = 0;
maxwalk = 2;
maxdash = 4;
maxfall = 7;
_root.nmes.pc.gotoAndStop("stand");
levelh = 8;
levelw = 20;
if (dev) {
clicker = new Object();
clicker.onMouseDown = function () {
if (Key.isDown(32)) {
_root.nmes.pc._x = Math.floor(_root._xmouse);
_root.nmes.pc._y = Math.floor(_root._ymouse);
vars[0][6] = 1;
doorknob = 0;
} else if (Key.isDown(16)) {
_root.boss._x = Math.floor(_root._xmouse);
_root.boss._y = Math.floor(_root._ymouse);
} else if (!ingame) {
blockset();
mdown = 1;
blockcheck();
}
};
clicker.onMouseMove = function () {
if (!ingame) {
if (mdown) {
blockset(1);
blockcheck();
} else {
rightstuff();
}
}
};
clicker.onMouseUp = function () {
mdown = 0;
};
prepx = 0;
prepy = 0;
addx = 0;
addy = 0;
clicker.onMouseWheel = function (delta) {
if (!ingame) {
spin = ((delta > 0) ? 1 : -1);
bx = Math.floor(_root._xmouse / 10);
by = Math.floor(_root._ymouse / 10);
var _local2 = 0;
if (typeof(rawdesign[bx][by]) == "number") {
_local2 = rawdesign[bx][by];
} else {
_local2 = rawdesign[bx][by][0];
}
_local2 = _local2 + spin;
if (_local2 > (tileset.length - 1)) {
_local2 = 2;
} else if (_local2 < 2) {
_local2 = tileset.length - 1;
}
if (_local2 > 11) {
rawdesign[bx][by] = new Array();
rawdesign[bx][by][0] = _local2;
prepx = 0;
prepy = 0;
addx = 0;
addy = 0;
rightstuff();
} else {
rawdesign[bx][by] = _local2;
}
blockcheck();
}
};
Mouse.addListener(clicker);
}
k = 0;
tileset = ["none", "default", "breakaway", "invisible", "spring", "portalred", "portalblue", "warp", "slime", "killbox", "goodbox", "diamondshot", "crab", "armadillo", "porcupine", "snail"];
camadd = 0;
blocklist = new Array();
nmez = 0;
warpzone = 0;
dshots = new Array();
warpzones = new Array();
obits = new Array();
doorknob = 0;
intcall = setInterval(mainscript, 32);
timer = 0;
dshots = new Array();
dbullets = new Array();
deez = 1;
forward = 1;
killblock = new Array();
warped = 0;
controls = [65, 83, 38, 40, 39, 37];
var i = 0;
while (i < controls.length) {
tempa = controls[i];
controls[i] = new Array(tempa, 0);
i++;
}
controls[1][1] = 2;
decker = 2;
turning = 0;
canfall = 0;
blockcheck();
Symbol 5 Button (40 B)
on (release) {
this._visible = false;
}
Symbol 14 MovieClip Frame 1 (756 B)
_visible = false;
var checkConnection = function (event) {
if (!event.success) {
_visible = true;
gotoAndStop (3);
}
};
if (com.Newgrounds.NewgroundsAPI.isNewgrounds() || (_root.API_Settings.debug_mode)) {
com.Newgrounds.NewgroundsAPI.addEventListener(com.Newgrounds.NewgroundsAPI.events.MOVIE_CONNECTED, checkConnection);
if ((!com.Newgrounds.NewgroundsAPI.hasUserSession()) && (!_root.API_Settings.debug_mode)) {
_visible = true;
gotoAndStop (2);
}
}
com.Newgrounds.NewgroundsAPI.setMovieVersion(_root.API_Settings.movie_version);
com.Newgrounds.NewgroundsAPI.connectMovie(_root.API_Settings.movie_id, _root.API_Settings.enc_key, _root.API_Settings.debug_mode);
com.Newgrounds.NewgroundsAPI.loadMedals();
stop();
Symbol 29 MovieClip Frame 1 (652 B)
function unlockMedal(m_name) {
clearInterval(pop_delay);
var _local1 = com.Newgrounds.NewgroundsAPI.getMedals();
var _local2 = null;
for (i in _local1) {
if (_local1[i].medal_name == m_name) {
_local2 = _local1[i];
medal_name = _local2.medal_name;
medal_value = _local2.medal_value + "pts";
com.Newgrounds.NewgroundsAPI.unlockMedal(medal_name);
pop_delay = setInterval(endDelay, 3000);
_visible = true;
gotoAndPlay (2);
break;
}
}
}
function endDelay(params) {
gotoAndPlay (10);
clearInterval(pop_delay);
}
var pop_delay;
var medal_name = "?????";
var medal_value = "???";
_visible = false;
Symbol 29 MovieClip Frame 10 (131 B)
var myBitmapData = flash.display.BitmapData.loadBitmap(medal_name + ".gif");
medal_icon.attachBitmap(myBitmapData, 111);
stop();
Symbol 180 MovieClip [__Packages.com.Newgrounds.BaseN] Frame 0 (2.88 KiB) ●
class com.Newgrounds.BaseN
{
var ceiling, hashIndex, bitSize, hashVal, i;
function BaseN (hash) {
ceiling = 100000000000000;
if (hash) {
hashIndex = hash;
} else {
hashIndex = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/";
}
bitSize = hashIndex.length;
hashVal = new Object();
i = 0;
while (i < bitSize) {
hashVal[hashIndex.charAt(i)] = i;
i++;
}
}
function verify(s) {
if (hashVal[s] != undefined) {
return(true);
}
return(false);
}
function encode(n, minchars) {
debug.lastencode = "";
if (typeof(i) != "string") {
n = n.toString();
}
if (n.charAt(0) == "-") {
var _local3 = "-";
n = n.substring(1);
} else {
var _local3 = "";
}
if (String(n).indexOf(".") > -1) {
var _local4 = String(n).split(".", 2);
return(((_local3 + baseNEncoder(_local4[0], minchars)) + ".") + baseNEncoder(_local4[1]));
}
debug.lastencode = debug.lastencode + "\tNo decimal\r";
return(_local3 + baseNEncoder(n, minchars));
}
function decode(s) {
var _local4 = 1;
if (s.charAt(0) == "-") {
_local4 = -1;
s = s.substring(1, s.length);
}
var _local3 = s.indexOf(".");
if (_local3 > -1) {
var _local5 = Math.pow(10, baseNDecoder(s.substring(_local3 + 1, s.length)));
return((baseNDecoder(s.substring(0, _local3)) / _local5) * _local4);
}
return(baseNDecoder(s) * _local4);
}
function baseNEncoder(n, minchars) {
if (!minchars) {
minchars = 1;
}
var _local4 = "";
while (n != 0) {
n = Math.round(n);
var _local3 = n % bitSize;
if (Math.round(_local3) != _local3) {
trace((((((((("BaseN failed on " + n) + "%") + bitSize) + " = ") + _local3) + " ") + int(n)) + " ") + int(bitSize));
}
_local4 = hashIndex.charAt(_local3) + _local4;
debug.lastencode = debug.lastencode + (((((((("\t-> n:" + n) + " % bitSize:") + bitSize) + " = ") + _local3) + ", final char=") + _local4) + newline);
n = n - _local3;
n = n / bitSize;
}
if (minchars) {
while (_local4.length < minchars) {
_local4 = hashIndex.charAt(0) + _local4;
}
}
return(_local4);
}
function baseNDecoder(s) {
var _local2 = 0;
var _local6 = 0;
i = 0;
while (i < s.length) {
var _local3 = s.charAt((s.length - i) - 1);
if (_local3 == hashIndex.charAt(0)) {
var _local5 = 0;
} else {
var _local5 = hashVal[_local3] * Math.pow(bitSize, i);
}
_local2 = _local2 + _local5;
if (_local2 >= ceiling) {
_local6 = _local6 + ((_local2 - (_local2 % ceiling)) / ceiling);
_local2 = _local2 % ceiling;
}
i++;
}
if (_local6 > 0) {
_local2 = "" + _local2;
while (_local2.length < (ceiling.toString().length - 1)) {
_local2 = "0" + _local2;
}
_local2 = ("" + _local6) + _local2;
}
return(_local2);
}
var debug = new Object();
}
Symbol 181 MovieClip [__Packages.com.Newgrounds.NewgroundsAPIError] Frame 0 (1.87 KiB) ●
class com.Newgrounds.NewgroundsAPIError
{
var message, name, alias;
function NewgroundsAPIError (error, msg) {
if (Number(error).toString() == String(error)) {
error = Number(error);
} else if (error_codes[String(error)]) {
error = error_codes[String(error)];
} else {
error = 0;
}
code = error;
message = msg;
name = error_names[error];
alias = aliases[error];
}
static function init_codes() {
var _local2 = new Object();
var _local1 = 0;
while (_local1 < aliases.length) {
_local2[aliases[_local1]] = _local1;
_local1++;
}
return(_local2);
}
static function init_names() {
var _local5 = new Array();
var _local3 = 0;
while (_local3 < aliases.length) {
var _local2 = aliases[_local3].toLowerCase().split("_");
var _local1 = 0;
while (_local1 < _local2.length) {
_local2[_local1] = _local2[_local1].substr(0, 1).toUpperCase() + _local2[_local1].substr(1, _local2[_local1].length);
for (var _local4 in always_caps) {
if (_local2[_local1].toUpperCase() == always_caps[_local4]) {
_local2[_local1] = _local2[_local1].toUpperCase();
}
}
_local1++;
}
_local5[_local3] = _local2.join(" ");
_local3++;
}
return(_local5);
}
function isError() {
return(true);
}
static var aliases = new Array("UNKNOWN_ERROR", "INVALID_API_ID", "MISSING_PARAM", "INVALID_STAT_ID", "INVALID_COMMAND_ID", "FLASH_ADS_NOT_APPROVED", "PERMISSION_DENIED", "IDENTIFICATION_REQUIRED", "INVALID_EMAIL_ADDRESS", "BANNED_USER", "SESSION_EXPIRED", "INVALID_SCORE", "INVALID_MEDAL", "INVALID_FOLDER", "FILE_NOT_FOUND", "SITE_ID_REQUIRED", "UPLOAD_IN_PROGRESS", "USER_CANCELLED", "CONFIRM_REQUEST", "CONNECTION_FAILED");
static var always_caps = new Array("API", "URL", "ID");
static var error_codes = init_codes();
static var error_names = init_names();
var code = 0;
}
Symbol 182 MovieClip [__Packages.com.Newgrounds.NewgroundsAPI] Frame 0 (32.18 KiB) ● ● ● ●
class com.Newgrounds.NewgroundsAPI
{
static var version, user_email, movie_id, debug, session_id, publisher_id, timeout, connected, tracker_id, encryption_key, user_id, user_name, host, error_format, normal_format, link_format, header_format, ad_url, ad_swf_url;
function NewgroundsAPI () {
}
static function setMovieVersion(v) {
if (v) {
version = String(v);
}
}
static function setUserEmail(e) {
user_email = e;
}
static function getOfficialVersionURL() {
var _local1 = (((((GATEWAY_URL + "?tracker_id=") + movie_id) + "&command_id=") + getCommandID("loadOfficalVersion")) + "&seed=") + Math.random();
if (debug) {
_local1 = _local1 + "&debug=1";
}
return(_local1);
}
static function hasUserSession() {
if (session_id && (publisher_id)) {
return(true);
}
if (_root.NewgroundsAPI_PublisherID && (_root.NewgroundsAPI_SessionID)) {
return(true);
}
return(false);
}
static function isNewgrounds() {
return(((publisher_id == 1) || (_root.NewgroundsAPI_PublisherID == 1)) || (getHost().toLowerCase().indexOf("ungrounded.net") > -1));
}
static function hasPublisher() {
return(publisher_id || (_root.NewgroundsAPI_PublisherID));
}
static function hasUserEmail() {
if (user_email) {
return(true);
}
return(false);
}
static function connectionTimeOut() {
clearInterval(timeout);
callListener(events.MOVIE_CONNECTED, false, new com.Newgrounds.NewgroundsAPIError("CONNECTION_FAILED", "Connection to NewgroundsAPI gateway timed out."));
}
static function connectMovie(m_id, encrypt_key, debug_mode) {
if (connected) {
return(undefined);
}
var _local2 = function () {
com.Newgrounds.NewgroundsAPI.connectionTimeOut();
};
timeout = setInterval(_local2, 8000, null);
if (!m_id) {
fatalError("NewgroundsAPI.connectMovie() - missing required movie_id parameter", "connectMovie");
}
movie_id = String(m_id);
tracker_id = Number(movie_id.substring(0, movie_id.indexOf(":")));
encryption_key = encrypt_key;
debug = debug_mode;
if (_root.NewgroundsAPI_PublisherID) {
publisher_id = _root.NewgroundsAPI_PublisherID;
if (_root.NewgroundsAPI_SessionID) {
session_id = _root.NewgroundsAPI_SessionID;
}
} else {
publisher_id = 1;
session_id = null;
user_id = 0;
user_name = "Guest";
}
if (_root.NewgroundsAPI_UserName) {
user_name = _root.NewgroundsAPI_UserName;
}
if (_root.NewgroundsAPI_UserID) {
user_id = _root.NewgroundsAPI_UserID;
}
connected = true;
sendCommand("connectMovie", {host:getHost(), movie_version:version});
}
static function getHost() {
if (!host) {
var _local1 = _url;
if ((_local1.indexOf("http://") > -1) or (_local1.indexOf("https://") > -1)) {
host = _local1.split("/")[2].toLowerCase();
} else {
host = "localhost";
}
}
return(host);
}
static function loadNewgrounds() {
sendCommand("loadNewgrounds", {host:getHost()}, true);
}
static function loadMySite() {
sendCommand("loadMySite", {host:getHost()});
}
static function loadCustomLink(link) {
sendCommand("loadCustomLink", {host:getHost(), link:link}, true);
}
static function logCustomEvent(event) {
sendCommand("logCustomEvent", {host:getHost(), event:event});
}
static function postScore(score, value, get_best) {
if ((!score) or (value == undefined)) {
sendError({command_id:getCommandID("postScore")}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required parameter(s)"));
return(undefined);
}
sendSecureCommand("postScore", {score:score, value:value, get_best:get_best});
}
static function getTodaysScores(score, params) {
getScores(score, "t", params, "getTodaysScores");
}
static function getYesterdaysScores(score, params) {
getScores(score, "y", params, "getYesterdaysScores");
}
static function getThisWeeksScores(score, params) {
getScores(score, "w", params, "getThisWeeksScores");
}
static function getThisMonthsScores(score, params) {
getScores(score, "m", params, "getThisMonthsScores");
}
static function getThisYearsScores(score, params) {
getScores(score, "y", params, "getThisYearsScores");
}
static function getAlltimeScores(score, params) {
getScores(score, "a", params, "getAlltimeScores");
}
static function getScores(score, period, params, command_name) {
if (!score) {
sendError({command_id:getCommandID(command_name)}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required score name"));
return(undefined);
}
if (!params) {
params = new Object();
}
if (!hasUserSession()) {
callListener(events.SCORES_LOADED, false, new com.Newgrounds.NewgroundsAPIError("SITE_ID_REQUIRED", ("Host '" + getHost()) + "' does not have high scores enabled"));
return(undefined);
}
params.publisher_id = publisher_id;
params.period = period;
params.score = score;
if (params.user_id) {
var _local3 = period;
} else {
var _local3 = period + "-u";
}
if (score_page_counts[_local3] == undefined) {
params.request_page_count = true;
}
sendCommand("getScores", params);
}
static function unlockMedal(medal, get_score) {
if (!medal) {
sendError({command_id:getCommandID("unlockMedal")}, new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", "missing required medal name"));
return(undefined);
}
var _local1 = new Object();
_local1.medal = medal;
if (get_score) {
_local1.get_score = get_score;
}
sendSecureCommand("unlockMedal", _local1);
}
static function loadMedals() {
if (medals) {
callListener(events.MEDALS_LOADED, true, {medals:medals});
return(undefined);
}
var _local1 = new Object();
if (hasUserSession()) {
_local1.publisher_id = publisher_id;
_local1.user_id = user_id;
}
sendCommand("getMedals", _local1);
}
static function getMedals() {
return(medals);
}
static function saveLocal(save_id, save_data, size_allocation) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].data[save_id] = encodeData(save_data);
sharedObjects[save_id].flush();
}
static function loadLocal(save_id) {
if (!sharedObjects[save_id]) {
sharedObjects[save_id] = SharedObject.getLocal((("ng_ap_secure_" + movie_id) + "_") + save_id);
}
sharedObjects[save_id].flush();
if (sharedObjects[save_id].data[save_id]) {
return(decodeData(sharedObjects[save_id].data[save_id]));
}
return(null);
}
static function encodeData(data) {
return(compressHex(com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(data), encryption_key)));
}
static function decodeData(base) {
return(com.Newgrounds.JSON.decode(com.Newgrounds.RC4.decrypt(uncompressHex(base), encryption_key)));
}
static function compressHex(hex_value) {
var _local5 = hex_value.length % 6;
var _local4 = "";
var _local1 = 0;
while (_local1 < hex_value.length) {
var _local2 = Number("0x" + hex_value.substr(_local1, 6));
_local4 = _local4 + compressor.encode(_local2, 4);
_local1 = _local1 + 6;
}
return(_local5 + _local4);
}
static function uncompressHex(base_value) {
var _local8 = Number(base_value.charAt(0));
var _local7 = "";
var _local3;
var _local2 = 1;
while (_local2 < base_value.length) {
var _local6 = base_value.substr(_local2, 4);
var _local5 = compressor.decode(_local6);
var _local1 = dec2hex(_local5);
if ((_local2 + 4) < base_value.length) {
_local3 = 6;
} else {
_local3 = _local8;
}
while (_local1.length < _local3) {
_local1 = "0" + _local1;
}
_local7 = _local7 + _local1;
_local2 = _local2 + 4;
}
return(_local7);
}
static function dec2hex(dec) {
var _local4 = "0123456789ABCDEF";
var _local3 = "";
while (dec > 0) {
var _local2 = dec % 16;
_local3 = _local4.charAt(_local2) + _local3;
dec = (dec - _local2) / 16;
}
return(_local3);
}
static function saveFile(folder, filename, contents, thumbnail_source) {
if (!save_file) {
save_file = new com.Newgrounds.NewgroundsAPISaveFile(movie_id, folder, filename);
save_file.setContents(contents);
if (thumbnail_source) {
save_file.setThumbnail(thumbnail_source);
}
save_file.onError = function (msg) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("PERMISSION_DENIED", msg);
com.Newgrounds.NewgroundsAPI.sendError({command_id:com.Newgrounds.NewgroundsAPI.getCommandID("saveFile")}, _local1);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, _local1);
};
save_file.onCancel = function (msg) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("USER_CANCELLED", msg);
com.Newgrounds.NewgroundsAPI.callListener(com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, false, _local1);
};
save_file.submit();
} else {
var _local1 = new com.Newgrounds.NewgroundsAPIError("UPLOAD_IN_PROGRESS", "Please wait for the previous file to finish uploading");
sendError({command_id:getCommandID("saveFile")}, _local1);
callListener(events.FILE_SAVED, false, _local1);
}
}
static function checkFilePrivs(folder, filename) {
if (user_id) {
var _local1 = user_id;
} else {
var _local1 = 0;
}
var _local2 = {folder:folder, filename:filename, user_id:_local1, publisher_id:publisher_id};
sendCommand("checkFilePrivs", _local2);
}
static function finishFileSave(folder, filename, description, share, file, thumbnail) {
var _local2;
_local2 = {folder:folder, filename:filename, description:description, share:share};
var _local1;
_local1 = {file:file, thumbnail:thumbnail};
sendSecureCommand("saveFile", _local2, null, _local1);
}
static function getFiles(folder, options) {
var _local7 = {name:1, date:2, score:3};
var _local2 = {user_only:false, sort_on:"date", page:1, results_per_page:20, sort_descending:true};
var _local6 = new Array();
for (var _local10 in _local7) {
_local6.push(("'" + _local10) + "'");
}
var _local4 = new Array();
for (var _local9 in _local2) {
_local4.push(("'" + _local9) + "'");
}
if (options.sort_descending && (!_local7[options.sort_descending])) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("'" + options.sort_descending) + "' is not a valid sort_on value. Valid values are: ") + _local6.join(", "));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options.sort_descending;
}
var _local8;
if (options) {
for (var _local10 in options) {
if (_local2[_local10] == undefined) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("'" + _local10) + "' is not a valid option. Valid options are: ") + _local4.join(", "));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options[_local10];
} else if (typeof(options[_local10]) != typeof(_local2[_local10])) {
var _local3 = new com.Newgrounds.NewgroundsAPIError("MISSING_PARAM", (("option '" + _local10) + "' should be the following type: ") + typeof(_local2[_local10]));
sendError({command_id:getCommandID("getFiles")}, _local3);
delete options[_local10];
}
}
_local8 = options;
} else {
_local8 = new Object();
}
if (hasUserSession()) {
_local8.publisher_id = publisher_id;
_local8.user_id = user_id;
}
_local8.folder = folder;
sendCommand("getFiles", _local8);
}
static function getConfirmation(command_name, event, msg, target, confirm, cancel) {
var _local1 = new com.Newgrounds.NewgroundsAPIError("CONFIRM_REQUEST", msg);
_local1.confirm = function () {
target[confirm]();
};
_local1.cancel = function () {
target[cancel]();
};
_local1.command = getCommandID(command_name);
callListener(event, false, _local1);
}
static function doBlockHost(event) {
_root.stop();
initTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + getHost()) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + event.data.movie_url;
var _local3 = _local2.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = _local2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = event.data.redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function onNewVersionAvailable(event) {
_root.stop();
initTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + event.data.movie_version) + " is now available at:") + newline;
var _local6 = _local3.length;
_local3 = _local3 + event.data.movie_url;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = _local3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = event.data.redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local6, _local4, link_format);
}
static function initTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function doEvent(e) {
switch (getCommandName(e.command_id)) {
case "connectMovie" :
clearInterval(timeout);
sendMessage("You have successfully connected to the Newgrounds API Gateway");
sendMessage(("Movie identified as \"" + e.movie_name) + "\"");
callListener(events.MOVIE_CONNECTED, e.success, {movie_name:e.movie_name});
var _local4 = false;
if (e.ad_status === -1) {
var _local6 = "This movie was not approved to run Flash Ads.";
sendWarning(_local6);
sendWarning(("visit " + AD_TERMS_URL) + " to view our approval guidelines");
if (!e.ad_url) {
callListener(events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", _local6));
} else {
_local4 = true;
}
} else if (e.ad_status === 0) {
var _local6 = "Flash Ads are currently awaiting approval.";
sendNotice(_local6);
if (!e.ad_url) {
callListener(events.ADS_APPROVED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", _local6));
} else {
_local4 = true;
}
}
if (e.ad_url) {
ad_url = unescape(e.ad_url);
if (!_local4) {
sendMessage("This movie has been approved to run Flash Ads!");
}
callListener(events.ADS_APPROVED, true);
}
if (e.deny_host) {
var _local6 = getHost() + " does not have permission to run this movie!";
sendWarning(_local6);
sendWarning("\tUpdate your API configuration to unblock " + getHost());
callListener(events.HOST_BLOCKED, true, {movie_url:unescape(e.movie_url), redirect_url:getOfficialVersionURL()});
}
if (e.movie_version) {
sendWarning("According to your API Configuration, this version is out of date.");
if (version) {
sendWarning("\tThe this movie is version " + version);
}
sendWarning("\tThe most current version is " + e.movie_version);
callListener(events.NEW_VERSION_AVAILABLE, true, {movie_version:e.movie_version, movie_url:unescape(e.movie_url), redirect_url:getOfficialVersionURL()});
}
if (e.request_portal_url) {
sendCommand("setPortalID", {portal_url:_url});
}
break;
case "logCustomEvent" :
if (e.success) {
sendMessage(("Event '" + e.event) + "' was logged.");
}
callListener(events.EVENT_LOGGED, e.success, {event:e.event});
break;
case "postScore" :
var _local7;
if (e.success) {
var _local3 = "User";
if (user_email) {
_local3 = user_email;
} else if (user_name) {
_local3 = user_name;
}
sendMessage(((((_local3 + " posted ") + e.value) + " to '") + e.score) + "'");
_local7 = {score:e.score, value:e.value, username:_local3};
}
callListener(events.SCORE_POSTED, e.success, _local7);
break;
case "getScores" :
_local7 = new Object();
if (e.user_id) {
var _local5 = e.period;
} else {
var _local5 = e.period + "-u";
}
if (e.total_pages) {
score_page_counts[_local5] = e.total_pages;
}
_local7.user_id = e.user_id;
_local7.current_page = e.current_page;
_local7.total_pages = score_page_counts[_local5];
_local7.scores = e.scores;
_local7.period = getPeriodName(e.period);
callListener(events.SCORES_LOADED, e.success, _local7);
break;
case "unlockMedal" :
if (medals) {
var _local2 = 0;
while (_local2 < medals.length) {
if (medals[_local2].medal_name === e.medal_name) {
medals[_local2].medal_unlocked = true;
break;
}
_local2++;
}
}
_local7 = {medal_name:e.medal_name, medal_value:e.medal_value, medal_difficulty:e.medal_difficulty};
callListener(events.MEDAL_UNLOCKED, e.success, _local7);
break;
case "getMedals" :
medals = e.medals;
_local7 = {medals:e.medals};
callListener(events.MEDALS_LOADED, e.success, _local7);
break;
case "getFiles" :
break;
case "getSystemFiles" :
break;
case "saveFile" :
save_file = null;
_local7 = {file_id:e.file_id, filename:e.filename, file_url:e.file_url, thumbnail:e.thumbnail, icon:e.icon};
callListener(events.FILE_SAVED, e.success, _local7);
break;
case "checkFilePrivs" :
if (save_file) {
save_file.checkPrivs(e);
} else {
_local7 = {filename:e.filename, folder:e.folder, can_read:e.can_read, can_write:e.can_write};
callListener(events.FILE_PRIVS_LOADED, e.success, _local7);
}
}
}
static function setDefaultListeners() {
var _local1 = new Array();
_local1[events.HOST_BLOCKED] = {listener:doBlockHost};
_local1[events.NEW_VERSION_AVAILABLE] = {listener:onNewVersionAvailable};
return(_local1);
}
static function addEventListener(event, listener, params) {
listeners[event] = {listener:listener, params:params};
}
static function removeEventListener(event) {
delete listeners[event];
}
static function getEventName(event) {
for (var _local2 in events) {
if (events[_local2] == event) {
return(_local2);
}
}
return(undefined);
}
static function callListener(event, success, data, target) {
echo("Fired Event: " + getEventName(event));
if (listeners[event]) {
if (data.isError()) {
listeners[event].listener({event:event, success:success, error:data, target:target}, listeners[event].params);
} else {
listeners[event].listener({event:event, success:success, data:data, target:target}, listeners[event].params);
}
}
}
static function getCommandName(id) {
return(id);
}
static function getCommandID(name) {
return(name);
}
static function getPeriodAliases() {
var _local1 = new Object();
for (var _local2 in period_aliases) {
_local1[period_aliases[_local2].alias] = _local2;
}
return(_local1);
}
static function getPeriodName(p) {
for (var _local2 in period_aliases) {
if (_local2 == p) {
return(period_aliases[_local2].name);
}
}
return(null);
}
static function getPeriodAlias(p) {
for (var _local2 in period_aliases) {
if (_local2 == p) {
return(period_aliases[_local2].alias);
}
}
return(null);
}
static function sendError(c, e) {
trace((((((("[NewgroundsAPI ERROR] :: " + getCommandName(c.command_id)) + "() - ") + e.name) + ":") + newline) + "\t\t\t\t") + e.message);
}
static function sendWarning(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI WARNING] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
trace("[NewgroundsAPI WARNING] :: " + m);
}
static function sendNotice(m, c) {
if (c) {
m = m + ((("\r[NewgroundsAPI NOTICE] :: \tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
trace("[NewgroundsAPI NOTICE] :: " + m);
}
static function fatalError(m, c) {
if (c) {
m = m + ((("\r\tSee " + COMMANDS_WIKI_URL) + c.toLowerCase()) + " for additional information.");
}
throw (((("***ERROR*** frame=" + _root._currentframe) + ", class=NewgroundsAPI") + newline) + newline) + m;
}
static function sendSecureCommand(command, secure_params, unsecure_params, files) {
if (((!debug) && (!hasUserSession())) && (!hasUserEmail())) {
sendError({command_id:getCommandID(command)}, new com.Newgrounds.NewgroundsAPIError("IDENTIFICATION_REQUIRED", ("You must be logged in or provide an e-mail address ( using NewgroundsAPI.setUserEmail(\"name@domain.com\"); ) to use " + command) + "()."));
return(undefined);
}
if (!command) {
fatalError("Missing command", "sendSecureCommand");
}
if (!secure_params) {
fatalError("Missing secure_params", "sendSecureCommand");
}
if (!unsecure_params) {
unsecure_params = new Object();
}
var _local2 = "";
var _local1 = 0;
while (_local1 < 16) {
_local2 = _local2 + compression_radix.charAt(Math.floor(Math.random() * compression_radix.length));
_local1++;
}
if (debug) {
secure_params.session_id = "";
} else {
secure_params.session_id = session_id;
}
secure_params.as_version = 2;
secure_params.user_email = user_email;
secure_params.publisher_id = publisher_id;
secure_params.seed = _local2;
secure_params.command_id = getCommandID(command);
var _local8 = com.Newgrounds.MD5.calculate(_local2);
var _local6 = com.Newgrounds.RC4.encrypt(com.Newgrounds.JSON.encode(secure_params), encryption_key);
var _local7 = _local8 + _local6;
unsecure_params.secure = compressHex(_local7);
sendCommand("securePacket", unsecure_params, false, files);
}
static function sendCommand(command, params, open_browser, files) {
if ((!connected) and (command != "connectMovie")) {
var _local11 = (("NewgroundsAPI." + command) + "() - NewgroundsAPI.connectMovie() must be called before this command can be called") + newline;
fatalError(_local11, "connectMovie");
}
if (open_browser) {
var _local1 = new Object();
} else {
var _local1 = new LoadVars();
}
_local1.command_id = getCommandID(command);
_local1.tracker_id = movie_id;
if (debug) {
_local1.debug = debug;
}
if (params) {
for (var _local8 in params) {
_local1[_local8] = params[_local8];
}
}
if (files) {
for (var _local8 in files) {
_local1[_local8] = files[_local8];
}
}
echo(("OUTPUT: \r" + com.Newgrounds.JSON.encode(_local1)) + newline);
if (open_browser) {
var _local5 = (GATEWAY_URL + "?seed=") + Math.random();
for (var _local8 in _local1) {
_local5 = _local5 + ((("&" + escape(_local8)) + "=") + escape(_local1[_local8]));
}
getURL (_local5, "_blank");
_local1.removeMovieClip();
} else {
var _local9 = new LoadVars();
_local9.onData = function (data) {
com.Newgrounds.NewgroundsAPI.echo(("INPUT: \r" + data) + newline);
if (data) {
var _local1 = com.Newgrounds.JSON.decode(data);
} else {
var _local1 = {success:false};
}
if (!_local1.success) {
var _local3 = new com.Newgrounds.NewgroundsAPIError(_local1.error_code, _local1.error_msg);
com.Newgrounds.NewgroundsAPI.sendError(_local1, _local3);
} else {
com.Newgrounds.NewgroundsAPI.doEvent(_local1);
}
};
var _local4 = new Array();
for (var _local7 in _local1) {
_local4.push((_local7 + "=") + escape(_local1[_local7]));
}
echo((("POST " + GATEWAY_URL) + "?") + _local4.join("&"));
_local1.sendAndLoad((GATEWAY_URL + "?seed=") + Math.random(), _local9, "POST");
}
}
static function renderAd(target) {
if (ad_swf_url) {
target.background = target.createEmptyMovieClip("background", 100);
target.background.beginFill(0);
target.background.moveTo(0, 0);
target.background.lineTo(300, 0);
target.background.lineTo(300, 250);
target.background.lineTo(0, 250);
target.background.lineTo(0, 0);
target.background.endFill();
target.mask = target.createEmptyMovieClip("mask", 101);
target.mask.beginFill(0);
target.mask.moveTo(0, 0);
target.mask.lineTo(300, 0);
target.mask.lineTo(300, 250);
target.mask.lineTo(0, 250);
target.mask.lineTo(0, 0);
target.mask.endFill();
target.clip = target.createEmptyMovieClip("clip", 102);
target.clip.ad = target.clip.createEmptyMovieClip("ad", 100);
target.clip.setMask(target.mask);
loadMovie (ad_swf_url, target.clip.ad);
callListener(events.AD_ATTACHED, true, null, target);
} else {
callListener(events.AD_ATTACHED, false, new com.Newgrounds.NewgroundsAPIError("FLASH_ADS_NOT_APPROVED", "Unable to render ad"));
}
}
static function attachFlashAd(target) {
System.security.allowDomain("http://server.cpmstar.com");
System.security.allowDomain("http://www.cpmstar.com");
System.security.allowDomain("https://server.cpmstar.com");
System.security.allowDomain("https://www.cpmstar.com");
System.security.allowInsecureDomain("http://server.cpmstar.com");
System.security.allowInsecureDomain("http://www.cpmstar.com");
System.security.allowInsecureDomain("https://server.cpmstar.com");
System.security.allowInsecureDomain("https://www.cpmstar.com");
sendMessage("You may get a security sandbox violation from this ad. This is nothing to worry about!");
if (resetAdTimer()) {
if (ad_url) {
var _local1 = new LoadVars();
_local1.onData = function (data) {
if (data) {
com.Newgrounds.NewgroundsAPI.ad_swf_url = data;
} else {
com.Newgrounds.NewgroundsAPI.ad_swf_url = null;
}
com.Newgrounds.NewgroundsAPI.renderAd(target);
};
if (ad_url.indexOf("?") > -1) {
_local1.load((ad_url + "&random=") + Math.random());
} else {
_local1.load((ad_url + "?random=") + Math.random());
}
}
} else {
renderAd(target);
}
}
static function resetAdTimer() {
if (!ad_url) {
return(false);
}
var _local1 = new Date();
if (_local1.getTime() >= ad_reset) {
ad_reset = _local1.getTime() + 300000;
return(true);
}
return(false);
}
static function sendMessage(m, r) {
var _local1 = "[NewgroundsAPI] :: " + m;
if (r) {
return(_local1);
}
trace(_local1);
}
static function echo(m) {
if (do_echo) {
trace(m);
}
}
static var do_echo = false;
static var GATEWAY_URL = "http://www.ngads.com/gateway_v2.php";
static var AD_TERMS_URL = "http://www.newgrounds.com/wiki/flashads/terms/";
static var COMMANDS_WIKI_URL = "http://www.newgrounds.com/wiki/flashapi/commands/";
static var ad_reset = 0;
static var save_file = null;
static var medals = null;
static var score_page_counts = new Object();
static var compression_radix = "/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X";
static var compressor = new com.Newgrounds.BaseN(compression_radix);
static var errors = com.Newgrounds.NewgroundsAPIError.init_codes();
static var sharedObjects = new Object();
static var events = {MOVIE_CONNECTED:1, ADS_APPROVED:2, AD_ATTACHED:3, HOST_BLOCKED:4, NEW_VERSION_AVAILABLE:5, EVENT_LOGGED:6, SCORE_POSTED:7, SCORES_LOADED:8, MEDAL_UNLOCKED:9, MEDALS_LOADED:10, FILE_PRIVS_LOADED:11, FILE_SAVED:12};
static var listeners = setDefaultListeners();
static var periods = getPeriodAliases();
static var period_aliases = {t:{name:"Today", alias:"TODAY"}, p:{name:"Yesterday", alias:"YESTERDAY"}, w:{name:"This Week", alias:"THIS_WEEK"}, m:{name:"This Month", alias:"THIS_MONTH"}, y:{name:"This Year", alias:"THIS_YEAR"}, a:{name:"All-Time", alias:"ALL_TIME"}};
}
Symbol 183 MovieClip [__Packages.com.Newgrounds.NewgroundsAPISaveFile] Frame 0 (2.09 KiB) ●
class com.Newgrounds.NewgroundsAPISaveFile
{
var tracker_id, folder, filename, contents, thumbnail, icon_url, thumbnail_url, description, scan, scanner;
function NewgroundsAPISaveFile (tracker_id, folder, filename) {
this.tracker_id = tracker_id;
this.folder = folder;
this.filename = filename;
contents = null;
thumbnail = null;
icon_url = null;
thumbnail_url = null;
}
function setDescription(description) {
this.description = description;
}
function setShared(share) {
this.share = share;
}
function setContents(contents) {
this.contents = contents;
}
function setThumbnail(thumb) {
if (thumb) {
thumbnail = thumb;
} else {
thumbnail = null;
}
}
function onError(msg) {
trace("[NewgroundsAPISaveFile ERROR] :: " + msg);
}
function onCancel(msg) {
trace("[NewgroundsAPISaveFile] :: " + msg);
}
function submit() {
scan = null;
com.Newgrounds.NewgroundsAPI.checkFilePrivs(folder, filename);
}
function checkPrivs(p) {
if (p.success) {
if (p.can_write) {
can_write = p.can_write;
if (p.exists) {
com.Newgrounds.NewgroundsAPI.getConfirmation("saveFile", com.Newgrounds.NewgroundsAPI.events.FILE_SAVED, ("File '" + filename) + "' exists, overwrite?", this, "startFile", "cancelFile");
} else {
startFile();
}
} else {
onError("This filename is owned by another user.");
}
} else {
onError("There was a problem looking up your file's details");
}
}
function cancelFile() {
onCancel("Overwrite was cancelled");
}
function startFile() {
if (can_write) {
if (thumbnail) {
scanner = new com.Newgrounds.ImageScanner(thumbnail);
scanner.setCallback(this, "writeFile");
scanner.startScan(100, 100, true);
} else {
writeFile();
}
} else {
onError(("You cannot write to filename \"" + filename) + "\"");
}
}
function writeFile(img) {
trace("FINISHED");
com.Newgrounds.NewgroundsAPI.finishFileSave(folder, filename, description, share, com.Newgrounds.JSON.encode(contents), img);
}
var can_write = false;
var share = true;
}
Symbol 184 MovieClip [__Packages.com.Newgrounds.ImageScanner] Frame 0 (6.3 KiB) ● ●
class com.Newgrounds.ImageScanner
{
var image_source, source_width, source_height, sourceBitmap, callback_target, callback_function, hash, cube, basen, xpos, ypos, pixels, busy, canvas_width, canvas_height, resizedBitmap, copyBitmap, output, draw_interval, callback_interval;
function ImageScanner (the_source) {
if (the_source) {
image_source = the_source;
} else {
image_source = _root;
}
reset();
if (typeof(image_source) == "movieclip") {
if (image_source == _root) {
source_width = Stage.width;
source_height = Stage.height;
} else {
source_width = Math.floor(image_source._width);
source_height = Math.floor(image_source._height);
}
sourceBitmap = new flash.display.BitmapData(source_width, source_height, false, 4294967295);
sourceBitmap.draw(_root);
} else if (image_source.width) {
source_width = image_source.width;
source_height = image_source.height;
sourceBitmap = image_source;
} else {
error("You can only use BitMaptData and MovieClip objects to create images");
}
}
function setCallback(target, funct) {
if (target && (funct)) {
callback_target = target;
callback_function = funct;
}
}
function reset() {
callback_target = null;
callback_function = null;
debug.bad_pixels = 0;
hash = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&";
var _local3 = Math.pow(hash.length, 2);
trace("MAX COLORS: " + _local3);
var _local2 = Math.floor(Math.pow(_local3, 0.333333333333333)) - 1;
var _local4 = Math.pow(_local2, 3);
cube = _local2;
basen = new com.Newgrounds.BaseN(hash);
xpos = 0;
ypos = 0;
pixels = 0;
busy = false;
}
function startScan(w, h, s) {
if (w) {
image_width = w;
}
if (h) {
image_height = h;
}
if (s != undefined) {
crop = s;
}
var _local7 = _root.getNextHighestDepth();
var _local6 = _root.createEmptyMovieClip("API_image_container_" + _local7, _local7);
var _local5 = _local6.createEmptyMovieClip("canvas", 100);
_local5.attachBitmap(sourceBitmap, 100);
if (crop) {
if ((image_width / source_width) > (image_height / source_height)) {
canvas_width = image_width;
canvas_height = Math.ceil(source_height * (image_width / source_width));
} else {
canvas_height = image_height;
canvas_width = Math.ceil(source_width * (image_height / source_height));
}
} else {
canvas_width = image_width;
canvas_height = image_height;
}
_local5._x = Math.round((image_width - canvas_width) / 2);
_local5._width = canvas_width;
_local5._height = canvas_height;
resizedBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
resizedBitmap.draw(_local6);
_local6.removeMovieClip();
copyBitmap = new flash.display.BitmapData(image_width, image_height, false, 4294967295);
var _local3 = "" + image_width;
while (_local3.length < 3) {
_local3 = "0" + _local3;
}
var _local4 = "" + image_height;
while (_local4.length < 3) {
_local4 = "0" + _local4;
}
output = _local3 + _local4;
draw_interval = setInterval(this, "drawChunk", 10);
busy = false;
return(resizedBitmap);
}
function getBitmapData() {
return(copyBitmap);
}
function getBytesTotal() {
return((image_width * image_height) * 2);
}
function getBytesScanned() {
return(pixels * 2);
}
function drawChunk() {
if (!busy) {
busy = true;
var _local2 = 0;
while (_local2 < 250) {
if (!nextPixel()) {
clearInterval(draw_interval);
callback_interval = setInterval(this, "doCallback", 25);
busy = true;
break;
}
_local2++;
}
busy = false;
}
}
function doCallback() {
busy = false;
clearInterval(callback_interval);
if (callback_target and callback_function) {
callback_target[callback_function](output);
} else {
onScanComplete(output);
}
}
function onScanComplete(packet) {
sendMessage(("packet size: " + output.length) + " bytes", "onScanComplete");
}
function nextPixel() {
var _local15 = xpos;
var _local14 = ypos;
var _local7 = resizedBitmap.getPixel(_local15, _local14);
var _local17 = (_local7 >> 16) & 255;
var _local20 = (_local7 >> 8) & 255;
var _local16 = (_local7 >> 0) & 255;
var _local11 = Math.round(((_local17 + 1) / 256) * cube);
var _local10 = Math.round(((_local20 + 1) / 256) * cube);
var _local13 = Math.round(((_local16 + 1) / 256) * cube);
var _local12 = (((_local11 * (cube + 1)) * (cube + 1)) + (_local10 * (cube + 1))) + _local13;
var _local6 = basen.encode(_local12, 2);
output = output + _local6;
if (_local6.length != 2) {
trace("bad pixel " + _local6);
}
var _local5 = basen.decode(_local6);
var _local18 = _local5;
var _local8 = _local5 % (cube + 1);
_local5 = (_local5 - _local8) / (cube + 1);
var _local9 = _local5 % (cube + 1);
var _local19 = (_local5 - _local9) / (cube + 1);
if (((_local13 != _local8) and (_local10 != _local9)) and (_local11 != _local10)) {
debug.bad_pixels++;
trace((((((("BAD PIXEL " + debug.bad_pixels) + ") ") + _local12) + " != ") + _local18) + " ") + _local6);
trace(basen.debug.lastencode);
}
var _local2 = Math.round((_local19 / cube) * 255).toString(16);
var _local4 = Math.round((_local9 / cube) * 255).toString(16);
var _local3 = Math.round((_local8 / cube) * 255).toString(16);
while (_local2.length < 2) {
_local2 = "0" + _local2;
}
while (_local4.length < 2) {
_local4 = "0" + _local4;
}
while (_local3.length < 2) {
_local3 = "0" + _local3;
}
copyBitmap.setPixel(_local15, _local14, Number((("0x" + _local2) + _local4) + _local3));
pixels++;
if (pixels >= (image_width * image_height)) {
return(false);
}
xpos++;
if (xpos >= image_width) {
xpos = 0;
ypos++;
}
return(true);
}
function error(e, f) {
sendMessage(e, f, "ERROR");
}
function sendMessage(msg, func, type) {
var _local1 = "ImageScanner";
if (func) {
_local1 = _local1 + (("." + func) + "()");
}
if (type) {
_local1 = (type + " in ") + _local1;
}
_local1 = _local1 + (" :: " + msg);
trace(_local1);
}
var image_width = 100;
var image_height = 100;
var crop = true;
var debug = new Object();
}
Symbol 185 MovieClip [__Packages.com.Newgrounds.JSON] Frame 0 (7.05 KiB) ● ●
class com.Newgrounds.JSON
{
function JSON () {
}
static function encode(arg, noquotes) {
var _local3;
var _local2;
var _local6;
var _local1 = "";
var _local4;
if (arg.isSServerVar()) {
var _local8 = "sservervariable";
} else {
var _local8 = typeof(arg);
}
switch (_local8) {
case "sservervariable" :
return("?" + arg.getEncodedValue());
case "object" :
if (arg) {
if (arg instanceof Array) {
_local2 = 0;
while (_local2 < arg.length) {
_local4 = encode(arg[_local2]);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + _local4;
_local2++;
}
return(("[" + _local1) + "]");
}
if (typeof(arg.toString) != "undefined") {
for (_local2 in arg) {
_local4 = arg[_local2];
if ((typeof(_local4) != "undefined") && (typeof(_local4) != "function")) {
_local4 = encode(_local4);
if (_local1) {
_local1 = _local1 + ",";
}
_local1 = _local1 + ((encode(_local2) + ":") + _local4);
}
}
return(("{" + _local1) + "}");
}
}
return("null");
case "number" :
return((isFinite(arg) ? (String(arg)) : "null"));
case "string" :
_local6 = arg.length;
if (noquotes) {
var _local7 = "";
} else {
var _local7 = "\"";
}
_local1 = _local7;
_local2 = 0;
while (_local2 < _local6) {
_local3 = arg.charAt(_local2);
if (_local3 >= " ") {
if ((_local3 == "\\\\") || (_local3 == "\"")) {
_local1 = _local1 + "\\\\";
}
_local1 = _local1 + _local3;
} else {
switch (_local3) {
case "\\b" :
_local1 = _local1 + "\\\\b";
break;
case "\\f" :
_local1 = _local1 + "\\\\f";
break;
case "\\n" :
_local1 = _local1 + "\\\\n";
break;
case "\\r" :
_local1 = _local1 + "\\\\r";
break;
case "\\t" :
_local1 = _local1 + "\\\\t";
break;
default :
_local3 = _local3.charCodeAt();
_local1 = _local1 + (("\\\\u00" + Math.floor(_local3 / 16).toString(16)) + (_local3 % 16).toString(16));
}
}
_local2 = _local2 + 1;
}
return(_local1 + _local7);
case "boolean" :
return(String(arg));
}
return("null");
}
static function decode(text) {
var at = 0;
var ch = " ";
var _value;
var _error = function (m) {
throw {name:"JSONError", message:m, at:at - 1, text:text};
};
var _next = function () {
ch = text.charAt(at);
at = at + 1;
return(ch);
};
var _white = function () {
while (ch) {
if (ch <= " ") {
_next();
} else if (ch == "/") {
switch (_next()) {
case "/" :
while ((_next() && (ch != "\\n")) && (ch != "\\r")) {
}
break;
case "*" :
_next();
for(;;){
if (ch) {
if (ch == "*") {
if (_next() == "/") {
_next();
// unexpected jump
}
} else {
_next();
}
} else {
_error("Unterminated comment");
}
};
break;
default :
_error("Syntax error");
}
} else {
return;
}
}
};
var _string = function () {
var _local4;
var _local1 = "";
var _local3;
var _local2;
var _local5 = false;
if (ch == "\"") {
while (_next()) {
if (ch == "\"") {
_next();
return(_local1);
}
if (ch == "\\\\") {
switch (_next()) {
case "b" :
_local1 = _local1 + "\\b";
break;
case "f" :
_local1 = _local1 + "\\f";
break;
case "n" :
_local1 = _local1 + "\\n";
break;
case "r" :
_local1 = _local1 + "\\r";
break;
case "t" :
_local1 = _local1 + "\\t";
break;
case "u" :
_local2 = 0;
_local4 = 0;
while (_local4 < 4) {
_local3 = parseInt(_next(), 16);
if (!isFinite(_local3)) {
_local5 = true;
break;
}
_local2 = (_local2 * 16) + _local3;
_local4 = _local4 + 1;
}
if (_local5) {
_local5 = false;
break;
}
_local1 = _local1 + String.fromCharCode(_local2);
break;
default :
_local1 = _local1 + ch;
}
} else {
_local1 = _local1 + ch;
}
}
}
_error("Bad string");
};
var _array = function () {
var _local1 = [];
if (ch == "[") {
_next();
_white();
if (ch == "]") {
_next();
return(_local1);
}
while (ch) {
_local1.push(_value());
_white();
if (ch == "]") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad array");
};
var _object = function () {
var _local2;
var _local1 = {};
if (ch == "{") {
_next();
_white();
if (ch == "}") {
_next();
return(_local1);
}
while (ch) {
_local2 = _string();
_white();
if (ch != ":") {
break;
}
_next();
_local1[_local2] = _value();
_white();
if (ch == "}") {
_next();
return(_local1);
}
if (ch != ",") {
break;
}
_next();
_white();
}
}
_error("Bad object");
};
var _number = function () {
var _local1 = "";
var _local2;
if (ch == "-") {
_local1 = "-";
_next();
}
while ((ch >= "0") && (ch <= "9")) {
_local1 = _local1 + ch;
_next();
}
if (ch == ".") {
_local1 = _local1 + ".";
while ((_next() && (ch >= "0")) && (ch <= "9")) {
_local1 = _local1 + ch;
}
}
_local2 = 1 * _local1;
if (!isFinite(_local2)) {
_error("Bad number");
} else {
return(_local2);
}
};
var _word = function () {
switch (ch) {
case "t" :
if (((_next() == "r") && (_next() == "u")) && (_next() == "e")) {
_next();
return(true);
}
break;
case "f" :
if ((((_next() == "a") && (_next() == "l")) && (_next() == "s")) && (_next() == "e")) {
_next();
return(false);
}
break;
case "n" :
if (!(((_next() == "u") && (_next() == "l")) && (_next() == "l"))) {
break;
}
_next();
return(null);
}
_error("Syntax error");
};
_value = function () {
_white();
switch (ch) {
case "{" :
return(_object());
case "[" :
return(_array());
case "\"" :
return(_string());
case "-" :
return(_number());
}
return((((ch >= "0") && (ch <= "9")) ? (_number()) : (_word())));
};
return(_value());
}
}
Symbol 186 MovieClip [__Packages.com.Newgrounds.RC4] Frame 0 (2.81 KiB) ●
class com.Newgrounds.RC4
{
function RC4 () {
}
static function encrypt(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToHex(_local2));
}
static function encryptbin(src, key) {
var _local3 = strToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(_local2);
}
static function decrypt(src, key) {
var _local3 = hexToChars(src);
var _local1 = strToChars(key);
var _local2 = calculate(_local3, _local1);
return(charsToStr(_local2));
}
static function initialize(pwd) {
var _local2 = 0;
var _local3;
var _local4 = pwd.length;
var _local1 = 0;
while (_local1 <= 255) {
mykey[_local1] = pwd[_local1 % _local4];
sbox[_local1] = _local1;
_local1++;
}
_local1 = 0;
while (_local1 <= 255) {
_local2 = ((_local2 + sbox[_local1]) + mykey[_local1]) % 256;
_local3 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local3;
_local1++;
}
}
static function calculate(plaintxt, psw) {
initialize(psw);
var _local1 = 0;
var _local2 = 0;
var _local9 = new Array();
var _local7;
var _local5;
var _local6;
var _local3 = 0;
while (_local3 < plaintxt.length) {
_local1 = (_local1 + 1) % 256;
_local2 = (_local2 + sbox[_local1]) % 256;
_local5 = sbox[_local1];
sbox[_local1] = sbox[_local2];
sbox[_local2] = _local5;
var _local4 = (sbox[_local1] + sbox[_local2]) % 256;
_local7 = sbox[_local4];
_local6 = plaintxt[_local3] ^ _local7;
_local9.push(_local6);
_local3++;
}
return(_local9);
}
static function charsToHex(chars) {
var _local4 = new String("");
var _local3 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
var _local1 = 0;
while (_local1 < chars.length) {
_local4 = _local4 + (_local3[chars[_local1] >> 4] + _local3[chars[_local1] & 15]);
_local1++;
}
return(_local4);
}
static function hexToChars(hex) {
var _local3 = new Array();
var _local1 = ((hex.substr(0, 2) == "0x") ? 2 : 0);
while (_local1 < hex.length) {
_local3.push(parseInt(hex.substr(_local1, 2), 16));
_local1 = _local1 + 2;
}
return(_local3);
}
static function charsToStr(chars) {
var _local3 = new String("");
var _local1 = 0;
while (_local1 < chars.length) {
_local3 = _local3 + String.fromCharCode(chars[_local1]);
_local1++;
}
return(_local3);
}
static function strToChars(str) {
var _local3 = new Array();
var _local1 = 0;
while (_local1 < str.length) {
_local3.push(str.charCodeAt(_local1));
_local1++;
}
return(_local3);
}
static var sbox = new Array(255);
static var mykey = new Array(255);
}
Symbol 187 MovieClip [__Packages.com.Newgrounds.MD5] Frame 0 (8.2 KiB) ● ●
class com.Newgrounds.MD5
{
function MD5 () {
}
static function calculate(src) {
return(hex_md5(src));
}
static function hex_md5(src) {
return(binl2hex(core_md5(str2binl(src), src.length * 8)));
}
static function core_md5(x, len) {
x[len >> 5] = x[len >> 5] | (128 << (len % 32));
x[(((len + 64) >>> 9) << 4) + 14] = len;
var _local4 = 1732584193 /* 0x67452301 */;
var _local3 = -271733879;
var _local2 = -1732584194;
var _local1 = 271733878 /* 0x10325476 */;
var _local5 = 0;
while (_local5 < x.length) {
var _local10 = _local4;
var _local9 = _local3;
var _local8 = _local2;
var _local7 = _local1;
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 0], 7, -680876936);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 1], 12, -389564586);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 2], 17, 606105819);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 3], 22, -1044525330);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 4], 7, -176418897);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 5], 12, 1200080426);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 6], 17, -1473231341);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 7], 22, -45705983);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 8], 7, 1770035416);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 9], 12, -1958414417);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 10], 17, -42063);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 11], 22, -1990404162);
_local4 = md5_ff(_local4, _local3, _local2, _local1, x[_local5 + 12], 7, 1804603682);
_local1 = md5_ff(_local1, _local4, _local3, _local2, x[_local5 + 13], 12, -40341101);
_local2 = md5_ff(_local2, _local1, _local4, _local3, x[_local5 + 14], 17, -1502002290);
_local3 = md5_ff(_local3, _local2, _local1, _local4, x[_local5 + 15], 22, 1236535329);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 1], 5, -165796510);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 6], 9, -1069501632);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 11], 14, 643717713);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 0], 20, -373897302);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 5], 5, -701558691);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 10], 9, 38016083);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 15], 14, -660478335);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 4], 20, -405537848);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 9], 5, 568446438);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 14], 9, -1019803690);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 3], 14, -187363961);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 8], 20, 1163531501);
_local4 = md5_gg(_local4, _local3, _local2, _local1, x[_local5 + 13], 5, -1444681467);
_local1 = md5_gg(_local1, _local4, _local3, _local2, x[_local5 + 2], 9, -51403784);
_local2 = md5_gg(_local2, _local1, _local4, _local3, x[_local5 + 7], 14, 1735328473);
_local3 = md5_gg(_local3, _local2, _local1, _local4, x[_local5 + 12], 20, -1926607734);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 5], 4, -378558);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 8], 11, -2022574463);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 11], 16, 1839030562);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 14], 23, -35309556);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 1], 4, -1530992060);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 4], 11, 1272893353);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 7], 16, -155497632);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 10], 23, -1094730640);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 13], 4, 681279174);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 0], 11, -358537222);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 3], 16, -722521979);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 6], 23, 76029189);
_local4 = md5_hh(_local4, _local3, _local2, _local1, x[_local5 + 9], 4, -640364487);
_local1 = md5_hh(_local1, _local4, _local3, _local2, x[_local5 + 12], 11, -421815835);
_local2 = md5_hh(_local2, _local1, _local4, _local3, x[_local5 + 15], 16, 530742520);
_local3 = md5_hh(_local3, _local2, _local1, _local4, x[_local5 + 2], 23, -995338651);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 0], 6, -198630844);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 7], 10, 1126891415);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 14], 15, -1416354905);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 5], 21, -57434055);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 12], 6, 1700485571);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 3], 10, -1894986606);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 10], 15, -1051523);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 1], 21, -2054922799);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 8], 6, 1873313359);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 15], 10, -30611744);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 6], 15, -1560198380);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 13], 21, 1309151649);
_local4 = md5_ii(_local4, _local3, _local2, _local1, x[_local5 + 4], 6, -145523070);
_local1 = md5_ii(_local1, _local4, _local3, _local2, x[_local5 + 11], 10, -1120210379);
_local2 = md5_ii(_local2, _local1, _local4, _local3, x[_local5 + 2], 15, 718787259);
_local3 = md5_ii(_local3, _local2, _local1, _local4, x[_local5 + 9], 21, -343485551);
_local4 = safe_add(_local4, _local10);
_local3 = safe_add(_local3, _local9);
_local2 = safe_add(_local2, _local8);
_local1 = safe_add(_local1, _local7);
_local5 = _local5 + 16;
}
return(new Array(_local4, _local3, _local2, _local1));
}
static function md5_cmn(q, a, b, x, s, t) {
return(safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b));
}
static function md5_ff(a, b, c, d, x, s, t) {
return(md5_cmn((b & c) | ((~b) & d), a, b, x, s, t));
}
static function md5_gg(a, b, c, d, x, s, t) {
return(md5_cmn((b & d) | (c & (~d)), a, b, x, s, t));
}
static function md5_hh(a, b, c, d, x, s, t) {
return(md5_cmn((b ^ c) ^ d, a, b, x, s, t));
}
static function md5_ii(a, b, c, d, x, s, t) {
return(md5_cmn(c ^ (b | (~d)), a, b, x, s, t));
}
static function bit_rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
static function safe_add(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
static function str2binl(str) {
var _local3 = new Array();
var _local4 = 255;
var _local1 = 0;
while (_local1 < (str.length * 8)) {
_local3[_local1 >> 5] = _local3[_local1 >> 5] | ((str.charCodeAt(_local1 / 8) & _local4) << (_local1 % 32));
_local1 = _local1 + 8;
}
return(_local3);
}
static function binl2hex(binarray) {
var _local4 = new String("");
var _local3 = new String("0123456789abcdef");
var _local1 = 0;
while (_local1 < (binarray.length * 4)) {
_local4 = _local4 + (_local3.charAt((binarray[_local1 >> 2] >> (((_local1 % 4) * 8) + 4)) & 15) + _local3.charAt((binarray[_local1 >> 2] >> ((_local1 % 4) * 8)) & 15));
_local1++;
}
return(_local4);
}
}
Symbol 188 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 91 MovieClip Frame 1 (8 B)
stop();
Symbol 101 MovieClip Frame 1 (8 B)
stop();
Symbol 135 MovieClip Frame 1 (8 B)
stop();
Instance of Symbol 134 MovieClip in Symbol 135 MovieClip Frame 5 (62 B)
on (press) {
getURL ("http://googumproduce.com", "_blank");
}
Instance of Symbol 134 MovieClip in Symbol 135 MovieClip Frame 5 (59 B)
on (press) {
getURL ("http://jonschubbe.com", "_blank");
}
Symbol 137 MovieClip Frame 1 (8 B)
stop();
Symbol 143 MovieClip Frame 1 (8 B)
stop();
Symbol 149 MovieClip Frame 1 (86 B)
com.Newgrounds.NewgroundsAPI.attachFlashAd(_root.poop);
background._visible = false;
Symbol 179 MovieClip Frame 1 (8 B)
stop();
Symbol 179 MovieClip Frame 169 (134 B)
stop();
if (_root.newgroundin) {
_root.medal_popup._x = _root.camera._x + 14;
_root.medal_popup.unlockMedal("Beetle Battle");
}