Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
function dev() {
getURL ("http://voidsoft.nytka.org", _blank);
}
function sponsor() {
getURL ("http://gimme5games.com", _blank);
}
var rversion = 1.1;
__com_mochibot__("4d4ef60d", this, 10301, true);
__com_mochibot__("f9c448a7", this, 10301, true);
MENU = new ContextMenu();
MENU.customItems.push(devfunc);
MENU.customItems.push(sponsorfunc);
MENU.builtInItems.zoom = false;
MENU.builtInItems.quality = true;
MENU.builtInItems.play = false;
MENU.builtInItems.loop = false;
MENU.builtInItems.rewind = false;
MENU.builtInItems.forward_back = false;
MENU.builtInItems.print = false;
sponsorfunc = new ContextMenuItem("Visit Gimme5Games.com!", sponsor);
devfunc = new ContextMenuItem("Visit the VoidSoft homepage!", dev);
MENU.customItems.push(sponsorfunc);
MENU.customItems.push(devfunc);
_root.menu = MENU;
var gimmefive = false;
var hosts = new Array("www.gimme5games.com", "gimme5games.com", "http://gimme5games.com", "http://www.gimme5games.com", "www.gimmefivegames.com", "gimmefivegames.com", "http://gimmefivegames.com", "http://www.gimmefivegames.com", "www.offthewrist.com", "offthewrist.com", "http://offthewrist.com", "http://www.offthewrist.com");
home = false;
i = 0;
while (i < hosts.length) {
if (_url.substr(0, hosts[i].length).toLowerCase() == hosts[i]) {
home = true;
break;
}
i++;
}
if (home) {
MochiAd.showPreGameAd({id:"3b880bb912f01d98", res:"640x384", background:10338291, color:7902692, outline:15659002, no_bg:true});
} else {
_root.kongregateServices.connect();
MochiAd.showPreGameAd({id:"13fde46a0be7bdb3", res:"640x384", background:10338291, color:7902692, outline:15659002, no_bg:true});
}
Frame 2
stop();
Instance of Symbol 43 MovieClip [Splash] in Frame 2
//component parameters
onClipEvent (construct) {
frameAfterCompletion = 3;
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Frame 3
play();
Frame 4
if (false) {
}
Frame 5
if (false) {
}
Frame 6
if (false) {
}
Frame 7
if (false) {
}
Frame 8
if (false) {
}
Frame 9
if (false) {
}
Frame 10
if (false) {
}
Frame 12
if (false) {
}
Frame 13
stop();
onMouseDown = function () {
if (_ymouse < 300) {
play();
}
};
homepagebutton.onRelease = function () {
getURL ("http://voidsoft.nytka.org", "_blank");
};
Frame 14
if (false) {
}
Frame 17
onEnterFrame = function () {
if (instructionvid._currentframe == 1030) {
instructionvid.stop();
play();
}
};
instructionskip.onRelease = function () {
play();
};
Frame 22
stop();
Frame 23
if (false) {
}
Frame 28
function dist(a, b, c, d) {
xd = a - c;
yd = b - d;
return(Math.sqrt((xd * xd) + (yd * yd)));
}
function createNode(x, y, xv, yv, r, b, f, s) {
nodes.push(new Node(x, y, xv, yv, attachMovie("node", "Node:" + nodeid, _root.getNextHighestDepth(), {_width:r * 2, _height:r * 2}), b, f, r, s));
nodeid++;
return(nodes[nodes.length - 1]);
}
function constrainNodes(a, b, len, tolerance) {
return(constraints.push(new Constraint(a, b, len, tolerance)));
}
function updatesparkdoll() {
cline.clear();
i = 0;
while (i < nodes.length) {
nodes[i].update(worldspeed);
n = nodes[i];
if ((n.y + n.r) > 585) {
n.y = 585 - n.r;
n.yv = -Math.abs(n.yv * n.bounce);
n.xv = n.xv * n.friction;
}
i++;
}
i = 0;
while (i < constraints.length) {
constraints[i].update();
i++;
}
}
function dist(a, b, c, d) {
xd = a - c;
yd = b - d;
return(Math.sqrt((xd * xd) + (yd * yd)));
}
function makeparticle(x, y, col, speed, dir, strength, uniformity, decay) {
vx = Math.cos(dir) * speed;
vy = Math.sin(dir) * speed;
particles.push(new Particle(x, y, vx, vy, col, decay, strength, uniformity));
}
function createParticleSpray(x, y, col, density, speed, dir, spread, strength, uniformity, decay, diru) {
standardspread = spread / density;
if (spread == 360) {
rotaterand = random(50);
}
i = 0;
while (i < density) {
tempdir = (((((standardspread * i) + dir) + random(diru)) - random(diru)) + rotaterand) / 57.2957795130823;
makeparticle(x, y, col, speed, tempdir, strength, uniformity, decay);
i++;
}
}
function updateparticles() {
particlemc.clear();
j = 0;
while (j < particles.length) {
if (particles[j].update() == "dead") {
delete particles[j];
particles.splice(j, 1);
j--;
}
j++;
}
}
function rhittest(r, ax, ay, bx, by) {
dx = ax - bx;
dy = ay - by;
dista = (dx * dx) + (dy * dy);
len = r * r;
if (dista > len) {
return(false);
}
return(true);
}
function addjoint(x, y) {
createParticleSpray(x, y, 255, 8, 10, 0, 360, 10, 0, 0.9, 0);
var _local3 = 450 - y;
if (_local3 > scoreheight) {
pheight = Math.abs(Math.round(_local3 - scoreheight));
score = score + (pheight * scoremultiplier);
ptext = ("+" + pheight.toString()) + "!";
plusmc = attachMovie("scoreup", "scoreup" + (scoreups++), _root.getNextHighestDepth(), {_x:x, _y:y, plus:ptext});
plusmc.onEnterFrame = function () {
this.swapDepths(_root.getNextHighestDepth());
if (this._currentframe == 35) {
this.stop();
delete this.onEnterFrame;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
};
if ((!freezemode) && (!speciallock)) {
if ((special + pheight) <= specialmax) {
special = special + pheight;
} else {
special = specialmax;
speciallock = true;
createParticleSpray(hud._x + 790, hud._y + 10, 4474111, 7, 5, 0, 360, 15, 0, 0.95, 0);
}
}
}
return(createNode(x, y, 0, 0, jointsize, jointbounce, jointfriction, false));
}
function addfoundation(x, y) {
return(createNode(x, y, 0, 0, jointsize, 0, 0, true));
}
function finddrawoffer() {
api.clear();
api.lineStyle(3, 255, 30);
drawfroms.splice(0);
i = 0;
while (i < nodes.length) {
if (rhittest(offerdrawl, _xmouse, _ymouse, nodes[i].x, nodes[i].y)) {
drawfroms.push(nodes[i]);
}
if ((nodes[i].y > 540) && (!gameending)) {
gameending = true;
}
i++;
}
if (drawfroms.length > 0) {
place = true;
a = drawfroms;
found = new Object();
found.obj = undefined;
found.len = offerdrawl + 1;
i = 0;
while (i < a.length) {
chckdist = dist(_xmouse, _ymouse, a[i].x, a[i].y);
if (chckdist < found.len) {
found.obj = a[i];
found.len = chckdist;
}
i++;
}
if (!connectmode) {
if (found.len > snapl) {
api.moveTo(found.obj.x, found.obj.y);
api.lineTo(_xmouse, _ymouse);
} else {
found.obj.self.gotoAndStop(2);
}
} else {
if (dist(connectpoint.x, connectpoint.y, found.obj.x, found.obj.y) <= joindist) {
api.lineStyle(3, 65280, 30);
} else {
api.lineStyle(3, 16711680, 30);
}
api.moveTo(connectpoint.x, connectpoint.y);
api.lineTo(found.obj.x, found.obj.y);
}
} else {
place = false;
}
}
function mousethrow() {
if (connectmode) {
if ((dist(connectpoint.x, connectpoint.y, found.obj.x, found.obj.y) <= joindist) && (dist(found.obj.x, found.obj.y, _xmouse, _ymouse) <= csnapl)) {
if (connectpoint != found.obj) {
double = false;
i = 0;
while (i < constraints.length) {
if ((constraints[i].a == connectpoint) && (constraints[i].b == found.obj)) {
double = true;
break;
}
if ((constraints[i].b == connectpoint) && (constraints[i].a == found.obj)) {
double = true;
break;
}
i++;
}
if (!double) {
cooldown = cooldownmax;
createParticleSpray(found.obj.x, found.obj.y, 65280, 8, 10, 0, 360, 10, 0, 0.9, 0);
createParticleSpray(connectpoint.x, connectpoint.y, 65280, 8, 10, 0, 360, 10, 0, 0.9, 0);
constrainNodes(found.obj, connectpoint, dist(found.obj.x, found.obj.y, connectpoint.x, connectpoint.y), breakpoint);
}
}
}
connectmode = false;
connectpoint = undefined;
} else if (place) {
if (found.len < snapl) {
connectmode = true;
connectpoint = found.obj;
} else {
constrainNodes(found.obj, addjoint(_xmouse, _ymouse), found.len, breakpoint);
cooldown = cooldownmax;
connectmode = true;
connectpoint = nodes[nodes.length - 1];
}
} else {
connectmode = false;
connectpoint = undefined;
}
}
function countbolts() {
tempbolts = 0;
i = 0;
while (i < nodes.length) {
if (nodes[i].r > 0) {
tempbolts++;
}
i++;
}
return(tempbolts);
}
function specialactivate() {
if (Key.isDown(32) && (speciallock)) {
freezemode = true;
worldspeed = 0;
hud.freezemarker._xscale = 150;
hud.freezemarker._yscale = 150;
}
}
function wallhittest(ax, ay, bx, by, cx, cy, r) {
var _local1 = bx - ax;
var _local2 = by - ay;
var _local5 = (_local1 * _local1) + (_local2 * _local2);
u = (((cx - ax) * _local1) + ((cy - ay) * _local2)) / _local5;
if ((u < 1E-5) || (u > 1)) {
return(false);
}
ix = ax + (u * _local1);
iy = ay + (u * _local2);
ixd = ix - cx;
iyd = iy - cy;
rawdist = (ixd * ixd) + (iyd * iyd);
if (rawdist <= (r * r)) {
return(true);
}
return(false);
}
function finddelete() {
api.clear();
i = 0;
while (i < nodes.length) {
var _local3 = false;
if (rhittest(joindist, _xmouse, _ymouse, nodes[i].x, nodes[i].y)) {
j = 0;
while (j < constraints.length) {
if ((constraints[j].a == nodes[i]) || (constraints[j].b == nodes[i])) {
var _local2 = constraints[j].a;
var _local1 = constraints[j].b;
if (wallhittest(_local2.x, _local2.y, _local1.x, _local1.y, _xmouse, _ymouse, 8)) {
targetpylon = j;
api.lineStyle(16, 16777215, 50);
api.moveTo(_local2.x, _local2.y);
api.lineTo(_local1.x, _local1.y);
_local3 = true;
break;
}
targetpylon = undefined;
}
j++;
}
}
if (_local3) {
break;
}
i++;
}
}
function deletepylon() {
if (targetpylon != undefined) {
var _local2 = constraints[targetpylon].a;
var _local1 = constraints[targetpylon].b;
delete constraints[targetpylon];
constraints.splice(targetpylon, 1);
killorphans(_local2, _local1);
cooldown = cooldownmax;
}
}
function multipliers() {
if (special > (specialmax * 0.75)) {
hud.four._xscale = 150;
hud.four._yscale = 150;
hud.three._xscale = 100;
hud.three._xscale = 100;
hud.two._xscale = 100;
hud.two._yscale = 100;
scoremultiplier = 4;
} else if (special > (specialmax * 0.5)) {
hud.four._xscale = 100;
hud.four._yscale = 100;
hud.three._xscale = 150;
hud.three._xscale = 150;
hud.two._xscale = 100;
hud.two._yscale = 100;
scoremultiplier = 3;
} else if (special > (specialmax * 0.25)) {
hud.four._xscale = 100;
hud.four._yscale = 100;
hud.three._xscale = 100;
hud.three._xscale = 100;
hud.two._xscale = 150;
hud.two._yscale = 150;
scoremultiplier = 2;
} else {
hud.four._xscale = 100;
hud.four._yscale = 100;
hud.three._xscale = 100;
hud.three._xscale = 100;
hud.two._xscale = 100;
hud.two._yscale = 100;
scoremultiplier = 1;
}
}
function killorphans(a, b) {
af = false;
bf = false;
i = 0;
while (i < constraints.length) {
if ((constraints[i].a == a) || (constraints[i].b == a)) {
af = true;
}
if ((constraints[i].a == b) || (constraints[i].b == b)) {
bf = true;
}
if (af && (bf)) {
return(undefined);
}
i++;
}
if (a.solid) {
af = true;
}
if (b.solid) {
bf = true;
}
if ((!af) || (!bf)) {
i = 0;
while (i < nodes.length) {
if ((nodes[i] == a) && (!af)) {
if (found.obj == a) {
found.obj = undefined;
connectmode = false;
place = false;
}
a.self.removeMovieClip();
nodes.splice(i, 1);
af = true;
}
if ((nodes[i] == b) && (!bf)) {
if (found.obj == b) {
found.obj = undefined;
connectmode = false;
place = false;
}
b.self.removeMovieClip();
nodes.splice(i, 1);
bf = true;
}
if (af && (bf)) {
break;
}
i++;
}
}
}
function updatetower() {
if ((!gamepaused) && (!gameend)) {
if (Key.isDown(80) && ((getTimer() - pausetime) > 200)) {
pausetime = getTimer();
gamepaused = true;
}
multipliers();
if (cooldown < cooldownmax) {
hud.cooldownbar._xscale = 100 - ((cooldown / cooldownmax) * 100);
}
if (cooldown > 0) {
cooldown--;
}
if (freezemode) {
special = special - 2;
if (special < 2) {
special = 0;
freezemode = false;
worldspeed = worldspeedset;
speciallock = false;
hud.freezemarker._xscale = 100;
hud.freezemarker._yscale = 100;
}
} else {
specialactivate();
}
hud.specialbar._xscale = (special / specialmax) * 100;
if (!speciallock) {
special = special * specialdecay;
hud.specialbar._alpha = 30;
hud.freezemarker._alpha = 10;
} else {
hud.specialbar._alpha = 80;
hud.freezemarker._alpha = 30;
}
updatesparkdoll();
if (!Key.isDown(16)) {
finddrawoffer();
} else {
found.obj = undefined;
connectmode = false;
place = false;
finddelete();
}
updateparticles();
crane.swapDepths(getNextHighestDepth());
clouds.swapDepths(getNextHighestDepth());
api.swapDepths(getNextHighestDepth());
hud.swapDepths(getNextHighestDepth());
if (gameending && (gametimeout > 0)) {
gametimeout--;
} else if (gameending && (gametimeout <= 0)) {
gameend = true;
}
} else if (gameend) {
connectpoint = undefined;
api.removeMovieClip();
animatepoints();
updatesparkdoll();
updateparticles();
_root.kongregateStats.submit("Height", scoreheight);
_root.kongregateStats.submit("Score", score);
_root.kongregateStats.submit("Bolts", countbolts());
_root.kongregateStats.submit("Pylons", constraints.length);
_root.kongregateScores.submit(score);
if (!scorecont._visible) {
scorecont._visible = true;
scorecont.movHiScores.setDetails(37, 0, "insurgo", false, score, scoreheight + " metres high!", score + " points!");
}
scorecont.swapDepths(getNextHighestDepth());
if (scorecont._alpha < 100) {
scorecont._alpha = scorecont._alpha + 5;
}
if (hud._alpha > 50) {
hud._alpha = hud._alpha - 5;
} else {
hud.unloadMovie();
}
} else if (gamepaused) {
if (Key.isDown(80) && ((getTimer() - pausetime) > 200)) {
pausetime = getTimer();
gamepaused = false;
}
}
}
function cleanupworld() {
gameend = true;
cline.removeMovieClip();
api.removeMovieClip();
i = 0;
while (i < nodes.length) {
nodes[i].self.removeMovieClip();
delete nodes[i];
i++;
}
nodes.splice(0);
i = 0;
while (i < constraints.length) {
delete constraints[i];
i++;
}
constraints.splice(0);
scorecont.removeMovieClip();
particlemc.removeMovieClip();
i = 0;
while (i < particles.length) {
delete particles[i];
i++;
}
particles.splice(0);
drawfroms.splice(0);
clouds.removeMovieClip();
crane.removeMovieClip();
hud.removeMovieClip();
}
function camupdate() {
scorecont._y = cam._y - 5;
hud._y = cam._y - 273;
hud._x = cam._x - 425;
crane._y = (cam._y * -0.15) + 100;
fence._y = (cam._y * 0.15) + 350;
factories._y = (cam._y * 0.25) - 80;
city._y = (cam._y * 0.35) + 100;
higher = false;
i = 0;
while (i < nodes.length) {
if (nodes[i].y < maxheight) {
maxheight = nodes[i].y;
higher = true;
}
i++;
}
if (!higher) {
maxheight = 450;
i = 0;
while (i < nodes.length) {
if (nodes[i].y < maxheight) {
maxheight = nodes[i].y;
higher = true;
}
i++;
}
}
background._y = (cam._y * 0.5) - 37.3;
endscreen._y = cam._y;
if ((_ymouse > (cam._y + 200)) || (_ymouse < (cam._y - 200))) {
cam._y = cam._y + ((_ymouse - cam._y) * 0.03);
}
findheight();
if ((cam._y + halfheight) > 600) {
cam._y = 300;
}
if (maxheight < 0) {
if ((cam._y - halfheight) < (maxheight - 350)) {
cam._y = maxheight - 50;
}
} else if ((cam._y - halfheight) < -350) {
cam._y = -50;
}
}
function scoreupdate() {
amax = 450 - maxheight;
if (amax > scoreheight) {
scoreheight = Math.round(amax);
}
}
var constraints = new Array();
var nodes = new Array();
var nodeid = 0;
var worldspeedset = 0.2;
var worldspeed = 0.2;
var gravity = 0.7;
var cline = createEmptyMovieClip("constraintline", _root.getNextHighestDepth());
var particles = new Array();
var particlemc = createEmptyMovieClip("particle", _root.getNextHighestDepth());
var drawfroms = new Array();
var soundholder = createEmptyMovieClip("bgm", _root.getNextHighestDepth());
soundholder.loadMovie("http://games.mochiads.com/c/g/insurgo/bgm.swf");
var offerdrawl = 115;
var joindist = 250;
var snapl = 30;
var api = createEmptyMovieClip("api", _root.getNextHighestDepth());
var place = false;
var jointsize = 8;
var jointbounce = 0.6;
var jointfriction = 0.8;
var breakpoint = 25;
var connectmode = false;
var connectpoint;
var cooldown = 15;
var cooldownmax = 15;
var gamepaused = false;
var gameend = false;
var gameending = false;
var gametimeout = 150;
var scoreups = 0;
var special = 0;
var specialdecay = 0.999;
var specialmax = 800;
var speciallock = false;
var freezemode = false;
var targetpylon = undefined;
var scoremultiplier = 0;
var score = 0;
var pausetime = 0;
scorecont._visible = false;
scorecont._alpha = 0;
onMouseDown = function () {
if ((((!gameend) && (!gameending)) && (cooldown == 0)) && (!gamepaused)) {
if (!Key.isDown(16)) {
mousethrow();
} else {
deletepylon();
}
}
};
scorecont.restartbutton.onRelease = function () {
if (gameend) {
cleanupworld();
_root.gotoAndPlay("pregame");
}
};
stop();
maxheight = 600;
higher = false;
scoreheight = 0;
endscreen._visible = false;
endscreen._alpha = 0;
addfoundation(400, 450);
addfoundation(600, 450);
halfheight = 300;
__com_mochibot__("c98bc342", this, 10301, true);
onEnterFrame = function () {
if (Key.isDown(77)) {
stopAllSounds();
}
camupdate();
updatetower();
scoreupdate();
};
Symbol 266 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
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 _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.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 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_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 _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
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;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_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 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();
}};
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_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;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
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) {
_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 showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(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 _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
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 _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
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;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_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);
}
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++;
}
}
return(_local4);
}
}
Symbol 267 MovieClip [__Packages.Node] Frame 0
class Node
{
var x, y, xv, yv, self, bounce, friction, r, solid;
function Node (x, y, xv, yv, self, b, f, r, s) {
this.x = x;
this.y = y;
this.xv = xv;
this.yv = yv;
this.self = self;
this.self._rotation = random(45);
this.self.cacheAsBitmap = true;
bounce = b;
friction = f;
this.r = r;
solid = s;
self._x = x;
self._y = y;
}
function update(multiplier) {
if (!solid) {
if (_root.worldspeed > 0) {
yv = yv + _root.gravity;
}
x = x + (xv * multiplier);
y = y + (yv * multiplier);
self._x = x;
self._y = y;
self.stop();
} else {
xv = 0;
yv = 0;
}
if (this != _root.connectpoint) {
self.gotoAndStop(1);
} else {
self.gotoAndStop(3);
}
}
}
Symbol 268 MovieClip [__Packages.Constraint] Frame 0
class Constraint
{
var a, b, dlen, tolerance, rednum, alen, tempx, tempy, tempxv, tempyv, olda, xd, yd, dx, dy, force, dxf, dyf;
function Constraint (a, b, len, tolerance) {
this.a = a;
this.b = b;
dlen = len;
this.tolerance = tolerance;
if (a.solid || (b.solid)) {
this.tolerance = this.tolerance * 6;
}
}
function render() {
_root.cline.lineStyle(16, 8947848, 100);
_root.cline.moveTo(a.x, a.y);
_root.cline.lineTo(b.x, b.y);
_root.cline.lineStyle(8, 10066329, 100);
_root.cline.moveTo(a.x, a.y);
_root.cline.lineTo(b.x, b.y);
rednum = (Math.abs(dlen - alen) / tolerance) * 100;
_root.cline.lineStyle(16, 16711680, (rednum - 50) * 2);
_root.cline.moveTo(a.x, a.y);
_root.cline.lineTo(b.x, b.y);
}
function breakself(alen) {
if ((alen > (dlen + tolerance)) || (alen < (dlen - tolerance))) {
tempx = a.x;
tempy = a.y;
tempxv = a.xv;
tempyv = a.yv;
olda = a;
a = _root.createNode(tempx, tempy, tempxv, tempyv, 0, 0.5, 0.5);
tolerance = 10000;
_root.createParticleSpray(a.x, a.y, 13434879, random(6) + 3, 10, 0, 360, 12, 5, 0.9, 0);
_root.killorphans(olda, b);
}
}
function update() {
xd = (a.x + a.xv) - (b.x + b.xv);
yd = (a.y + a.yv) - (b.y + b.yv);
alen = Math.sqrt((xd * xd) + (yd * yd));
breakself(alen);
if ((a.y > (_root.cam._y - 300)) && (a.y < (_root.cam._y + 300))) {
render();
} else if ((b.y > (_root.cam._y - 300)) && (b.y < (_root.cam._y + 300))) {
render();
}
if (_root.worldspeed > 0) {
dx = xd / alen;
dy = yd / alen;
force = (dlen - alen) * 0.5;
dxf = dx * force;
dyf = dy * force;
if ((!a.solid) && (!b.solid)) {
a.xv = a.xv + dxf;
a.yv = a.yv + dyf;
b.xv = b.xv - dxf;
b.yv = b.yv - dyf;
} else if ((!a.solid) && (b.solid)) {
a.xv = a.xv + dxf;
a.yv = a.yv + dyf;
} else if (a.solid && (!b.solid)) {
b.xv = b.xv - dxf;
b.yv = b.yv - dyf;
}
}
}
}
Symbol 269 MovieClip [__Packages.Particle] Frame 0
class Particle
{
var x, ox, y, oy, col, decay, str, xv, yv;
function Particle (x, y, xv, yv, c, d, s, u) {
this.x = (ox = x);
this.y = (oy = y);
col = c;
decay = d - (random(u) * 0.1);
str = s;
this.xv = xv;
this.yv = yv;
}
function update() {
str = str * decay;
alp = alp * decay;
xv = xv * decay;
yv = yv * decay;
if ((alp <= 5) || (str < 2)) {
return("dead");
}
x = x + xv;
y = y + yv;
_root.particlemc.lineStyle(str, col, alp);
_root.particlemc.moveTo(ox, oy);
_root.particlemc.lineTo(x, y);
ox = x;
oy = y;
}
var alp = 100;
}
Symbol 20 MovieClip [__Packages.mx.core.UIObject] Frame 0
class mx.core.UIObject extends MovieClip
{
var _width, _height, _x, _y, _parent, _minHeight, _minWidth, _visible, dispatchEvent, _xscale, _yscale, methodTable, onEnterFrame, tfList, __width, __height, moveTo, lineTo, createTextField, attachMovie, buildDepthTable, findNextAvailableDepth, idNames, childrenCreated, _name, createAccessibilityImplementation, _endInit, validateNow, hasOwnProperty, initProperties, stylecache, className, ignoreClassStyleDeclaration, _tf, fontFamily, fontSize, color, marginLeft, marginRight, fontStyle, fontWeight, textAlign, textIndent, textDecoration, embedFonts, styleName, enabled;
function UIObject () {
super();
constructObject();
}
function get width() {
return(_width);
}
function get height() {
return(_height);
}
function get left() {
return(_x);
}
function get x() {
return(_x);
}
function get top() {
return(_y);
}
function get y() {
return(_y);
}
function get right() {
return(_parent.width - (_x + width));
}
function get bottom() {
return(_parent.height - (_y + height));
}
function getMinHeight(Void) {
return(_minHeight);
}
function setMinHeight(h) {
_minHeight = h;
}
function get minHeight() {
return(getMinHeight());
}
function set minHeight(h) {
setMinHeight(h);
//return(minHeight);
}
function getMinWidth(Void) {
return(_minWidth);
}
function setMinWidth(w) {
_minWidth = w;
}
function get minWidth() {
return(getMinWidth());
}
function set minWidth(w) {
setMinWidth(w);
//return(minWidth);
}
function setVisible(x, noEvent) {
if (x != _visible) {
_visible = x;
if (noEvent != true) {
dispatchEvent({type:(x ? "reveal" : "hide")});
}
}
}
function get visible() {
return(_visible);
}
function set visible(x) {
setVisible(x, false);
//return(visible);
}
function get scaleX() {
return(_xscale);
}
function set scaleX(x) {
_xscale = x;
//return(scaleX);
}
function get scaleY() {
return(_yscale);
}
function set scaleY(y) {
_yscale = y;
//return(scaleY);
}
function doLater(obj, fn) {
if (methodTable == undefined) {
methodTable = new Array();
}
methodTable.push({obj:obj, fn:fn});
onEnterFrame = doLaterDispatcher;
}
function doLaterDispatcher(Void) {
delete onEnterFrame;
if (invalidateFlag) {
redraw();
}
var _local3 = methodTable;
methodTable = new Array();
if (_local3.length > 0) {
var _local2;
while (_local2 = _local3.shift() , _local2 != undefined) {
_local2.obj[_local2.fn]();
}
}
}
function cancelAllDoLaters(Void) {
delete onEnterFrame;
methodTable = new Array();
}
function invalidate(Void) {
invalidateFlag = true;
onEnterFrame = doLaterDispatcher;
}
function invalidateStyle(Void) {
invalidate();
}
function redraw(bAlways) {
if (invalidateFlag || (bAlways)) {
invalidateFlag = false;
var _local2;
for (_local2 in tfList) {
tfList[_local2].draw();
}
draw();
dispatchEvent({type:"draw"});
}
}
function draw(Void) {
}
function move(x, y, noEvent) {
var _local3 = _x;
var _local2 = _y;
_x = x;
_y = y;
if (noEvent != true) {
dispatchEvent({type:"move", oldX:_local3, oldY:_local2});
}
}
function setSize(w, h, noEvent) {
var _local3 = __width;
var _local2 = __height;
__width = w;
__height = h;
size();
if (noEvent != true) {
dispatchEvent({type:"resize", oldWidth:_local3, oldHeight:_local2});
}
}
function size(Void) {
_width = __width;
_height = __height;
}
function drawRect(x1, y1, x2, y2) {
moveTo(x1, y1);
lineTo(x2, y1);
lineTo(x2, y2);
lineTo(x1, y2);
lineTo(x1, y1);
}
function createLabel(name, depth, text) {
createTextField(name, depth, 0, 0, 0, 0);
var _local2 = this[name];
_local2._color = textColorList;
_local2._visible = false;
_local2.__text = text;
if (tfList == undefined) {
tfList = new Object();
}
tfList[name] = _local2;
_local2.invalidateStyle();
invalidate();
_local2.styleName = this;
return(_local2);
}
function createObject(linkageName, id, depth, initobj) {
return(attachMovie(linkageName, id, depth, initobj));
}
function createClassObject(className, id, depth, initobj) {
var _local3 = className.symbolName == undefined;
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className);
}
var _local4 = mx.core.UIObject(createObject(className.symbolOwner.symbolName, id, depth, initobj));
if (_local3) {
Object.registerClass(className.symbolOwner.symbolName, className.symbolOwner);
}
return(_local4);
}
function createEmptyObject(id, depth) {
return(createClassObject(mx.core.UIObject, id, depth));
}
function destroyObject(id) {
var _local2 = this[id];
if (_local2.getDepth() < 0) {
var _local4 = buildDepthTable();
var _local5 = findNextAvailableDepth(0, _local4, "up");
var _local3 = _local5;
_local2.swapDepths(_local3);
}
_local2.removeMovieClip();
delete this[id];
}
function getSkinIDName(tag) {
return(idNames[tag]);
}
function setSkin(tag, linkageName, initObj) {
if (_global.skinRegistry[linkageName] == undefined) {
mx.skins.SkinElement.registerElement(linkageName, mx.skins.SkinElement);
}
return(createObject(linkageName, getSkinIDName(tag), tag, initObj));
}
function createSkin(tag) {
var _local2 = getSkinIDName(tag);
createEmptyObject(_local2, tag);
return(this[_local2]);
}
function createChildren(Void) {
}
function _createChildren(Void) {
createChildren();
childrenCreated = true;
}
function constructObject(Void) {
if (_name == undefined) {
return(undefined);
}
init();
_createChildren();
createAccessibilityImplementation();
_endInit();
if (validateNow) {
redraw(true);
} else {
invalidate();
}
}
function initFromClipParameters(Void) {
var _local4 = false;
var _local2;
for (_local2 in clipParameters) {
if (hasOwnProperty(_local2)) {
_local4 = true;
this["def_" + _local2] = this[_local2];
delete this[_local2];
}
}
if (_local4) {
for (_local2 in clipParameters) {
var _local3 = this["def_" + _local2];
if (_local3 != undefined) {
this[_local2] = _local3;
}
}
}
}
function init(Void) {
__width = _width;
__height = _height;
if (initProperties == undefined) {
initFromClipParameters();
} else {
initProperties();
}
if (_global.cascadingStyles == true) {
stylecache = new Object();
}
}
function getClassStyleDeclaration(Void) {
var _local4 = this;
var _local3 = className;
while (_local3 != undefined) {
if (ignoreClassStyleDeclaration[_local3] == undefined) {
if (_global.styles[_local3] != undefined) {
return(_global.styles[_local3]);
}
}
_local4 = _local4.__proto__;
_local3 = _local4.className;
}
}
function setColor(color) {
}
function __getTextFormat(tf, bAll) {
var _local8 = stylecache.tf;
if (_local8 != undefined) {
var _local3;
for (_local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
tf[_local3] = _local8[_local3];
}
}
}
return(false);
}
var _local6 = false;
for (var _local3 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local3])) {
if (tf[_local3] == undefined) {
var _local5 = _tf[_local3];
if (_local5 != undefined) {
tf[_local3] = _local5;
} else if ((_local3 == "font") && (fontFamily != undefined)) {
tf[_local3] = fontFamily;
} else if ((_local3 == "size") && (fontSize != undefined)) {
tf[_local3] = fontSize;
} else if ((_local3 == "color") && (color != undefined)) {
tf[_local3] = color;
} else if ((_local3 == "leftMargin") && (marginLeft != undefined)) {
tf[_local3] = marginLeft;
} else if ((_local3 == "rightMargin") && (marginRight != undefined)) {
tf[_local3] = marginRight;
} else if ((_local3 == "italic") && (fontStyle != undefined)) {
tf[_local3] = fontStyle == _local3;
} else if ((_local3 == "bold") && (fontWeight != undefined)) {
tf[_local3] = fontWeight == _local3;
} else if ((_local3 == "align") && (textAlign != undefined)) {
tf[_local3] = textAlign;
} else if ((_local3 == "indent") && (textIndent != undefined)) {
tf[_local3] = textIndent;
} else if ((_local3 == "underline") && (textDecoration != undefined)) {
tf[_local3] = textDecoration == _local3;
} else if ((_local3 == "embedFonts") && (embedFonts != undefined)) {
tf[_local3] = embedFonts;
} else {
_local6 = true;
}
}
}
}
if (_local6) {
var _local9 = styleName;
if (_local9 != undefined) {
if (typeof(_local9) != "string") {
_local6 = _local9.__getTextFormat(tf, true, this);
} else if (_global.styles[_local9] != undefined) {
_local6 = _global.styles[_local9].__getTextFormat(tf, true, this);
}
}
}
if (_local6) {
var _local10 = getClassStyleDeclaration();
if (_local10 != undefined) {
_local6 = _local10.__getTextFormat(tf, true, this);
}
}
if (_local6) {
if (_global.cascadingStyles) {
if (_parent != undefined) {
_local6 = _parent.__getTextFormat(tf, false);
}
}
}
if (_local6) {
_local6 = _global.style.__getTextFormat(tf, true, this);
}
return(_local6);
}
function _getTextFormat(Void) {
var _local2 = stylecache.tf;
if (_local2 != undefined) {
return(_local2);
}
_local2 = new TextFormat();
__getTextFormat(_local2, true);
stylecache.tf = _local2;
if (enabled == false) {
var _local3 = getStyle("disabledColor");
_local2.color = _local3;
}
return(_local2);
}
function getStyleName(Void) {
var _local2 = styleName;
if (_local2 != undefined) {
if (typeof(_local2) != "string") {
return(_local2.getStyleName());
}
return(_local2);
}
if (_parent != undefined) {
return(_parent.getStyleName());
}
return(undefined);
}
function getStyle(styleProp) {
var _local3;
_global.getStyleCounter++;
if (this[styleProp] != undefined) {
return(this[styleProp]);
}
var _local6 = styleName;
if (_local6 != undefined) {
if (typeof(_local6) != "string") {
_local3 = _local6.getStyle(styleProp);
} else {
var _local7 = _global.styles[_local6];
_local3 = _local7.getStyle(styleProp);
}
}
if (_local3 != undefined) {
return(_local3);
}
var _local7 = getClassStyleDeclaration();
if (_local7 != undefined) {
_local3 = _local7[styleProp];
}
if (_local3 != undefined) {
return(_local3);
}
if (_global.cascadingStyles) {
if (mx.styles.StyleManager.isInheritingStyle(styleProp) || (mx.styles.StyleManager.isColorStyle(styleProp))) {
var _local5 = stylecache;
if (_local5 != undefined) {
if (_local5[styleProp] != undefined) {
return(_local5[styleProp]);
}
}
if (_parent != undefined) {
_local3 = _parent.getStyle(styleProp);
} else {
_local3 = _global.style[styleProp];
}
if (_local5 != undefined) {
_local5[styleProp] = _local3;
}
return(_local3);
}
}
if (_local3 == undefined) {
_local3 = _global.style[styleProp];
}
return(_local3);
}
static function mergeClipParameters(o, p) {
for (var _local3 in p) {
o[_local3] = p[_local3];
}
return(true);
}
static var symbolName = "UIObject";
static var symbolOwner = mx.core.UIObject;
static var version = "2.0.2.127";
static var textColorList = {color:1, disabledColor:1};
var invalidateFlag = false;
var lineWidth = 1;
var lineColor = 0;
var tabEnabled = false;
var clipParameters = {visible:1, minHeight:1, minWidth:1, maxHeight:1, maxWidth:1, preferredHeight:1, preferredWidth:1};
}
Symbol 21 MovieClip [__Packages.mx.core.UIComponent] Frame 0
class mx.core.UIComponent extends mx.core.UIObject
{
var __width, __height, invalidate, stylecache, removeEventListener, dispatchEvent, drawFocus, addEventListener, _xscale, _yscale, _focusrect, watch, enabled;
function UIComponent () {
super();
}
function get width() {
return(__width);
}
function get height() {
return(__height);
}
function setVisible(x, noEvent) {
super.setVisible(x, noEvent);
}
function enabledChanged(id, oldValue, newValue) {
setEnabled(newValue);
invalidate();
delete stylecache.tf;
return(newValue);
}
function setEnabled(enabled) {
invalidate();
}
function getFocus() {
var selFocus = Selection.getFocus();
return(((selFocus === null) ? null : (eval (selFocus))));
}
function setFocus() {
Selection.setFocus(this);
}
function getFocusManager() {
var _local2 = this;
while (_local2 != undefined) {
if (_local2.focusManager != undefined) {
return(_local2.focusManager);
}
_local2 = _local2._parent;
}
return(undefined);
}
function onKillFocus(newFocus) {
removeEventListener("keyDown", this);
removeEventListener("keyUp", this);
dispatchEvent({type:"focusOut"});
drawFocus(false);
}
function onSetFocus(oldFocus) {
addEventListener("keyDown", this);
addEventListener("keyUp", this);
dispatchEvent({type:"focusIn"});
if (getFocusManager().bDrawFocus != false) {
drawFocus(true);
}
}
function findFocusInChildren(o) {
if (o.focusTextField != undefined) {
return(o.focusTextField);
}
if (o.tabEnabled == true) {
return(o);
}
return(undefined);
}
function findFocusFromObject(o) {
if (o.tabEnabled != true) {
if (o._parent == undefined) {
return(undefined);
}
if (o._parent.tabEnabled == true) {
o = o._parent;
} else if (o._parent.tabChildren) {
o = findFocusInChildren(o._parent);
} else {
o = findFocusFromObject(o._parent);
}
}
return(o);
}
function pressFocus() {
var _local3 = findFocusFromObject(this);
var _local2 = getFocus();
if (_local3 != _local2) {
_local2.drawFocus(false);
if (getFocusManager().bDrawFocus != false) {
_local3.drawFocus(true);
}
}
}
function releaseFocus() {
var _local2 = findFocusFromObject(this);
if (_local2 != getFocus()) {
_local2.setFocus();
}
}
function isParent(o) {
while (o != undefined) {
if (o == this) {
return(true);
}
o = o._parent;
}
return(false);
}
function size() {
}
function init() {
super.init();
_xscale = 100;
_yscale = 100;
_focusrect = _global.useFocusRect == false;
watch("enabled", enabledChanged);
if (enabled == false) {
setEnabled(false);
}
}
function dispatchValueChangedEvent(value) {
dispatchEvent({type:"valueChanged", value:value});
}
static var symbolName = "UIComponent";
static var symbolOwner = mx.core.UIComponent;
static var version = "2.0.2.127";
static var kStretch = 5000;
var focusEnabled = true;
var tabEnabled = true;
var origBorderStyles = {themeColor:16711680};
var clipParameters = {};
static var mergedClipParameters = mx.core.UIObject.mergeClipParameters(mx.core.UIComponent.prototype.clipParameters, mx.core.UIObject.prototype.clipParameters);
}
Symbol 22 MovieClip [__Packages.Splash] Frame 0
class Splash extends mx.core.UIComponent
{
var useHandCursor, boundingBox_mc, invalidate;
function Splash () {
super();
}
function init() {
super.init();
useHandCursor = false;
boundingBox_mc._visible = false;
}
function createChildren() {
size();
}
function size() {
super.size();
invalidate();
}
function draw() {
super.draw();
if (_global.isLivePreview) {
boundingBox_mc._visible = true;
} else {
boundingBox_mc._visible = false;
}
}
function getFrameAfterCompletion() {
return(frameAfterCompletion);
}
function setFrameAfterCompletion(frameAfterCompletion) {
this.frameAfterCompletion = frameAfterCompletion;
}
static var symbolName = "Splash";
static var symbolOwner = Splash;
var className = "Splash";
var frameAfterCompletion = 0;
}
Symbol 44 MovieClip [__Packages.mx.skins.SkinElement] Frame 0
class mx.skins.SkinElement extends MovieClip
{
var _visible, _x, _y, _width, _height;
function SkinElement () {
super();
}
static function registerElement(name, className) {
Object.registerClass(name, ((className == undefined) ? (mx.skins.SkinElement) : (className)));
_global.skinRegistry[name] = true;
}
function __set__visible(visible) {
_visible = visible;
}
function move(x, y) {
_x = x;
_y = y;
}
function setSize(w, h) {
_width = w;
_height = h;
}
}
Symbol 45 MovieClip [__Packages.mx.styles.CSSTextStyles] Frame 0
class mx.styles.CSSTextStyles
{
function CSSTextStyles () {
}
static function addTextStyles(o, bColor) {
o.addProperty("textAlign", function () {
return(this._tf.align);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.align = x;
});
o.addProperty("fontWeight", function () {
return(((this._tf.bold != undefined) ? ((this._tf.bold ? "bold" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.bold = x == "bold";
});
if (bColor) {
o.addProperty("color", function () {
return(this._tf.color);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.color = x;
});
}
o.addProperty("fontFamily", function () {
return(this._tf.font);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.font = x;
});
o.addProperty("textIndent", function () {
return(this._tf.indent);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.indent = x;
});
o.addProperty("fontStyle", function () {
return(((this._tf.italic != undefined) ? ((this._tf.italic ? "italic" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.italic = x == "italic";
});
o.addProperty("marginLeft", function () {
return(this._tf.leftMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.leftMargin = x;
});
o.addProperty("marginRight", function () {
return(this._tf.rightMargin);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.rightMargin = x;
});
o.addProperty("fontSize", function () {
return(this._tf.size);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.size = x;
});
o.addProperty("textDecoration", function () {
return(((this._tf.underline != undefined) ? ((this._tf.underline ? "underline" : "none")) : undefined));
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.underline = x == "underline";
});
o.addProperty("embedFonts", function () {
return(this._tf.embedFonts);
}, function (x) {
if (this._tf == undefined) {
this._tf = new TextFormat();
}
this._tf.embedFonts = x;
});
}
}
Symbol 46 MovieClip [__Packages.mx.styles.StyleManager] Frame 0
class mx.styles.StyleManager
{
function StyleManager () {
}
static function registerInheritingStyle(styleName) {
inheritingStyles[styleName] = true;
}
static function isInheritingStyle(styleName) {
return(inheritingStyles[styleName] == true);
}
static function registerColorStyle(styleName) {
colorStyles[styleName] = true;
}
static function isColorStyle(styleName) {
return(colorStyles[styleName] == true);
}
static function registerColorName(colorName, colorValue) {
colorNames[colorName] = colorValue;
}
static function isColorName(colorName) {
return(colorNames[colorName] != undefined);
}
static function getColorName(colorName) {
return(colorNames[colorName]);
}
static var inheritingStyles = {color:true, direction:true, fontFamily:true, fontSize:true, fontStyle:true, fontWeight:true, textAlign:true, textIndent:true};
static var colorStyles = {barColor:true, trackColor:true, borderColor:true, buttonColor:true, color:true, dateHeaderColor:true, dateRollOverColor:true, disabledColor:true, fillColor:true, highlightColor:true, scrollTrackColor:true, selectedDateColor:true, shadowColor:true, strokeColor:true, symbolBackgroundColor:true, symbolBackgroundDisabledColor:true, symbolBackgroundPressedColor:true, symbolColor:true, symbolDisabledColor:true, themeColor:true, todayIndicatorColor:true, shadowCapColor:true, borderCapColor:true, focusColor:true};
static var colorNames = {black:0, white:16777215, red:16711680, green:65280, blue:255, magenta:16711935, yellow:16776960, cyan:65535, haloGreen:8453965, haloBlue:2881013, haloOrange:16761344};
static var TextFormatStyleProps = {font:true, size:true, color:true, leftMargin:false, rightMargin:false, italic:true, bold:true, align:true, indent:true, underline:false, embedFonts:false};
static var TextStyleMap = {textAlign:true, fontWeight:true, color:true, fontFamily:true, textIndent:true, fontStyle:true, lineHeight:true, marginLeft:true, marginRight:true, fontSize:true, textDecoration:true, embedFonts:true};
}
Symbol 47 MovieClip [__Packages.mx.styles.CSSStyleDeclaration] Frame 0
class mx.styles.CSSStyleDeclaration
{
var _tf;
function CSSStyleDeclaration () {
}
function __getTextFormat(tf, bAll) {
var _local5 = false;
if (_tf != undefined) {
var _local2;
for (_local2 in mx.styles.StyleManager.TextFormatStyleProps) {
if (bAll || (mx.styles.StyleManager.TextFormatStyleProps[_local2])) {
if (tf[_local2] == undefined) {
var _local3 = _tf[_local2];
if (_local3 != undefined) {
tf[_local2] = _local3;
} else {
_local5 = true;
}
}
}
}
} else {
_local5 = true;
}
return(_local5);
}
function getStyle(styleProp) {
var _local2 = this[styleProp];
var _local3 = mx.styles.StyleManager.getColorName(_local2);
return(((_local3 == undefined) ? (_local2) : (_local3)));
}
static function classConstruct() {
mx.styles.CSSTextStyles.addTextStyles(mx.styles.CSSStyleDeclaration.prototype, true);
return(true);
}
static var classConstructed = classConstruct();
static var CSSTextStylesDependency = mx.styles.CSSTextStyles;
}
Symbol 175 MovieClip [__Packages.HiScores] Frame 0
class HiScores extends mx.core.UIComponent
{
var _visible, gameId, levelId, gameCode, lowIsBest, score, invalidate, getURL;
function HiScores () {
super();
_visible = false;
}
function setDetails(gameId, levelId, gameCode, lowIsBest, score, msg1, msg2) {
this.gameId = gameId;
this.levelId = levelId;
this.gameCode = gameCode;
this.lowIsBest = lowIsBest;
this.score = score;
movEntryScreen = movEntryScreen;
movInfoScreen = movInfoScreen;
movEntryScreen.txtMsg1.text = msg1;
movEntryScreen.txtMsg2.text = msg2;
movEntryScreen.txtName.text = "";
movEntryScreen.txtCode.text = "";
movEntryScreen._visible = true;
movInfoScreen._visible = false;
secCodeLoad();
_visible = true;
}
function createChildren() {
size();
}
function size() {
super.size();
invalidate();
}
function secCodeLoad() {
var _local2 = new MovieClipLoader();
_local2.loadClip((HS_SERVLET_URL + "?type=genCode&cachebuster=") + new Date().getTime(), movEntryScreen.movCode);
}
function back() {
movEntryScreen._visible = true;
movInfoScreen._visible = false;
}
function viewScore() {
getURL((((((((HI_SCORE_URL + gameCode) + "_hs") + "&name=") + movEntryScreen.txtName.text) + "&levelId=") + levelId) + "&cachebuster=") + new Date().getTime(), "_blank");
}
function showInfoMessage(msg, error) {
movInfoScreen.txtInfo.text = msg;
movInfoScreen.btnBack._visible = error;
movInfoScreen.btnView._visible = !error;
}
function submitScore() {
movEntryScreen._visible = false;
movInfoScreen._visible = true;
var _local8 = true;
if (movEntryScreen.txtName.text.length == 0) {
showInfoMessage("Please enter your name.", true);
} else if (movEntryScreen.txtCode.text.length != 5) {
showInfoMessage("Please enter all 5 letters of the security code.", true);
} else {
showInfoMessage("Submitting hi-score details to the server, please wait.", true);
movInfoScreen.btnBack._visible = false;
_local8 = false;
}
if (!_local8) {
var _local9 = movEntryScreen.txtName.text;
var _local4 = (((((((("save|" + _local9) + "|") + movEntryScreen.txtCode.text) + "|") + score) + "|") + gameId) + "|") + levelId;
var _local5 = "";
var _local3 = 0;
var _local2 = 0;
while (_local3 < _local4.length) {
if (_local2 >= KEY.length) {
_local2 = 0;
}
_local5 = _local5 + String.fromCharCode((_local4.charCodeAt(_local3) ^ KEY.charCodeAt(_local2)) + 1);
_local3++;
_local2++;
}
var self = this;
var _local6 = new LoadVars();
_local6.ffdata = _local5;
_local6.lowIsBest = lowIsBest;
_local6.sendAndLoad(HS_SERVLET_URL, _local6, "POST");
_local6.onLoad = function (success) {
var _local2 = parseInt(this.res);
if (!success) {
self.showInfoMessage("A serious problem was encountered with the server, please try again in a few minutes.", true);
} else if (_local2 == -1) {
self.showInfoMessage("Could not store hi-score details. Click on back, generate a new security code and re-submit.", true);
} else if (_local2 == 0) {
self.showInfoMessage("Sorry, a better score already exists with that name.", false);
} else if (_local2 == 1) {
self.showInfoMessage("Congratulations! You made it into the\nhi-score table.", false);
}
};
}
}
static var symbolName = "HiScores";
static var symbolOwner = HiScores;
var className = "HiScores";
static var SERVER_URL = "http://www.gimme5games.com";
static var SERVLET_URL = SERVER_URL + "/servlet/otwServlet";
static var HS_SERVLET_URL = SERVER_URL + "/servlet/hiServlet";
static var HI_SCORE_URL = SERVER_URL + "/index.jsp?id=";
var KEY = "rocket";
var movEntryScreen = null;
var movInfoScreen = null;
}
Symbol 32 Button
on (release) {
getURL ("http://www.gimme5games.com", "_blank");
}
Symbol 43 MovieClip [Splash] Frame 1
#initclip 13
Object.registerClass("Splash", Splash);
#endinitclip
Symbol 43 MovieClip [Splash] Frame 91
_root.gotoAndStop(this.getFrameAfterCompletion());
Symbol 58 Button
on (release) {
getURL ("mailto:coronlum_daydreamer@hotmail.com", "_blank");
}
Symbol 193 Button
on (release) {
_parent.submitScore();
}
Symbol 195 Button
on (release) {
_parent.secCodeLoad();
}
Symbol 202 Button
on (release) {
_parent.back();
}
Symbol 205 Button
on (release) {
_parent.viewScore();
}
Symbol 209 MovieClip [HiScores] Frame 1
#initclip 14
Object.registerClass("HiScores", HiScores);
#endinitclip
Instance of Symbol 209 MovieClip [HiScores] "movHiScores" in Symbol 211 MovieClip Frame 1
//component parameters
onClipEvent (construct) {
enabled = true;
visible = true;
minHeight = 0;
minWidth = 0;
}
Symbol 213 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local4 = sX / this._width;
var _local3 = sY / this._height;
_parent._x = cX - (this._x * _local4);
_parent._y = cY - (this._y * _local3);
_parent._xscale = 100 * _local4;
_parent._yscale = 100 * _local3;
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
this._visible = false;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;