Frame 1
function setTerrainOn(pos) {
var floor = floors[pos];
var ceiling = ceilings[pos];
floor.clear();
ceiling.clear();
floor.beginGradientFill("linear", [16777215, 12303291], [100, 100], [0, 255], {matrixType:"box", x:0, y:hh / 2, w:ww, h:hh / 2, r:1.5707963});
ceiling.beginFill(15658751);
var iStart = -1;
var iEnd = 21;
floor.moveTo(((iStart - 1) * ww) / 20, hh);
ceiling.moveTo(((iStart - 1) * ww) / 20, 0);
fp = recentFp[0];
cp = recentCp[0];
var i = iStart;
while (i <= iEnd) {
lfp = fp;
lcp = cp;
if (i <= 1) {
fp = recentFp[i + 1];
cp = recentCp[i + 1];
} else {
cp = cp + ((rand(rt) * 20) - 10);
fp = fp + ((rand(rt) * 20) - 10);
if (rand(rt) < 0.15) {
if (rand(rt) < 0.5) {
cp = cp + ((rand(rt) * gap) / 4);
} else {
fp = fp - ((rand(rt) * gap) / 4);
}
}
cp = cp + ((((hh / 2) - (gap / 2)) - cp) / 12);
fp = fp + ((((hh / 2) + (gap / 2)) - fp) / 12);
}
if (i >= 19) {
recentFp[i - 19] = fp;
recentCp[i - 19] = cp;
}
floor.curveTo(((i - 1) * ww) / 20, lfp, (ww / 20) * (i - 0.5), (fp + lfp) / 2);
ceiling.curveTo(((i - 1) * ww) / 20, lcp, (ww / 20) * (i - 0.5), (cp + lcp) / 2);
i++;
}
floor.lineTo(ww + 20, hh);
floor.lineTo(0, hh);
ceiling.lineTo(ww + 20, 0);
ceiling.lineTo(0, 0);
floor.endFill();
ceiling.endFill();
}
function rotateRadians(x, y, radians) {
var pts = new Array();
var cosrad = Math.cos(radians);
var sinrad = Math.sin(radians);
pts[1] = (cosrad * x) - (sinrad * y);
pts[2] = (cosrad * y) + (sinrad * x);
return(pts);
}
function rand(o) {
o.rfr = (o.rfr + 0.1) % (Math.PI*2);
o.rfvr = o.rfvr + ((Math.cos(o.rfr) * 0.33924) + 2);
o.rfvr = o.rfvr % Math.E;
return((o.rfvr * Math.SQRT2) % 1);
}
function startMain() {
_quality = "HIGH";
high.removeMovieClip();
main.removeMovieClip();
this.attachMovie("main", "main", ++dep);
main._x = ww / 2;
main._y = hh / 2;
main._alpha = 0;
}
function startHigh() {
_quality = "HIGH";
this.attachMovie("high", "high", ++dep);
high._x = ww / 2;
high._y = hh / 2;
high.ccr = ccr;
high.gd = gd;
high._alpha = 0;
}
function startGame() {
_quality = "LOW";
score.text = "";
recentFp = new Array();
recentCp = new Array();
dead = false;
brnda = 210;
nbfr = 0;
furg = 1;
if (ghosting) {
ghost.removeMovieClip();
ghost = this.attachMovie("ghost", "ghost", ++dep);
gblades = ghost.propellor.blades;
deadghost = false;
ghost._x = (ghost.x = 100);
ghost._y = (ghost.y = 100);
ghost._alpha = 25;
ghost._rotation = (ghost.rotation = 25);
ghost._xscale = (ghost._yscale = 25);
ghost.vy = 0;
gcr = 0;
gts = "";
gdchp = 0;
}
gd = "";
gft = false;
ccr = 0;
lcrp = 0;
bg._x = (bg.ox = (bg.x = 0));
copter.vy = 0;
copter.rx = 0;
copter._x = (copter.x = (copter.ox = 100));
copter._y = (copter.y = (copter.oy = 100));
copter._rotation = (copter.rotation = 25);
var i = 0;
while (i < bd.length) {
bd[i].b.removeMovieClip();
i++;
}
rt = new Object();
rb = new Object();
bd = new Array();
recentCp = [(hh / 2) - (gap / 2), (hh / 2) - (gap / 2), (hh / 2) - (gap / 2)];
recentFp = [(hh / 2) + (gap / 2), (hh / 2) + (gap / 2), (hh / 2) + (gap / 2)];
setTerrainOn(1);
floorPos = 2;
floors[1]._x = (ceilings[1]._x = 0);
floors[2]._x = (ceilings[2]._x = ww);
terrain._x = (terrain.x = 0);
setTerrainOn(2);
}
function checkTerrain() {
if (terrain.x < (-ww)) {
terrain.x = terrain.x + ww;
terrain._x = terrain.x;
floors[floorPos]._x = (ceilings[floorPos]._x = 0);
floorPos = 1 + (floorPos % 2);
floors[floorPos]._x = (ceilings[floorPos]._x = ww);
var i = 0;
while (i < bd.length) {
bd[i].x = bd[i].x - ww;
bd[i].b._x = bd[i].b._x - ww;
i++;
}
setTerrainOn(floorPos);
}
}
ww = 750;
hh = 300;
dm = "flash-gear.com";
var dmp = _root._url.split("/");
var di = 0;
while (di < dmp.length) {
if (dmp[di].indexOf(dm) >= 0) {
dm = dmp[di];
break;
}
di++;
}
terrainHolder = this.createEmptyMovieClip("terrainHolder", ++dep);
bg = terrainHolder.createEmptyMovieClip("bg", ++terrainHolder.dep);
terrain = terrainHolder.createEmptyMovieClip("terrain", ++terrainHolder.dep);
bdB = terrain.createEmptyMovieClip("bdB", ++terrain.dep);
terrainF = terrain.createEmptyMovieClip("terrainF", ++terrain.dep);
this.attachMovie("textbox", "score", ++dep);
score._x = 5;
score._y = (hh - score._height) - 5;
score.box.selectable = false;
floors = new Array();
ceilings = new Array();
floorsB = new Array();
ceilingsB = new Array();
i = 1;
while (i <= 2) {
f = (floors[i] = terrainF.createEmptyMovieClip("floor" + i, ++terrainF.dep));
c = (ceilings[i] = terrainF.createEmptyMovieClip("ceiling" + i, ++terrainF.dep));
fm = f.createEmptyMovieClip("floormask", ++f.dep);
fm.beginFill(0);
fm.lineTo(ww + 1, 0);
fm.lineTo(ww + 1, hh);
fm.lineTo(0, hh);
fm.lineTo(0, 0);
fm.endFill();
f.setMask(fm);
cm = c.createEmptyMovieClip("ceilingmask", ++c.dep);
cm.beginFill(0);
cm.lineTo(ww + 1, 0);
cm.lineTo(ww + 1, hh);
cm.lineTo(0, hh);
cm.lineTo(0, 0);
cm.endFill();
c.setMask(cm);
i++;
}
gap = hh - 32;
copter = this.attachMovie("copter", "copter", ++dep);
blades = copter.propellor.blades;
copter._xscale = (copter._yscale = 25);
i = 0;
while (i <= hb) {
hpts[i] = rotateRadians(hx[i], hy[i], (copter.rotation * 3.1415926) / 180);
i++;
}
hx = [36, -145, -100, -80, -60, -40, -28, 30, -70];
hy = [4, -6.5, -6.8, -6.8, -6.8, -6.8, -33, -34, -34];
hpts = new Array();
hb = hx.length - 1;
i = 0;
while (i <= hb) {
hx[i] = (hx[i] * copter._xscale) / 100;
hy[i] = (hy[i] * copter._yscale) / 100;
i++;
}
this.onMouseDown = function () {
this.mouseIsDown = true;
};
this.onMouseUp = function () {
this.mouseIsDown = false;
};
pg.y = pg._y;
startGame();
dead = true;
startMain();
this.onEnterFrame = function () {
if (main._alpha < 100) {
main._alpha = main._alpha + (lcr / 2);
if (main._alpha > 100) {
main._alpha = 100;
}
}
if (high._alpha < 100) {
high._alpha = high._alpha + (lcr / 2);
if (high._alpha > 100) {
high._alpha = 100;
}
}
t = getTimer();
if (!gft) {
gft = true;
lcrt = t;
} else {
lcrp = lcrp + ((t - lcrt) * 0.12);
lcrt = t;
lcr = 0;
if ((++furg) == 2) {
lcr = Math.min(40, Math.floor(lcrp));
furg = 0;
if (!dead) {
ccr = ccr + lcr;
score.text = ("Flight length: " + Math.ceil(ccr / 120)) + " seconds";
}
}
if (!dead) {
while (ccr > nbfr) {
if (brnda > 80) {
brnda--;
}
var tcr = (ccr - nbfr);
nbfr = nbfr + (Math.ceil(rand(rb) * brnda) + brnda);
var o = new Object();
o.b = bdB.attachMovie("penguin", "bd" + (++bdc), ++bdB.dep);
o.b._height = 30 + (rand(rb) * 10);
o.b._xscale = o.b._yscale;
o.vx = (1 + Math.min(3, ccr * 0.0005)) - (o.b._height / 40);
o.b._x = (o.x = ((ww * 2) + 64) - terrain.x);
o.b._y = (o.y = (hh / 2) + (((rand(rb) * gap) - (gap / 2)) / 2));
o.b._rotation = -(40 - o.b._yscale);
bd[bd.length] = o;
}
}
if (lcr > 0) {
lcrp = lcrp - lcr;
if (!dead) {
if (mouseIsDown) {
var dch = String.fromCharCode(2);
} else {
var dch = String.fromCharCode(1);
}
var dlcr = lcr;
while (dlcr > 0) {
var dmv = Math.min(dlcr, 120);
gd = gd + (dch + String.fromCharCode(dmv));
dlcr = dlcr - dmv;
}
if (mouseIsDown and (copter.vy > -0.75)) {
copter.vy = copter.vy - (0.015 * lcr);
if (copter.vy < -0.75) {
copter.vy = -0.75;
}
} else if ((!mouseIsDown) and (copter.vy < 0.6)) {
copter.vy = copter.vy + (0.01 * lcr);
if (copter.vy > 0.6) {
copter.vy = 0.6;
}
}
copter.oy = copter.y;
copter.y = copter.y + (copter.vy * lcr);
copter._y = copter.y;
if (ghosting and (!deadghost)) {
gblades._rotation = gblades._rotation + -41;
while (true) {
if (gts != "") {
gmd = gts.charCodeAt(0) == 2;
gcl = gts.charCodeAt(1);
gts = "";
} else {
if (gdchp >= gdbp.length) {
deadghost = true;
break;
}
gmd = gdbp.charCodeAt(gdchp) == 2;
gcl = gdbp.charCodeAt(gdchp + 1);
gdchp = gdchp + 2;
}
m = Math.min(gcl, ccr - gcr);
if (gmd and (ghost.vy > -0.75)) {
ghost.vy = ghost.vy - (0.015 * m);
if (ghost.vy < -0.75) {
ghost.vy = -0.75;
}
} else if ((!gmd) and (ghost.vy < 0.6)) {
ghost.vy = ghost.vy + (0.01 * m);
if (ghost.vy > 0.6) {
ghost.vy = 0.6;
}
}
ghost.y = ghost.y + (ghost.vy * m);
l = 1;
while (l <= m) {
ghost.rotation = ghost.rotation + (((gmd ? 0 : 20) - ghost.rotation) * 0.08);
l++;
}
gcr = gcr + m;
if (gcr == ccr) {
if (gcl > (ccr - (gcr - m))) {
gts = String.fromCharCode((gmd ? 2 : 1)) + String.fromCharCode(gcl - (ccr - (gcr - m)));
}
break;
}
}
ghost._y = ghost.y;
ghost._rotation = ghost.rotation;
} else if (deadghost) {
ghost.x = ghost.x - copter.vx;
ghost._x = ghost.x;
}
l = 1;
while (l <= lcr) {
copter.rotation = copter.rotation + (((mouseIsDown ? 0 : 20) - copter.rotation) * 0.08);
l++;
}
i = 0;
while (i <= hb) {
hpts[i] = rotateRadians(hx[i], hy[i], (copter.rotation * 3.1415926) / 180);
i++;
}
copter._rotation = copter.rotation;
blades._rotation = blades._rotation + -41;
copter.lrx = copter.rx;
copter.rx = ccr + (0.00025 * Math.pow(ccr, 2));
copter.vx = copter.rx - copter.lrx;
bg.ox = bg.x;
bg.x = bg.x - copter.vx;
bg._x = bg.x;
terrain.x = terrain.x - copter.vx;
terrain._x = terrain.x;
checkTerrain();
} else {
copter.vx = copter.vx * Math.pow(0.99, lcr);
copter.vy = copter.vy * Math.pow(0.88, lcr);
copter.x = copter.x - copter.vx;
copter._x = copter.x;
terrain.x = terrain.x - copter.vx;
terrain._x = terrain.x;
bg.x = bg.x - copter.vx;
bg._x = bg.x;
i = 0;
while (i < bd.length) {
if (bd[i].falling) {
bd[i].vy = bd[i].vy + (lcr / 30);
bd[i].b._y = bd[i].b._y + bd[i].vy;
}
i++;
}
checkTerrain();
}
i = bd.length - 1;
while (i >= 0) {
var o = bd[i];
o.x = o.x + (o.vx * lcr);
o.b._x = o.x;
if (o.x < 0) {
o.b.removeMovieClip();
bd.splice(i, 1);
}
i--;
}
}
if (furg == 1) {
if (!dead) {
var d = Math.sqrt(Math.pow(copter.y - copter.oy, 2) + Math.pow(bg.x - bg.ox, 2));
var tpt = new Array();
j = 0;
while (j <= d) {
if (j > d) {
j = d;
}
var v = (j / d);
var xv = (copter.x - ((bg.ox - bg.x) * (1 - v)));
var yv = (copter.oy + ((copter.y - copter.oy) * v));
i = 0;
while (i <= hb) {
var pts = hpts[i];
if ((terrainHolder.hitTest(xv + pts[1], yv + pts[2], true) or ((yv + pts[2]) < 0)) or ((yv + pts[2]) > hh)) {
i = 0;
while (i < bd.length) {
if (bd[i].b.hitTest(xv + pts[1], yv + pts[2], true)) {
bd[i].falling = true;
bd[i].vx = bd[i].vx * 1.5;
}
i++;
}
dead = true;
score.text = ("Flight length: " + (Math.floor((1000 * ccr) / 120) / 1000)) + " seconds";
if (ghosting) {
ghost.removeMovieClip();
}
vv = new LoadVars();
vv.c = "c";
ccr = ccr - lcr;
vv.l = ccr;
pv = new LoadVars();
pv.onLoad = function () {
if (this.ih == "1") {
startHigh();
} else {
startMain();
}
};
vv.sendAndLoad(("http://" + _root.dm) + "/copter/copter.php", pv);
j = d;
break;
}
i++;
}
j = j + 10;
}
}
}
}
};
Symbol 14 MovieClip [penguin] Frame 1
this.onEnterFrame = function () {
wfr = wfr + (_root.lcr / 10);
w._yscale = 60 + (40 * Math.cos(wfr));
};
Symbol 20 MovieClip [bevelButton] Frame 1
#initclip 1
var ccv = new Object();
ccv.bevelButton = function () {
this.init();
};
var tp = ((ccv.bevelButton.prototype = new MovieClip()));
Object.registerClass("bevelButton", ccv.bevelButton);
tp.setColor = function (c) {
var r = Math.floor(c / 65536);
var g = (Math.floor(c / 256) - (r * 256));
var b = ((c - (r * 65536)) - (g * 256));
if (((this.r != r) or (this.g != g)) or (this.b != b)) {
this.r = r;
this.g = g;
this.b = b;
this.redraw();
}
};
tp.setAngle = function (a) {
if (this.rad != a) {
this.rad = a;
this.redraw();
}
};
tp.setWidth = function (w) {
if (this.ww != w) {
this.setSize(w, this.hh);
}
};
tp.setHeight = function (h) {
if (this.hh != h) {
this.setSize(this.ww, h);
}
};
tp.setBrightness = function (b) {
if (this.bv != b) {
this.bv = b;
this.oefPush();
}
};
tp.setRadio = function (r) {
if (this.isRadio != r) {
var w = this.ww;
this.ww = w - 1;
this.isRadio = r;
this.setSize(w, this.hh);
}
};
tp.setSize = function (w, h) {
if ((this.ww != w) or (this.hh != h)) {
this.ww = w;
this.hh = h;
var w2 = (this.ww / 2);
var h2 = (this.hh / 2);
this.bg3.clear();
this.bg3.beginFill(0);
if (this.isRadio) {
var sides = 6;
var i = 0;
while (i <= sides) {
var x = ((w2 / Math.cos(3.1415926 / sides)) * Math.cos(-1.5707963 + ((6.2831852 / sides) * i)));
var y = ((h2 / Math.cos(3.1415926 / sides)) * Math.sin(-1.5707963 + ((6.2831852 / sides) * i)));
var mx = (w2 * Math.cos((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
var my = (h2 * Math.sin((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
if (i == 0) {
this.bg3.moveTo(mx, my);
} else {
this.bg3.curveTo(x, y, mx, my);
}
i++;
}
} else {
this.bg3.moveTo(-w2, -h2);
this.bg3.lineTo(w2, -h2);
this.bg3.lineTo(w2, h2);
this.bg3.lineTo(-w2, h2);
this.bg3.lineTo(-w2, -h2);
}
this.bg3.endFill();
this.bg3.c = new Color(this.bg3);
var b = this.br;
b.clear();
b.beginFill(0);
if (this.isRadio) {
var sides = 6;
var i = 0;
while (i <= sides) {
var x = ((w2 / Math.cos(3.1415926 / sides)) * Math.cos(-1.5707963 + ((6.2831852 / sides) * i)));
var y = ((h2 / Math.cos(3.1415926 / sides)) * Math.sin(-1.5707963 + ((6.2831852 / sides) * i)));
var mx = (w2 * Math.cos((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
var my = (h2 * Math.sin((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
if (i == 0) {
b.moveTo(mx, my);
} else {
b.curveTo(x, y, mx, my);
}
i++;
}
var i = 0;
while (i <= sides) {
var x = (((w2 + 1) / Math.cos(3.1415926 / sides)) * Math.cos(-1.5707963 + ((6.2831852 / sides) * i)));
var y = (((h2 + 1) / Math.cos(3.1415926 / sides)) * Math.sin(-1.5707963 + ((6.2831852 / sides) * i)));
var mx = ((w2 + 1) * Math.cos((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
var my = ((h2 + 1) * Math.sin((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
if (i == 0) {
b.lineTo(mx, my);
} else {
b.curveTo(x, y, mx, my);
}
i++;
}
} else {
b.moveTo((-w2) - 1, (-h2) - 1);
b.lineTo(w2 + 1, (-h2) - 1);
b.lineTo(w2 + 1, h2 + 1);
b.lineTo((-w2) - 1, h2 + 1);
b.lineTo((-w2) - 1, (-h2) - 1);
b.lineTo(-w2, -h2);
b.lineTo(w2, -h2);
b.lineTo(w2, h2);
b.lineTo(-w2, h2);
b.lineTo(-w2, -h2);
}
b.endFill();
this.redraw();
}
};
tp.setBevel = function (b) {
if (this.bevel != b) {
this.bevel = b;
this.oefPush();
}
};
tp.redraw = function () {
with (this) {
var rad = this.rad;
var bv = this.bv;
var r = this.r;
var g = this.g;
var b = this.b;
var ww = this.ww;
var hh = this.hh;
var w2 = (ww / 2);
var h2 = (hh / 2);
var uc = 16777215;
var w2h = Math.sqrt((2 * Math.max(ww, hh)) * Math.max(ww, hh));
var il = (w2h + Math.pow((0.6 - Math.abs(this.downAmount - 0.6)) * 30, 2));
var mv = (1 - (this.downAmount * this.darkenAmount));
var c = ((((Math.min(255, Math.floor(r * mv)) * 256) * 256) + (Math.min(255, Math.floor(g * mv)) * 256)) + Math.min(255, Math.floor(b * mv)));
var urad = ((this.downAmount > 0.5) ? (rad + 3.1415926) : (rad));
bg1.clear();
bg1.beginGradientFill("linear", [uc, c, 0], [100, 100, 100], [0, 127.5, 255], {matrixType:"box", x:(-il) / 2, y:(-il) / 2, w:il, h:il, r:urad});
if (this.isRadio) {
var sides = 6;
var i = 0;
while (i <= sides) {
var x = ((w2 / Math.cos(3.1415926 / sides)) * Math.cos(-1.5707963 + ((6.2831852 / sides) * i)));
var y = ((h2 / Math.cos(3.1415926 / sides)) * Math.sin(-1.5707963 + ((6.2831852 / sides) * i)));
var mx = (w2 * Math.cos((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
var my = (h2 * Math.sin((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
if (i == 0) {
bg1.moveTo(mx, my);
} else {
bg1.curveTo(x, y, mx, my);
}
i++;
}
} else {
bg1.moveTo(-w2, -h2);
bg1.lineTo(w2, -h2);
bg1.lineTo(w2, h2);
bg1.lineTo(-w2, h2);
bg1.lineTo(-w2, -h2);
}
bg1.endFill();
bg3.c.setRGB(c);
bg3._alpha = 100 - bv;
il = w2h + ((this.downAmount * (Math.max(ww, hh) / 20)) * 8);
bg2.clear();
graphics._y = this.downAmount;
bg2.beginGradientFill("radial", [uc, c], [(this.isRadio ? 65 : 75), (this.isRadio ? 75 : 80)], [0, 255], {matrixType:"box", x:(1 + (((Math.cos(rad) * (0.5 - this.downAmount)) * w2h) / 4)) - (il / 2), y:(1 + (((Math.sin(rad) * (0.5 - this.downAmount)) * w2h) / 4)) - (il / 2), w:il, h:il, r:0});
if (this.isRadio) {
var sides = 6;
var i = 0;
while (i <= sides) {
var x = (((w2 - this.bevel) / Math.cos(3.1415926 / sides)) * Math.cos(-1.5707963 + ((6.2831852 / sides) * i)));
var y = (((h2 - this.bevel) / Math.cos(3.1415926 / sides)) * Math.sin(-1.5707963 + ((6.2831852 / sides) * i)));
var mx = ((w2 - this.bevel) * Math.cos((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
var my = ((h2 - this.bevel) * Math.sin((-1.5707963 + ((6.2831852 / sides) * i)) + (3.1415926 / sides)));
if (i == 0) {
bg2.moveTo(mx, my);
} else {
bg2.curveTo(x, y, mx, my);
}
i++;
}
} else {
bg2.moveTo(this.bevel - w2, this.bevel - h2);
bg2.lineTo(w2 - this.bevel, this.bevel - h2);
bg2.lineTo(w2 - this.bevel, h2 - this.bevel);
bg2.lineTo(this.bevel - w2, h2 - this.bevel);
bg2.lineTo(this.bevel - w2, h2 - this.bevel);
}
bg2.endFill();
}
};
tp.stick = function () {
if (!this.stuckDown) {
this.stuckDown = true;
this.downFr = 7 - this.downFr;
this.oefPush();
}
};
tp.unstick = function () {
if (this.stuckDown) {
this.stuckDown = false;
this.downFr = 7 - this.downFr;
this.oefPush();
}
};
tp.setFunctional = function (f) {
if (this.functional != f) {
this.functional = f;
var m = this.m;
if (f) {
m.onPress = m.PH_onPress;
m.onRollOver = m.PH_onRollOver;
m.onRollOut = m.PH_onRollOut;
m.onDragOver = m.PH_onDragOver;
m.onDragOut = m.PH_onDragOut;
m.onRelease = m.PH_onRelease;
m.onReleaseOutside = m.PH_onReleaseOutside;
} else {
delete m.onPress;
delete m.onRollOver;
delete m.onRollOut;
delete m.onDragOver;
delete m.onDragOut;
delete m.onRelease;
delete m.onReleaseOutside;
}
}
};
tp.setEnabled = function (e) {
with (this) {
setFunctional(e);
if (disabled == e) {
disabled = !e;
if (m.useHandCursor == disabled) {
m.useHandCursor = !disabled;
}
oefPush();
}
}
};
tp.init = function () {
var m = this.createEmptyMovieClip("m", ++this.dep);
var ww = this._width;
var hh = this._height;
var w2 = (ww / 2);
var h2 = (hh / 2);
this._xscale = (this._yscale = 100);
this.ph._visible = false;
_root.t = this.ph;
this.rad = 1.5707963;
this.bv = 70;
this.r = 255;
this.g = 255;
this.b = 255;
this.bevel = 1;
this.darkenAmount = 0.3;
this.pushRate = 6;
this.bg1 = m.createEmptyMovieClip("bg1", ++m.dep);
this.bg2 = m.createEmptyMovieClip("bg2", ++m.dep);
this.bg3 = m.createEmptyMovieClip("bg3", ++m.dep);
this.br = m.createEmptyMovieClip("br", ++m.dep);
this.setSize(ww, hh);
this.graphics = m.createEmptyMovieClip("graphics", ++m.dep);
this.oefOn = false;
this.oef = function () {
var end = 0;
if ((!this.noDown) and (((this.md and this.mo) and (this.downFr < 7)) or (this.md and this.ultraDown))) {
this.downFr = Math.min((this.downFr + 1) + ((0 * (8 - this.downFr)) / this.pushRate), 7);
} else if ((!(this.md and this.mo)) and (this.downFr > 0)) {
this.downFr = Math.max((this.downFr - 1) + ((0 * (-0.03 - this.downFr)) / this.pushRate), 0);
} else {
end++;
}
if (this.stuckDown) {
this.downAmount = 1 - ((Math.cos(3.1415926 * (1 + (this.downFr / 7))) * 0.5) + 0.5);
} else {
this.downAmount = (Math.cos(3.1415926 * (1 + (this.downFr / 7))) * 0.5) + 0.5;
}
if (this.disabled and (this.disableFr < 4)) {
this.disableFr++;
} else if ((!this.disabled) and (this.disableFr > 0)) {
this.disableFr--;
} else {
end++;
}
this.m._alpha = 100 - ((65 * this.disableFr) / 4);
this.redraw();
if (end == 2) {
this.oefOn = false;
delete this.onEnterFrame;
}
};
this.oefPush = function () {
if (!this.oefOn) {
this.oefOn = true;
this.onEnterFrame = this.oef;
}
};
this.disabled = (this.mo = (this.md = (this.mp = (this.sticky = (this.stuckDown = false)))));
this.click = function () {
with (this) {
if (!disabled) {
downFr = 7;
if (sticky) {
stuckDown = !stuckDown;
downFr = 7 - downFr;
}
clicked();
oefPush();
}
}
};
m.PH_onPress = function () {
with (this._parent) {
mo = true;
if (!disabled) {
md = true;
}
mp = true;
oefPush();
mouseStatus();
}
};
m.PH_onDragOver = function () {
with (this._parent) {
mo = true;
mp = true;
oefPush();
mouseStatus();
}
};
m.PH_onDragOut = function () {
with (this._parent) {
mo = false;
mp = false;
oefPush();
mouseStatus();
}
};
m.PH_onRollOver = function () {
with (this._parent) {
mo = true;
oefPush();
mouseStatus();
}
};
m.PH_onRollOut = function () {
with (this._parent) {
mo = false;
oefPush();
mouseStatus();
}
};
m.PH_onRelease = function () {
with (this._parent) {
if (md and mo) {
click();
}
mo = true;
md = false;
mp = false;
oefPush();
mouseStatus();
}
};
m.PH_onReleaseOutside = function () {
with (this._parent) {
mo = false;
md = false;
mp = false;
oefPush();
mouseStatus();
}
};
this.tabChildren = false;
m._focusrect = false;
this.setEnabled(true);
this.redraw();
};
delete cn;
delete ccv;
delete tp;
#endinitclip
Symbol 24 MovieClip [main] Frame 1
function loaded(lv) {
playBtn.setEnabled(true);
var j = Number(lv.nc);
tpd = lv.tpd;
var i = 1;
while (i <= j) {
var hsc = this.attachMovie("textbox", "n" + i, ++dep);
hsc._x = -10;
hsc._y = -90 + (i * 14);
hsc.text = lv["n" + i];
var hsc = this.attachMovie("textbox", "l" + i, ++dep);
hsc._x = 135;
hsc._y = -90 + (i * 14);
hsc.text = Math.floor((1000 * Number(lv["l" + i])) / 120) / 1000;
i++;
}
}
playBtn.graphics.attachMovie("playGraphic", "g", ++playBtn.graphics.dep);
playBtn.setEnabled(false);
vsBtn.x = vsBtn.graphics.attachMovie("x", "x", ++vsBtn.graphics.dep);
vsBtn.x._visible = false;
vsBtn.clicked = function () {
this.checked = !this.checked;
this.x._visible = this.checked;
_root.vsBtnChecked = this.checked;
};
playBtn.clicked = function () {
if (vsBtn.checked) {
if (tpd.length > 0) {
_parent.ghosting = true;
_parent.gdbp = tpd;
}
} else {
_parent.ghosting = false;
}
_parent.startGame();
_parent.main.removeMovieClip();
};
if (_root.vsBtnChecked == undefined) {
_root.vsBtnChecked = true;
}
if (_root.vsBtnChecked) {
vsBtn.click();
}
vv = new LoadVars();
vv.c = "t";
pv = new LoadVars();
pv.onLoad = function () {
loaded(this);
};
vv.sendAndLoad(("http://" + _root.dm) + "/copter/copter.php", pv);
Symbol 31 MovieClip [high] Frame 1
function ok() {
okBtn.setEnabled(false);
vv = new LoadVars();
vv.c = "h";
vv.l = ccr;
vv.pd = gd;
vv.nm = nm;
pv = new LoadVars();
pv.onLoad = function () {
_parent.startMain();
};
vv.sendAndLoad(("http://" + _root.dm) + "/copter/copter.php", pv);
}
nameBox.restrict = "A-Za-z0-9";
okBtn.graphics.attachMovie("okGraphic", "g", ++okBtn.graphics.dep);
okBtn.clicked = function () {
ok();
};