Frame 1
stop();
Instance of Symbol 33 MovieClip "loader_mc" in Frame 1
onClipEvent (enterFrame) {
tkb = _root.getBytesTotal();
scale = Math.ceil((_root.getBytesLoaded() / tkb) * 100);
this.gotoAndStop(scale);
trace(scale);
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_root.gotoAndStop(2);
}
}
Frame 2
_global.atlasTag = function (clickTag) {
_root.loadVariables("http://switch.atdmt.com/action/Flight_Sim_" + clickTag);
};
atlasTag("Game_Homepage");
click1_sound = new Sound();
click1_sound.attachSound("button2");
_root.click1_sound.setVolume(100);
_root.URL = "http://highscore.amnesia.com.au/";
var StartDragX = drag_mc._x;
var StartDragY = drag_mc._y;
var StartPlaneX = plane_mc._x;
var StartPlaneY = plane_mc._y;
var StartScreenY = 0;
var StartScreenX = 772;
var StartLeagueX = resultsLeague_mc._x;
var StartLeagueY = resultsLeague_mc._y;
var windowStartX = window_mc._x;
var windowStartY = window_mc._y;
var StartGrassX = 0;
var StartGrassY = 0;
var StartPlaneShadX = planeShadow_mc._x;
var StartPlaneShadY = planeShadow_mc._y;
var StartSkyX = skyMain_mc._x;
var StartSkyY = skyMain_mc._y;
planeShadow_mc._alpha = 0;
var StageSizeX = 770;
var StageSizeY = 460;
var draglimitXMin = 0;
var draglimitXMax = StageSizeX;
var draglimitYMin = 0;
var draglimitYMax = StageSizeY;
var easeBack = mx.transitions.easing.Strong.easeInOut;
var transitionTime = 50;
var smallSize = 30;
var planeletgo = false;
var letgo = false;
var hitLimitY = false;
var affectAllY = false;
var restrictSkyYMovement = false;
var recover = false;
var stalling = false;
var looping = false;
var gamePaused = true;
var inLeague = false;
var enterPlane = false;
var fanPower = 3;
var ventPower = 5;
var distMeter = 0;
var vx = 0;
var vy = 0;
var Newy = 0;
var Newx = 0;
var ReleaseLocX = 0;
var ReleaseLocY = 0;
var LocX = 0;
var LocY = 0;
var distX = 0;
var distY = 0;
var rNew = 0;
var uplift = 0;
var diff = 0;
var SpeedMain = 0;
var Speed1 = 0.043;
var Speed2 = 0.04;
var Speed2b = 0.02;
var Speed3 = 0.01;
var Speed4 = 0.008;
var SpeedX = 0;
var SpeedY = 0;
var SpeedFactor = 0;
var XSpeedRatio = 1.5;
var YSpeedRatio = 0.1;
var outsideYScale = 1.3;
var outsideXScale = 1;
var SpeedMax = 1000;
var SpeedMultiplier = 1;
var stallSpeed = 100;
var loopSpeed = 8;
var constantUplift = 0.09;
var changeRotation = 0;
var initialUpCurve = 0.005;
var verticalChange = 0;
var gravity = 1;
var gravityAcceleration = 0.05;
var wallCollisions = 0;
var roofCollisions = 0;
var fanCollisions = 0;
var upDraftCollisions = 0;
var downDraftCollisions = 0;
var floorCollisions = 0;
var grassUpDraftCollisions = 0;
var grassDownDraftCollisions = 0;
var grassFloorCollisions = 0;
var grassRoofCollisions = 0;
var grassWallCollisions = 0;
var collisionNumber = 10;
_global.frame = 1;
_global.init = function (id) {
atlasTag("Play_Game");
score_txt.text = "";
fanPower = 2;
ventPower = 3;
distMeter = 0;
gravity = 1;
SpeedX = 0;
SpeedY = 0;
SpeedFactor = 0;
vx = 0;
vy = 0;
Newy = 0;
Newx = 0;
ReleaseLocX = 0;
ReleaseLocY = 0;
LocX = 0;
LocY = 0;
distX = 0;
distY = 0;
rNew = 0;
uplift = 0;
diff = 0;
planeHandle_mc._x = 84;
planeHandle_mc._y = 192;
jet_mc.gotoAndStop(1);
plane_mc.gotoAndStop(1);
planeShadow_mc.gotoAndStop(1);
all_elements_mc.planeShadow_mc.gotoAndStop(1);
plane_mc._alpha = 100;
plane_mc._visible = true;
window_mc._alpha = 100;
planeShadow_mc._alpha = 0;
distometer_mc._alpha = 0;
drag_mc._x = StartDragX;
drag_mc._y = StartDragY;
plane_mc._x = StartPlaneX;
plane_mc._xscale = 100;
plane_mc._yscale = 100;
plane_mc._rotation = 0;
plane_mc._y = StartPlaneY;
skyMain_mc._x = StartSkyX;
skyMain_mc._y = StartSkyY;
all_elements_mc._x = StartScreenX;
all_elements_mc._y = StartScreenY;
resultsLeague_mc._x = StartLeagueX;
resultsLeague_mc._y = StartLeagueY;
window_mc._x = windowStartX;
window_mc._y = windowStartY;
all_elements_mc.floor_mc._x = 0;
all_elements_mc.grass_mc._x = StartGrassX;
all_elements_mc.wall_mc._x = 0;
all_elements_mc.trees_mc._x = 0;
all_elements_mc.city_mc._x = 0;
all_elements_mc.floor_mc._y = 0;
all_elements_mc.grass_mc._y = StartGrassY;
all_elements_mc.wall_mc._y = 0;
all_elements_mc.trees_mc._y = 0;
all_elements_mc.city_mc._y = 0;
planeShadow_mc._x = StartPlaneShadX;
all_elements_mc.planeShadow_mc._y = 1000;
planeletgo = false;
letgo = false;
hitLimitY = false;
affectAllY = false;
restrictSkyYMovement = false;
recover = false;
stalling = false;
looping = false;
gamePaused = true;
enterPlane = false;
resultsLeague_mc._alpha = 100;
if (id != undefined) {
inLeague = true;
resultsLeague_mc.gotoAndStop("leagueHome");
} else {
inLeague = false;
resultsLeague_mc.gotoAndStop(1);
}
loop_sound.gotoAndPlay(2);
};
init();
var my_so = SharedObject.getLocal("bestDist");
if (my_so.data.bestDistSave != undefined) {
_global.bestDist = my_so.data.bestDistSave;
}
_global.saveData = function (param_bestDist) {
var _local1 = SharedObject.getLocal("bestDist");
_local1.data.bestDistSave = param_bestDist;
_local1.flush();
};
_global.planeLanded = function () {
var _local1 = _global;
outdoor_sound.gotoAndStop(1);
if (((((bestDist != undefined) && (bestDist != undefined)) && (bestDist != "")) && (bestDist != null)) && (bestDist != "null")) {
if (Number(distMeter) > Number(bestDist)) {
_local1.bestDist = distMeter;
_local1.bestDist_Display = bestDist + "m";
saveData(distMeter);
} else {
_local1.bestDist_Display = bestDist + "m";
}
} else {
_local1.bestDist = distMeter;
_local1.bestDist_Display = bestDist + "m";
saveData(distMeter);
}
if (enterPlane) {
jet_mc.gotoAndPlay(2);
}
distometer_mc._alpha = 0;
resultsLeague_mc._x = StartLeagueX;
resultsLeague_mc._y = StartLeagueY;
new mx.transitions.Tween(resultsLeague_mc, "_alpha", easeBack, resultsLeague_mc._alpha, 100, transitionTime);
new mx.transitions.Tween(window_mc, "_alpha", easeBack, window_mc._alpha, 0, transitionTime);
if (inLeague) {
resultsLeague_mc.gotoAndStop("startGame");
} else {
resultsLeague_mc.gotoAndStop("startSingleGame");
}
};
endGame = function (landType) {
var _local1 = landType;
Mouse.show();
gamePaused = true;
plane_mc._rotation = 0;
plane_mc.gotoAndPlay(_local1);
loop_sound.gotoAndPlay(2);
all_elements_mc.planeShadow_mc.gotoAndPlay(_local1);
window_mc._alpha = 0;
if (_local1 == "floor") {
if (Number(distMeter) > 20) {
yeah_sound.gotoAndPlay(2);
} else {
boo_sound.gotoAndPlay(2);
}
planeShadow_mc.gotoAndPlay(_local1);
} else {
boo_sound.gotoAndPlay(2);
planeShadow_mc._alpha = 0;
}
};
directionCheck = function (val, r) {
var _local1 = r;
if (_local1 <= 0) {
if (_local1 >= -90) {
Newy = _local1 / 90;
Newx = (90 + _local1) / 90;
} else {
Newy = (-(180 + _local1)) / 90;
Newx = (_local1 + 90) / 90;
}
} else if (_local1 <= 90) {
Newy = _local1 / 90;
Newx = (90 - _local1) / 90;
} else {
Newy = (180 - _local1) / 90;
Newx = (-(_local1 - 90)) / 90;
}
if (val == "xval") {
return(Newx);
}
if (val == "yval") {
return(Newy);
}
return(undefined);
};
resultsLeague_mc.bigButton_mc.onRelease = function () {
if ((!planeletgo) && (this._parent._currentframe <= 2)) {
trace("LETGO");
letgo = true;
}
};
resultsLeague_mc.bigButton_mc.useHandCursor = false;
planeHandle_mc.onPress = function () {
var _local1 = this._parent.resultsLeague_mc.bigButton_mc;
if ((!planeletgo) && (_local1._parent._currentframe <= 2)) {
planeHandle_mc._x = -500;
planeHandle_mc._y = -500;
new mx.transitions.Tween(_local1._parent.grab_hand_mc, "_alpha", easeBack, _local1._parent.grab_hand_mc._alpha, 0, transitionTime / 10);
gamePaused = false;
new mx.transitions.Tween(_local1._parent._parent.plane_mc, "_alpha", easeBack, _local1._parent._parent.plane_mc._alpha, 100, transitionTime / 10);
_local1._parent._parent.planeShadow_mc._alpha = 20;
new mx.transitions.Tween(_local1._parent._parent.plane_mc, "_xscale", easeBack, _local1._parent._parent.plane_mc._xscale, smallSize, transitionTime / 10);
new mx.transitions.Tween(_local1._parent._parent.plane_mc, "_yscale", easeBack, _local1._parent._parent.plane_mc._yscale, smallSize, transitionTime / 10);
new mx.transitions.Tween(_local1._parent._parent.planeShadow_mc, "_xscale", easeBack, _local1._parent._parent.planeShadow_mc._xscale, smallSize, transitionTime / 10);
new mx.transitions.Tween(_local1._parent._parent.planeShadow_mc, "_yscale", easeBack, _local1._parent._parent.planeShadow_mc._yscale, smallSize, transitionTime / 10);
_local1._parent._parent.office_sound.play();
_local1._parent._parent.loop_sound.gotoAndStop(1);
new mx.transitions.Tween(_local1._parent._parent.resultsLeague_mc, "_alpha", easeBack, _local1._parent._parent.resultsLeague_mc._alpha, 0, transitionTime / 2);
letgo = false;
startDrag (_local1._parent._parent.drag_mc, true, draglimitXMin, draglimitYMin, draglimitXMax, draglimitYMax);
Mouse.hide();
}
};
plane_mc.onEnterFrame = function () {
if (random(100) > 80) {
this.planeTilt_mc.play();
this._parent.planeHandle_mc.play();
}
if (planeShadow_mc._y < this._y) {
planeShadow_mc._y = this._y;
}
this._parent.planeShadow_mc._xscale = 30 - (Math.abs(this._rotation) / 7);
this._parent.planeShadow_mc._x = this._x;
if (!gamePaused) {
vx = directionCheck("xval", this._rotation);
vy = directionCheck("yval", this._rotation);
if ((!planeletgo) && (resultsLeague_mc._currentframe <= 2)) {
ReleaseLocX = this._parent.drag_mc._x;
ReleaseLocY = this._parent.drag_mc._y;
distX = ReleaseLocX - LocX;
distY = ReleaseLocY - LocY;
this._x = (this._x + this._parent.drag_mc._x) / 2;
this._y = (this._y + this._parent.drag_mc._y) / 2;
LocX = this._x;
LocY = this._y;
SpeedFactor = Math.sqrt((distX * distX) + (distY * distY)) * SpeedMultiplier;
if (SpeedFactor < 10) {
SpeedFactor = 10;
}
if (distX > 0) {
rNew = (90 * distY) / SpeedFactor;
} else {
rNew = 0;
}
this._rotation = Math.round(rNew);
uplift = SpeedFactor * initialUpCurve;
if ((this._parent.drag_mc._x >= (draglimitXMax - 200)) || (letgo)) {
stopDrag();
this._parent.distometer_mc._alpha = 100;
window_mc._alpha = 100;
planeletgo = true;
}
} else {
uplift = uplift * 0.95;
diff = diff * 0.95;
if (uplift <= 0) {
uplift = 0;
}
if (diff >= 20) {
diff = 20;
}
changeRotation = uplift - diff;
this._rotation = this._rotation - changeRotation;
if (stalling) {
SpeedFactor = SpeedFactor + 20;
gravity = 0;
uplift = 0;
diff = 2;
stalling = false;
}
if (looping) {
gravity = 0;
SpeedFactor = SpeedFactor + 5;
uplift = loopSpeed;
diff = 0;
looping = false;
}
if (recover) {
if (changeRotation < 1) {
diff = 0;
uplift = uplift + constantUplift;
}
if (vy < -0.1) {
recover = false;
}
}
if (vx > 0) {
if (vy <= 0) {
gravity = 0;
SpeedFactor = SpeedFactor + (vy * 15);
diff = diff + gravityAcceleration;
if ((changeRotation < 1) && (SpeedFactor <= stallSpeed)) {
stalling = true;
}
} else {
SpeedFactor = SpeedFactor + (vy * 2);
if (vy >= 0.5) {
recover = true;
} else {
diff = diff + gravityAcceleration;
}
}
} else if (vx <= 0) {
if (changeRotation < 5) {
looping = true;
}
}
SpeedX = (vx * SpeedFactor) * XSpeedRatio;
SpeedY = (vy * SpeedFactor) * YSpeedRatio;
if (SpeedX < -100) {
SpeedX = -100;
}
if (SpeedX > 1000) {
SpeedX = 1000;
}
if (SpeedFactor <= stallSpeed) {
SpeedFactor = stallSpeed;
}
if (SpeedFactor >= SpeedMax) {
SpeedFactor = SpeedMax;
}
if (this._xscale <= (smallSize + 20)) {
var j = 1;
while (j <= upDraftCollisions) {
var draftNameUp = this._parent.all_elements_mc.wall_mc[("collisionUpDraft" + j) + "_mc"];
if (draftNameUp.hitTest(this.collision_mc)) {
diffUY = (this._y - (draftNameUp._y - draftNameUp._height)) / draftNameUp._height;
SpeedFactor = SpeedFactor + Math.abs((ventPower * diffUY) * 10);
uplift = uplift + (ventPower * diffUY);
}
j++;
}
var j = 1;
while (j <= downDraftCollisions) {
var draftNameDown = this._parent.all_elements_mc.wall_mc[("collisionDownDraft" + j) + "_mc"];
if (draftNameDown.hitTest(this.collision_mc)) {
diffUY = ((draftNameDown._y + draftNameDown._height) - this._y) / draftNameDown._height;
SpeedFactor = SpeedFactor + Math.abs((fanPower * diffUY) * 10);
uplift = uplift - (fanPower * diffUY);
}
j++;
}
var j = 0;
while (j <= wallCollisions) {
var draftNameCollision = this._parent.all_elements_mc.wall_mc[("collisionWall" + j) + "_mc"];
if (draftNameCollision.hitTest(this.collision_mc)) {
SpeedFactor = 0;
uplift = 0;
gravity = 0;
diff = 0;
SpeedX = 0;
SpeedY = 0;
endGame("wall");
}
j++;
}
var j = 0;
while (j <= floorCollisions) {
var draftNameCollision = this._parent.all_elements_mc.wall_mc[("collisionFloor" + j) + "_mc"];
if (draftNameCollision.hitTest(this.collision_mc)) {
SpeedFactor = 0;
uplift = 0;
gravity = 0;
diff = 0;
SpeedX = 0;
SpeedY = 0;
endGame("floor");
}
j++;
}
var j = 1;
while (j <= roofCollisions) {
var draftNameCollision = this._parent.all_elements_mc.wall_mc[("collisionRoof" + j) + "_mc"];
if (draftNameCollision.hitTest(this.collision_mc)) {
SpeedFactor = 0;
uplift = 0;
gravity = 0;
diff = 0;
SpeedX = 0;
SpeedY = 0;
trace("ROOF");
endGame("tumble");
}
j++;
}
var j = 1;
while (j <= fanCollisions) {
var draftNameCollision = this._parent.all_elements_mc.wall_mc[("collisionFan" + j) + "_mc"];
if (draftNameCollision.hitTest(this.collision_mc)) {
SpeedFactor = 0;
uplift = 0;
gravity = 0;
diff = 0;
SpeedX = 0;
SpeedY = 0;
endGame("fan");
}
j++;
}
var j = 1;
while (j <= grassUpDraftCollisions) {
var draftNameUp = this._parent.all_elements_mc.grass_mc[("collisionUpDraft" + j) + "_mc"];
if (draftNameUp.hitTest(this.collision_mc)) {
diffUY = (this._y - (draftNameUp._y - draftNameUp._height)) / draftNameUp._height;
SpeedFactor = SpeedFactor + Math.abs((ventPower * diffUY) * 10);
uplift = uplift + (ventPower * diffUY);
}
j++;
}
var j = 1;
while (j <= grassDownDraftCollisions) {
var draftNameDown = this._parent.all_elements_mc.grass_mc[("collisionDownDraft" + j) + "_mc"];
if (draftNameDown.hitTest(this.collision_mc)) {
diffUY = ((draftNameDown._y + draftNameDown._height) - this._y) / draftNameDown._height;
SpeedFactor = SpeedFactor + Math.abs((fanPower * diffUY) * 10);
uplift = uplift - (fanPower * diffUY);
}
j++;
}
var j = 0;
while (j <= grassWallCollisions) {
var draftNameCollision = this._parent.all_elements_mc.grass_mc[("collisionWall" + j) + "_mc"];
if (draftNameCollision.hitTest(this.collision_mc)) {
SpeedFactor = 0;
uplift = 0;
gravity = 0;
diff = 0;
SpeedX = 0;
SpeedY = 0;
endGame("wall");
}
j++;
}
var j = 1;
while (j <= grassRoofCollisions) {
var draftNameCollision = this._parent.all_elements_mc.grass_mc[("collisionRoof" + j) + "_mc"];
trace(draftNameCollision);
if (draftNameCollision.hitTest(this.collision_mc)) {
SpeedFactor = 0;
uplift = 0;
gravity = 0;
diff = 0;
SpeedX = 0;
SpeedY = 0;
trace("ROOF");
endGame("tumble");
}
j++;
}
var j = 1;
while (j <= grassFloorCollisions) {
var draftNameCollision = this._parent.all_elements_mc.grass_mc[("collisionFloor" + j) + "_mc"];
if (draftNameCollision.hitTest(this._x, this._y, true)) {
SpeedFactor = 0;
uplift = 0;
gravity = 0;
diff = 0;
SpeedX = 0;
SpeedY = 0;
endGame("floor");
enterPlane = true;
}
j++;
}
}
if (this._parent.all_elements_mc.wall_mc.window_mc.hitTest(this.collision_mc)) {
affectAllY = true;
}
gravity = gravity + gravityAcceleration;
if (gravity >= 3) {
gravity = 3;
}
if (!affectAllY) {
this._y = this._y + (SpeedY + gravity);
this._parent.all_elements_mc.floor_mc._x = this._parent.all_elements_mc.floor_mc._x - (Speed1 * SpeedX);
this._parent.all_elements_mc.wall_mc._x = this._parent.all_elements_mc.wall_mc._x - (Speed2 * SpeedX);
this._parent.window_mc._x = this._parent.window_mc._x - (Speed2 * SpeedX);
this._parent.all_elements_mc.grass_mc._x = this._parent.all_elements_mc.grass_mc._x - (Speed2 * SpeedX);
this._parent.all_elements_mc.trees_mc._x = this._parent.all_elements_mc.trees_mc._x - (Speed2 * SpeedX);
this._parent.all_elements_mc.city_mc._x = this._parent.all_elements_mc.city_mc._x - (Speed2 * SpeedX);
this._parent.all_elements_mc.planeShadow_mc._y = 1000;
} else {
if (this._parent.outdoor_sound._currentframe == 1) {
this._parent.outdoor_sound.gotoAndPlay(2);
}
this._parent.office_sound.gotoAndStop(1);
this._parent.planeShadow_mc._alpha = 0;
this._y = this._y + ((SpeedY + gravity) * 0.05);
SpeedFactor = SpeedFactor - 0.5;
this._parent.all_elements_mc.floor_mc._x = this._parent.all_elements_mc.floor_mc._x - ((Speed1 * SpeedX) * outsideXScale);
this._parent.all_elements_mc.grass_mc._x = this._parent.all_elements_mc.grass_mc._x - ((Speed2 * SpeedX) * outsideXScale);
this._parent.all_elements_mc.wall_mc._x = this._parent.all_elements_mc.wall_mc._x - ((Speed2 * SpeedX) * outsideXScale);
this._parent.window_mc._x = this._parent.window_mc._x - ((Speed2 * SpeedX) * outsideXScale);
this._parent.all_elements_mc.trees_mc._x = this._parent.all_elements_mc.trees_mc._x - ((Speed3 * SpeedX) * outsideXScale);
this._parent.all_elements_mc.city_mc._x = this._parent.all_elements_mc.city_mc._x - ((Speed4 * SpeedX) * outsideXScale);
this._parent.skyMain_mc._x = this._parent.skyMain_mc._x - (((Speed4 * SpeedX) * outsideXScale) / 2);
this._parent.all_elements_mc.planeShadow_mc._x = -(draglimitXMax / 2);
this._parent.all_elements_mc.planeShadow_mc._xscale = 30 - (Math.abs(this._rotation) / 7);
verticalChange = outsideYScale * ((Speed2 * SpeedY) + gravity);
if (verticalChange > 0) {
this._parent.all_elements_mc.floor_mc._y = this._parent.all_elements_mc.floor_mc._y - verticalChange;
this._parent.all_elements_mc.grass_mc._y = this._parent.all_elements_mc.grass_mc._y - verticalChange;
this._parent.all_elements_mc.wall_mc._y = this._parent.all_elements_mc.wall_mc._y - verticalChange;
this._parent.window_mc._y = this._parent.window_mc._y - verticalChange;
this._parent.all_elements_mc.trees_mc._y = this._parent.all_elements_mc.trees_mc._y - verticalChange;
this._parent.all_elements_mc.city_mc._y = this._parent.all_elements_mc.city_mc._y - verticalChange;
this._parent.skyMain_mc._y = this._parent.skyMain_mc._y - (verticalChange / 3);
}
c = 2;
p = 1;
while (Number(c) <= Number(collisionNumber)) {
testX = this._x;
testY = this._y;
collision1x = (eval ("this._parent.all_elements_mc.grass_mc.collision" + p)._x + this._parent.all_elements_mc.grass_mc._x) + this._parent.all_elements_mc._x;
collision1y = (eval ("this._parent.all_elements_mc.grass_mc.collision" + p)._y + this._parent.all_elements_mc.grass_mc._y) + this._parent.all_elements_mc._y;
collision2x = (eval ("this._parent.all_elements_mc.grass_mc.collision" + c)._x + this._parent.all_elements_mc.grass_mc._x) + this._parent.all_elements_mc._x;
collision2y = (eval ("this._parent.all_elements_mc.grass_mc.collision" + c)._y + this._parent.all_elements_mc.grass_mc._y) + this._parent.all_elements_mc._y;
collisionH = collision2y - collision1y;
if (Number(collisionH) < 0) {
collisionH = -collisionH;
}
collisionL = collision2x - collision1x;
if (Number(testX) >= Number(collision1x)) {
if (Number(testX) < Number(collision2x)) {
if (Number(collision1y) == Number(collision2y)) {
collisionFloor = collision1y;
}
if (Number(collision2y) > Number(collision1y)) {
collisionFloor = Number(collision1y) + Number(collisionH * ((testX - collision1x) / collisionL));
}
if (Number(collision1y) > Number(collision2y)) {
collisionFloor = collision1y - (collisionH * ((testX - collision1x) / collisionL));
}
if (Number(testY) >= Number(collisionFloor)) {
crashed = 1;
}
}
}
c = Number(c) + 1;
p = c - 1;
}
this._parent.all_elements_mc.planeShadow_mc._y = collisionFloor + 10;
}
distMeter = Math.abs(this._parent.all_elements_mc.wall_mc._x / 150);
distMeter = Math.round(distMeter * 1000) / 1000;
if (this._y < 20) {
this._y = 20;
SpeedY = 0;
} else if (this._y >= StageSizeY) {
this._y >= StageSizeY;
hitLimitY = true;
}
if (this._x < 50) {
SpeedX = SpeedX / 2;
} else if (this._x > (StageSizeX - 50)) {
this._x = StageSizeX - 50;
SpeedX = 0;
}
this._x = this._x - ((this._x - (draglimitXMax / 2)) / 50);
}
}
};
_global.convertNumberDisplay = function (param_number) {
var _local2 = param_number;
if (_local2 < 0) {
number_str = String(_local2 * -1);
} else {
number_str = String(_local2);
}
convertedNumber_str = "";
commaCount = 0;
var _local1 = number_str.length - 1;
while (_local1 >= 0) {
commaCount++;
if (((commaCount % 3) == 0) and (_local1 > 0)) {
convertedNumber_str = ("," + number_str.charAt(_local1)) + convertedNumber_str;
} else {
convertedNumber_str = number_str.charAt(_local1) + convertedNumber_str;
}
_local1--;
}
if (_local2 < 0) {
convertedNumber_str = "-" + convertedNumber_str;
}
return(convertedNumber_str);
};
_global.checkID = function (id) {
trace("checking ID");
resultsLeague_mc.loader_mc._visible = true;
var _local1 = new sForm();
_local1.action = _root.URL + "League.asmx/CheckID";
_local1.actionType = "POST";
_local1.addField("id", id, "variable");
_local1.onLoad = function (success, answer) {
resultsLeague_mc.loader_mc._visible = false;
if (success && (answer.result == 0)) {
if (success && (answer.result == 0)) {
resultsLeague_mc.gotoAndStop("leagueHome");
}
}
};
_local1.submit(true);
};
_global.getGameCount = function () {
resultsLeague_mc.loader_mc._visible = true;
var _local1 = new sForm();
_local1.action = URL + "Play.asmx/GameCount";
_local1.actionType = "POST";
_local1.onLoad = function (success, answer) {
resultsLeague_mc.loader_mc._visible = false;
if (success) {
count = convertNumberDisplay(answer.count);
resultsLeague_mc.grab_hand_mc.gamesPlayed_mc.count_txt.text = count;
resultsLeague_mc.tips_mc.gamesPlayed_txt.text = ("Did you know " + count) + " paper planes have been thrown so far? ";
resultsLeague_mc.grab_hand_mc.gamesPlayed_mc.games_txt.text = "Games Played:";
}
};
_local1.submit(true);
};
getWinURL = function () {
win_xml = new XML();
win_xml.ignoreWhite = true;
win_xml.onLoad = function () {
link_array = mx.xpath.XPathAPI.selectNodeList(this.firstChild, "/compLink/link");
_global.winLink = link_array[0].firstChild.nodeValue;
_global.tellAFriend_link = "mailto: ?subject=FlightSim X Game&body=I just found this awesome paper plane throwing game. \n\nThought you might like it. Enjoy! \n\n" + link_array[1].firstChild.nodeValue;
};
win_xml.load("comp_url.xml");
};
getWinURL();
_global.getGlobalRank = function (score) {
trace("try to get Global Rank.... " + score);
var _local1 = new sForm();
_local1.action = _root.URL + "Play.asmx/TotalGamesRank";
_local1.actionType = "POST";
_local1.addField("points", score, "variable");
_local1.onLoad = function (success, answer) {
var _local1 = answer;
if (success) {
trace("global rank:" + _local1.ranking);
resultsLeague_mc.rank_txt.text = _local1.ranking;
resultsLeague_mc.grab_hand_mc.best_mc.global_txt.text = "Global Rank:";
resultsLeague_mc.grab_hand_mc.best_mc.rank_txt.text = convertNumberDisplay(_local1.ranking);
resultsLeague_mc.grab_hand_mc.best_mc.bestScore_txt.text = (score / 1000) + "m";
resultsLeague_mc.grab_hand_mc.best_mc.yourBest_txt.text = "Your Best:";
} else {
trace("error get global rank");
}
};
_local1.submit(true);
};
stop();
Instance of Symbol 311 MovieClip "sound_mc" in Frame 2
onClipEvent (load) {
volumeDisplay.gotoAndStop(1);
}
on (release) {
if (_currentframe == 1) {
_root.click1_sound.setVolume(0);
gotoAndStop (2);
} else {
_root.click1_sound.setVolume(50);
gotoAndStop (1);
}
}
on (rollOver) {
volumeDisplay.gotoAndStop(2);
}
on (rollOut, dragOut) {
volumeDisplay.gotoAndStop(1);
}
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 100
stop();
Symbol 312 MovieClip [__Packages.sForm] Frame 0
class sForm extends Object
{
var responseType, _fields;
function sForm () {
super();
responseType = "POST";
_fields = new Object();
}
function addField(name, obj, type) {
var _local1 = this;
var _local3 = type;
var _local2 = false;
for (var t in _local1._types) {
if (_local1._types[t] == _local3) {
_local2 = true;
continue;
}
}
if (!_local2) {
return(false);
}
_local1._fields[name] = {};
_local1._fields[name].type = _local3;
_local1._fields[name].obj = obj;
return(undefined);
}
function submit(send) {
var _local1 = this;
var errorFields = 0;
for (var id in _local1._fields) {
var type = _local1._fields[id].type;
if (type != "variable") {
var _local3 = _local1._fields[id].obj.text;
} else {
var _local3 = _local1._fields[id].obj;
}
var _local2 = false;
switch (type) {
case "text" :
_local2 = _local1.checkText(_local3);
break;
case "numeric" :
_local2 = _local1.checkNumeric(_local3);
break;
case "zip" :
_local2 = _local1.checkZip(_local3);
break;
default :
_local2 = true;
}
if (!_local2) {
errorFields++;
_local1.onError(id);
}
}
if (!send) {
if (errorFields == 0) {
return(true);
}
return(false);
}
if (errorFields == 0) {
_local1.submitData();
}
return(undefined);
}
function onLoad() {
}
function onError() {
}
function submitData() {
var _local1 = this;
if (_local1.responseType == "XML") {
var result_lv = new XML();
} else {
var result_lv = new LoadVars();
}
var send_lv = new LoadVars();
var _this = _local1;
result_lv.onLoad = function (success) {
_this.onLoad(success, result_lv);
};
for (var id in _local1._fields) {
var _local3 = _local1._fields[id].type;
if (_local3 != "variable") {
var _local2 = _local1._fields[id].obj.text;
} else {
var _local2 = _local1._fields[id].obj;
}
send_lv[id] = _local2;
}
send_lv.sendAndLoad(_local1.action, result_lv, _local1.action);
}
function checkNumeric(value) {
return(!isNaN(value));
}
function checkText(value) {
return(value.length > 0);
}
function checkZip(value) {
return((value.length == 4) && (!isNaN(value)));
}
var _types = Array("text", "numeric", "zip", "variable");
}
Symbol 313 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local2 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local2);
var _local1 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local1.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 314 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
var _local1 = o;
if (_local1.broadcastMessage != undefined) {
delete _local1.broadcastMessage;
}
_local1.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
_local1.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
_local1._listeners = new Array();
}
}
function addListener(o) {
var _local1 = this;
_local1.removeListener(o);
if (_local1.broadcastMessage == undefined) {
_local1.broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_local1._listeners.push(o));
}
function removeListener(o) {
var _local3 = this;
var _local1 = _local3._listeners;
var _local2 = _local1.length;
while (_local2--) {
if (_local1[_local2] == o) {
_local1.splice(_local2, 1);
if (!_local1.length) {
_local3.broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local3 = String(arguments.shift());
var _local2 = _listeners.concat();
var l = _local2.length;
var _local1 = 0;
while (_local1 < l) {
_local2[_local1][_local3].apply(_local2[_local1], arguments);
_local1++;
}
}
static var version = "1.1.0.52";
}
Symbol 315 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var _time, _duration, _fps, change, begin;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
var _local1 = this;
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
} else {
_local1.obj = obj;
_local1.prop = prop;
_local1.begin = begin;
_local1.__set__position(begin);
_local1.__set__duration(duration);
_local1.useSeconds = useSeconds;
if (func) {
_local1.func = func;
}
_local1.__set__finish(finish);
_local1._listeners = [];
_local1.addListener(_local1);
_local1.start();
}
}
function set time(t) {
var _local1 = this;
var _local2 = t;
_local1.prevTime = _local1._time;
if (_local2 > _local1.__get__duration()) {
if (_local1.looping) {
_local1.rewind(_local2 - _local1._duration);
_local1.update();
_local1.broadcastMessage("onMotionLooped", _local1);
} else {
if (_local1.useSeconds) {
_local1._time = _local1._duration;
_local1.update();
}
_local1.stop();
_local1.broadcastMessage("onMotionFinished", _local1);
}
} else if (_local2 < 0) {
_local1.rewind();
_local1.update();
} else {
_local1._time = _local2;
_local1.update();
}
//return(_local1.__get__time());
}
function get time() {
return(_time);
}
function set duration(d) {
var _local1 = d;
_duration = (((_local1 == null) || (_local1 <= 0)) ? (_global.Infinity) : (_local1));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local1 = this;
var _local2 = _local1.isPlaying;
_local1.stopEnterFrame();
_local1._fps = fps;
if (_local2) {
_local1.startEnterFrame();
}
//return(_local1.__get__FPS());
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
var _local1 = this;
_local1.prevPos = _local1._pos;
_local1.obj[_local1.prop] = (_local1._pos = p);
_local1.broadcastMessage("onMotionChanged", _local1, _local1._pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
var _local1 = this;
var _local2 = t;
if (_local2 == undefined) {
_local2 = _local1._time;
}
return(_local1.func(_local2, _local1.begin, _local1.change, _local1._duration));
}
function set finish(f) {
var _local1 = this;
_local1.change = f - _local1.begin;
//return(_local1.__get__finish());
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
var _local1 = this;
_local1.begin = _local1.position;
_local1.__set__finish(finish);
if (duration != undefined) {
_local1.__set__duration(duration);
}
_local1.start();
}
function yoyo() {
var _local1 = this;
_local1.continueTo(_local1.begin, _local1.__get__time());
}
function startEnterFrame() {
var _local1 = this;
if (_local1._fps == undefined) {
_global.MovieClip.addListener(_local1);
} else {
_local1._intervalID = setInterval(_local1, "onEnterFrame", 1000 / _local1._fps);
}
_local1.isPlaying = true;
}
function stopEnterFrame() {
var _local1 = this;
if (_local1._fps == undefined) {
_global.MovieClip.removeListener(_local1);
} else {
clearInterval(_local1._intervalID);
}
_local1.isPlaying = false;
}
function start() {
var _local1 = this;
_local1.rewind();
_local1.startEnterFrame();
_local1.broadcastMessage("onMotionStarted", _local1);
}
function stop() {
var _local1 = this;
_local1.stopEnterFrame();
_local1.broadcastMessage("onMotionStopped", _local1);
}
function resume() {
var _local1 = this;
_local1.fixTime();
_local1.startEnterFrame();
_local1.broadcastMessage("onMotionResumed", _local1);
}
function rewind(t) {
var _local1 = this;
_local1._time = ((t == undefined) ? 0 : (t));
_local1.fixTime();
_local1.update();
}
function fforward() {
var _local1 = this;
_local1.__set__time(_local1._duration);
_local1.fixTime();
}
function nextFrame() {
var _local1 = this;
if (_local1.useSeconds) {
_local1.__set__time((getTimer() - _local1._startTime) / 1000);
} else {
_local1.__set__time(_local1._time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
var _local1 = this;
if (!_local1.useSeconds) {
_local1.__set__time(_local1._time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
var _local1 = this;
if (_local1.useSeconds) {
_local1._startTime = getTimer() - (_local1._time * 1000);
}
}
function update() {
var _local1 = this;
_local1.__set__position(_local1.getPosition(_local1._time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 316 MovieClip [__Packages.mx.transitions.easing.Strong] Frame 0
class mx.transitions.easing.Strong
{
function Strong () {
}
static function easeIn(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / d;
return((((((c * _local1) * _local1) * _local1) * _local1) * _local1) + b);
}
static function easeOut(t, b, c, d) {
var _local1 = t;
_local1 = (_local1 / d) - 1;
return((c * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 1)) + b);
}
static function easeInOut(t, b, c, d) {
var _local1 = t;
_local1 = _local1 / (d / 2);
if (_local1 < 1) {
return(((((((c / 2) * _local1) * _local1) * _local1) * _local1) * _local1) + b);
}
_local1 = _local1 - 2;
return(((c / 2) * (((((_local1 * _local1) * _local1) * _local1) * _local1) + 2)) + b);
}
static var version = "1.1.0.52";
}
Symbol 317 MovieClip [__Packages.mx.xpath.XPathAPI] Frame 0
class mx.xpath.XPathAPI
{
function XPathAPI () {
}
static function getEvalString(node, path) {
var result = "";
var chldNode = null;
var pathSet = getPathSet(path);
var _local3 = pathSet[0].nodeName;
var attrIndx;
var _local2 = node;
var found = false;
if ((_local3 != undefined) && ((_local3 == "*") || (node.nodeName == _local3))) {
var i = 1;
while (i < pathSet.length) {
_local3 = pathSet[i].nodeName;
attrIndx = _local3.indexOf("@");
if (attrIndx >= 0) {
_local3 = _local3.substring(attrIndx + 1);
found = _local2.attributes[_local3] != undefined;
result = result + (".attributes." + _local3);
} else {
found = false;
var _local1 = 0;
while (_local1 < _local2.childNodes.length) {
chldNode = _local2.childNodes[_local1];
if (chldNode.nodeName == _local3) {
result = result + (".childNodes." + _local1);
_local1 = _local2.childNodes.length;
_local2 = chldNode;
found = true;
}
_local1++;
}
}
if (!found) {
return("");
}
i++;
}
if (!found) {
result = "";
} else if (attrIndx == -1) {
result = result + ".firstChild.nodeValue";
}
} else {
result = "";
}
return(result);
}
static function selectNodeList(node, path) {
var _local2 = new Array(node);
var pathSet = getPathSet(path);
var pathInfo = pathSet[0];
var nodeName = pathInfo.__get__nodeName();
var _local1 = null;
if ((nodeName != undefined) && ((nodeName == "*") || (node.nodeName == nodeName))) {
if (pathInfo.__get__filter().length > 0) {
_local1 = new mx.xpath.FilterStack(pathInfo.__get__filter());
_local2 = filterNodes(_local2, _local1);
}
if (_local2.length > 0) {
var _local3 = 1;
while (_local3 < pathSet.length) {
pathInfo = pathSet[_local3];
_local2 = getAllChildNodesByName(_local2, pathInfo.__get__nodeName());
if (pathInfo.__get__filter().length > 0) {
_local1 = new mx.xpath.FilterStack(pathInfo.__get__filter());
} else {
_local1 = null;
}
if ((_local1 != null) && (_local1.__get__exprs().length > 0)) {
_local2 = filterNodes(_local2, _local1);
}
_local3++;
}
}
} else {
_local2 = new Array();
}
return(_local2);
}
static function selectSingleNode(node, path) {
var _local1 = selectNodeList(node, path);
if (_local1.length > 0) {
return(_local1[0]);
}
return(null);
}
static function setNodeValue(node, path, newValue) {
var _local1 = new Array(node);
var pathSet = getPathSet(path);
var attrName = pathSet[pathSet.length - 1].nodeName;
if (attrName.charAt(0) == "@") {
attrName = attrName.substring(1, attrName.length);
pathSet.pop();
} else {
attrName = null;
}
var pathInfo = pathSet[0];
var nodeName = pathInfo.__get__nodeName();
var _local3 = null;
if ((nodeName != undefined) && ((nodeName == "*") || (node.nodeName == nodeName))) {
if (pathInfo.__get__filter().length > 0) {
_local3 = new mx.xpath.FilterStack(pathInfo.__get__filter());
_local1 = filterNodes(_local1, _local3);
}
if (_local1.length > 0) {
var _local2 = 1;
while (_local2 < pathSet.length) {
pathInfo = pathSet[_local2];
_local1 = getAllChildNodesByName(_local1, pathInfo.__get__nodeName());
if (pathInfo.__get__filter().length > 0) {
_local3 = new mx.xpath.FilterStack(pathInfo.__get__filter());
} else {
_local3 = null;
}
if ((_local3 != null) && (_local3.__get__exprs().length > 0)) {
_local1 = filterNodes(_local1, _local3);
}
_local2++;
}
}
} else {
_local1 = new Array();
}
var currNode = null;
var textNode = null;
var doc = new XML();
var _local2 = 0;
while (_local2 < _local1.length) {
if (attrName != null) {
_local1[_local2].attributes[attrName] = newValue;
} else {
currNode = _local1[_local2];
if ((currNode.firstChild == null) || (currNode.firstChild.nodeType != 3)) {
textNode = doc.createTextNode(newValue);
currNode.appendChild(textNode);
} else {
textNode = currNode.firstChild;
textNode.nodeValue = newValue;
}
}
_local2++;
}
return(_local1.length);
}
static function copyStack(toStk, fromStk) {
var _local2 = fromStk;
var _local3 = toStk;
var _local1 = 0;
while (_local1 < _local2.length) {
_local3.splice(_local1, 0, _local2[_local1]);
_local1++;
}
}
static function evalExpr(expr, node) {
var _local1 = expr;
var _local2 = true;
if (_local1.__get__attr()) {
_local2 = ((_local1.__get__value() != null) ? (node.attributes[_local1.__get__name()] == _local1.__get__value()) : (node.attributes[_local1.__get__name()] != null));
} else {
var _local3 = getChildNodeByName(node, _local1.__get__name());
if (_local3 != null) {
_local2 = ((_local1.__get__value() != null) ? (_local3.firstChild.nodeValue == _local1.__get__value()) : true);
} else {
_local2 = false;
}
}
return(_local2);
}
static function filterNodes(nodeList, stack) {
var result = new Array();
var _local2;
var _local3;
var filterExpr1;
var filterExpr2;
var filterBool;
var _local1 = true;
var node;
var cont;
var i = 0;
while (i < nodeList.length) {
cont = true;
_local2 = new Array();
_local3 = new Array();
copyStack(_local2, stack.__get__exprs());
copyStack(_local3, stack.__get__ops());
node = nodeList[i];
while ((_local2.length > 0) && (cont)) {
if (typeof(_local2[_local2.length - 1]) == "object") {
filterExpr1 = _local2.pop();
_local1 = evalExpr(filterExpr1, node);
} else {
filterBool = Boolean(_local2.pop());
_local1 = filterBool;
}
if (_local3.length > 0) {
var temp = _local2.pop();
filterExpr2 = temp;
switch (_local3[_local3.length - 1]) {
case "and" :
_local1 = _local1 && (evalExpr(filterExpr2, node));
cont = _local1;
break;
case "or" :
_local1 = _local1 || (evalExpr(filterExpr2, node));
cont = !_local1;
}
_local3.pop();
_local2.push(_local1);
}
}
if (_local1) {
result.push(node);
}
i++;
}
return(result);
}
static function getAllChildNodesByName(nodeList, name) {
var result = new Array();
var _local2;
var _local3 = 0;
while (_local3 < nodeList.length) {
_local2 = nodeList[_local3].childNodes;
if (_local2 != null) {
var _local1 = 0;
while (_local1 < _local2.length) {
if ((name == "*") || (_local2[_local1].nodeName == name)) {
result.push(_local2[_local1]);
}
_local1++;
}
}
_local3++;
}
return(result);
}
static function getChildNodeByName(node, nodeName) {
var _local2;
var _local3 = node.childNodes;
var _local1 = 0;
while (_local1 < _local3.length) {
_local2 = _local3[_local1];
if (_local2.nodeName == nodeName) {
return(_local2);
}
_local1++;
}
return(null);
}
static function getKeyValues(node, keySpec) {
var result = "";
var _local3 = new mx.utils.StringTokenParser(keySpec);
var _local2 = _local3.nextToken();
var _local1;
var childNode;
while (_local2 != mx.utils.StringTokenParser.tkEOF) {
_local1 = _local3.token;
result = result + (" " + _local1);
if (_local2 == mx.utils.StringTokenParser.tkSymbol) {
if (_local1 == "@") {
_local2 = _local3.nextToken();
_local1 = _local3.token;
if (_local2 == mx.utils.StringTokenParser.tkSymbol) {
result = result + (((_local1 + "='") + node.attributes[_local1]) + "'");
}
} else if (_local1 == "/") {
_local2 = _local3.nextToken();
if (_local2 == mx.utils.StringTokenParser.tkSymbol) {
_local1 = _local3.token;
node = getChildNodeByName(node, _local1);
if (node != null) {
result = result + _local1;
}
}
} else if ((((_local1 != "and") && (_local1 != "or")) && (_local1 != "[")) && (_local1 != "]")) {
childNode = getChildNodeByName(node, _local1);
if (childNode != null) {
result = result + (("='" + childNode.firstChild.nodeValue) + "'");
}
}
}
if (node == null) {
trace(("Invalid keySpec specified. '" + keySpec) + "' Error.");
return("ERR");
}
_local2 = _local3.nextToken();
}
return(result.slice(1));
}
static function getPath(node, keySpecs) {
var _local3 = node;
var _local2 = "";
var keySpec = keySpecs[_local3.nodeName];
if (keySpec == undefined) {
var attrs = "";
var currAttr;
for (var currAttr in _local3.attributes) {
attrs = attrs + (((("@" + currAttr) + "='") + _local3.attributes[currAttr]) + "' and ");
}
var nodeValues = "";
var _local1;
var value;
var i = 0;
while (i < _local3.childNodes.length) {
_local1 = _local3.childNodes[i];
value = _local1.firstChild.nodeValue;
if (value != undefined) {
nodeValues = nodeValues + (((_local1.nodeName + "='") + value) + "' and ");
}
i++;
}
if (attrs.length > 0) {
if (nodeValues.length > 0) {
_local2 = (((("/" + _local3.nodeName) + "[") + attrs) + nodeValues.substring(0, nodeValues.length - 4)) + "]";
} else {
_local2 = ((("/" + _local3.nodeName) + "[") + attrs.substring(0, attrs.length - 4)) + "]";
}
} else {
_local2 = ((("/" + _local3.nodeName) + "[") + nodeValues.substring(0, nodeValues.length - 4)) + "]";
}
} else {
_local2 = _local2 + (("/" + _local3.nodeName) + getKeyValues(_local3, keySpec));
}
var _local1 = _local3.parentNode;
while (_local1.parentNode != null) {
keySpec = keySpecs[_local1.nodeName];
if (keySpec != undefined) {
_local2 = (("/" + _local1.nodeName) + getKeyValues(_local1, keySpec)) + _local2;
} else {
_local2 = ("/" + _local1.nodeName) + _local2;
}
_local1 = _local1.parentNode;
}
return(_local2);
}
static function getPathSet(path) {
var _local3 = path;
var result = new Array();
var index;
var _local1;
var _local2;
var fltr;
while (_local3.length > 0) {
index = _local3.lastIndexOf("/");
_local1 = _local3.substring(index + 1);
_local2 = _local1.indexOf("[", 0);
fltr = ((_local2 >= 0) ? (_local1.substring(_local2 + 1, _local1.length - 1)) : "");
_local1 = ((_local2 >= 0) ? (_local1.substring(0, _local2)) : (_local1));
result.splice(0, 0, new mx.xpath.NodePathInfo(_local1, fltr));
_local3 = _local3.substring(0, index);
}
return(result);
}
}
Symbol 318 MovieClip [__Packages.mx.xpath.NodePathInfo] Frame 0
class mx.xpath.NodePathInfo
{
function NodePathInfo (nodeName, filter) {
__nodeName = nodeName;
__filter = filter;
}
function get nodeName() {
return(__nodeName);
}
function get filter() {
return(__filter);
}
var __nodeName = null;
var __filter = null;
}
Symbol 319 MovieClip [__Packages.mx.xpath.FilterStack] Frame 0
class mx.xpath.FilterStack
{
var __expr, __ops;
function FilterStack (filterVal) {
__expr = new Array();
__ops = new Array();
var _local1 = new mx.utils.StringTokenParser(filterVal);
var kind = _local1.nextToken();
var _local3;
var _local2 = _local1.__get__token();
while (kind != mx.utils.StringTokenParser.tkEOF) {
if (_local2 == "@") {
kind = _local1.nextToken();
_local2 = _local1.token;
_local3 = new mx.xpath.FilterExpr(true, _local2, null);
__expr.splice(0, 0, _local3);
if (_local1.nextToken() == mx.utils.StringTokenParser.tkSymbol) {
if (_local1.__get__token() == "=") {
kind = _local1.nextToken();
_local3.__set__value(_local1.token);
}
}
} else if ((_local2 == "and") || (_local2 == "or")) {
__ops.splice(0, 0, _local2);
} else if ((_local2 != ")") && (_local2 != "(")) {
_local3 = new mx.xpath.FilterExpr(false, _local2, null);
__expr.splice(0, 0, _local3);
if (_local1.nextToken() == mx.utils.StringTokenParser.tkSymbol) {
if (_local1.__get__token() == "=") {
kind = _local1.nextToken();
_local3.__set__value(_local1.token);
}
}
}
kind = _local1.nextToken();
_local2 = _local1.token;
}
}
function get exprs() {
return(__expr);
}
function get ops() {
return(__ops);
}
}
Symbol 320 MovieClip [__Packages.mx.utils.StringTokenParser] Frame 0
class mx.utils.StringTokenParser
{
var _source, _skipChars;
function StringTokenParser (source, skipChars) {
_source = source;
_skipChars = ((skipChars == undefined) ? null : (skipChars));
}
function get token() {
return(_token);
}
function getPos() {
return(_index);
}
function nextToken() {
var _local2 = this;
var i;
var _local1;
var _local3 = _local2._source.length;
_local2.skipBlanks();
if (_local2._index >= _local3) {
return(tkEOF);
}
_local1 = _local2._source.charCodeAt(_local2._index);
if (((((_local1 >= 65) && (_local1 <= 90)) || ((_local1 >= 97) && (_local1 <= 122))) || ((_local1 >= 192) && (_local1 <= Number.POSITIVE_INFINITY))) || (_local1 == 95)) {
i = _local2._index;
_local2._index++;
_local1 = _local2._source.charCodeAt(_local2._index);
while (((((((_local1 >= 65) && (_local1 <= 90)) || ((_local1 >= 97) && (_local1 <= 122))) || ((_local1 >= 48) && (_local1 <= 57))) || ((_local1 >= 192) && (_local1 <= Number.POSITIVE_INFINITY))) || (_local1 == 95)) && (_local2._index < _local3)) {
_local2._index++;
_local1 = _local2._source.charCodeAt(_local2._index);
}
_local2._token = _local2._source.substring(i, _local2._index);
return(tkSymbol);
}
if ((_local1 == 34) || (_local1 == 39)) {
_local2._index++;
i = _local2._index;
_local1 = _local2._source.charCodeAt(i);
while (((_local1 != 34) && (_local1 != 39)) && (_local2._index < _local3)) {
_local2._index++;
_local1 = _local2._source.charCodeAt(_local2._index);
}
_local2._token = _local2._source.substring(i, _local2._index);
_local2._index++;
return(tkString);
}
if ((_local1 == 45) || ((_local1 >= 48) && (_local1 <= 57))) {
var kind = tkInteger;
i = _local2._index;
_local2._index++;
_local1 = _local2._source.charCodeAt(_local2._index);
while (((_local1 >= 48) && (_local1 <= 57)) && (_local2._index < _local3)) {
_local2._index++;
_local1 = _local2._source.charCodeAt(_local2._index);
}
if (_local2._index < _local3) {
if (((((((_local1 >= 48) && (_local1 <= 57)) || (_local1 == 46)) || (_local1 == 43)) || (_local1 == 45)) || (_local1 == 101)) || (_local1 == 69)) {
kind = tkFloat;
}
while ((((((((_local1 >= 48) && (_local1 <= 57)) || (_local1 == 46)) || (_local1 == 43)) || (_local1 == 45)) || (_local1 == 101)) || (_local1 == 69)) && (_local2._index < _local3)) {
_local2._index++;
_local1 = _local2._source.charCodeAt(_local2._index);
}
}
_local2._token = _local2._source.substring(i, _local2._index);
return(kind);
}
_local2._token = _local2._source.charAt(_local2._index);
_local2._index++;
return(tkSymbol);
}
function skipBlanks() {
var _local1 = this;
if (_local1._index < _local1._source.length) {
var _local2 = _local1._source.charAt(_local1._index);
while ((_local2 == " ") || ((_local1._skipChars != null) && (_local1.skipChar(_local2)))) {
_local1._index++;
_local2 = _local1._source.charAt(_local1._index);
}
}
}
function skipChar(ch) {
var _local2 = this;
var _local3 = ch;
var _local1 = 0;
while (_local1 < _local2._skipChars.length) {
if (_local3 == _local2._skipChars[_local1]) {
return(true);
}
_local1++;
}
return(false);
}
static var tkEOF = -1;
static var tkSymbol = 0;
static var tkString = 1;
static var tkInteger = 2;
static var tkFloat = 3;
var _index = 0;
var _token = "";
}
Symbol 321 MovieClip [__Packages.mx.xpath.FilterExpr] Frame 0
class mx.xpath.FilterExpr
{
function FilterExpr (attrInit, nameInit, valueInit) {
var _local1 = this;
_local1.__attr = attrInit;
_local1.__name = nameInit;
_local1.__value = valueInit;
}
function get attr() {
return(__attr);
}
function set attr(newVal) {
__attr = newVal;
//return(attr);
}
function get name() {
return(__name);
}
function set name(newVal) {
__name = newVal;
//return(name);
}
function get value() {
return(__value);
}
function set value(newVal) {
__value = newVal;
//return(value);
}
var __attr = false;
var __value = null;
var __name = null;
}
Symbol 47 MovieClip Frame 1
_parent._parent._parent.grassFloorCollisions++;
this._name = ("collisionFloor" + _parent._parent._parent.grassFloorCollisions) + "_mc";
Symbol 89 MovieClip Frame 1
_parent._parent._parent.wallCollisions++;
this._name = ("collisionWall" + _parent._parent._parent.wallCollisions) + "_mc";
Symbol 90 MovieClip Frame 1
_parent._parent._parent.floorCollisions++;
this._name = ("collisionFloor" + _parent._parent._parent.floorCollisions) + "_mc";
Symbol 91 MovieClip Frame 1
_parent._parent._parent.roofCollisions++;
this._name = ("collisionRoof" + _parent._parent._parent.roofCollisions) + "_mc";
trace("this._name = " + this._name);
Symbol 92 MovieClip Frame 1
_parent._parent._parent.upDraftCollisions++;
this._name = ("collisionUpDraft" + _parent._parent._parent.upDraftCollisions) + "_mc";
Symbol 93 MovieClip Frame 1
_parent._parent._parent.downDraftCollisions++;
this._name = ("collisionDownDraft" + _parent._parent._parent.downDraftCollisions) + "_mc";
Symbol 94 MovieClip Frame 1
_parent._parent._parent.fanCollisions++;
this._name = ("collisionFan" + _parent._parent._parent.fanCollisions) + "_mc";
Symbol 109 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 33
stop();
planeLanded();
Symbol 125 MovieClip Frame 64
stop();
planeLanded();
Symbol 125 MovieClip Frame 93
stop();
planeLanded();
Symbol 125 MovieClip Frame 120
stop();
planeLanded();
Symbol 125 MovieClip Frame 180
stop();
planeLanded();
Symbol 129 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 20
stop();
Symbol 149 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 220 MovieClip Frame 1
stop();
Symbol 233 MovieClip Frame 1
stop();
Symbol 233 MovieClip Frame 2
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 256 MovieClip Frame 1
stop();
Symbol 256 MovieClip Frame 7
getGameCount();
Symbol 261 MovieClip Frame 1
stop();
Symbol 268 MovieClip Frame 1
stop();
msg_txt.text = "";
loader_mc._visible = false;
gamesPlayed_mc.count_txt.text = "";
gamesPlayed_mc.games_txt.text = "";
var st = ((_root.id != undefined) && (_root.id != ""));
if (st) {
checkID(_root.id);
} else {
getGameCount();
}
grab_hand_mc.league_bt.onRelease = function () {
atlasTag("Create_a_League");
_root.plane_mc._visible = false;
gotoAndStop ("register");
};
grab_hand_mc.league_bt.onRollOver = function () {
grab_hand_mc.league_mc.gotoAndStop(2);
};
grab_hand_mc.league_bt.onRollOut = function () {
grab_hand_mc.league_mc.gotoAndStop(1);
};
grab_hand_mc.tell_bt.onRelease = function () {
atlasTag("Refer_a_Friend");
getURL (tellAFriend_link);
};
grab_hand_mc.tell_bt.onRollOver = function () {
grab_hand_mc.tell_mc.gotoAndStop(2);
};
grab_hand_mc.tell_bt.onRollOut = function () {
grab_hand_mc.tell_mc.gotoAndStop(1);
};
grab_hand_mc.winLink_bt.onRelease = function () {
atlasTag("Competition_Entry");
getURL (winLink, "_blank");
};
if (((((bestDist != undefined) && (bestDist != undefined)) && (bestDist != "")) && (bestDist != null)) && (bestDist != "null")) {
score = Math.round(bestDist * 1000);
getGlobalRank(score);
}
Symbol 268 MovieClip Frame 2
function getLeagueInfo(LID) {
loader_mc._visible = true;
var form = new sForm();
var _this = this;
form.action = _root.URL + "League.asmx/LeagueInfoByID";
form.actionType = "POST";
form.responseType = "XML";
form.addField("lastActiveDays", 0, "variable");
form.addField("id", LID, "variable");
form.onLoad = function (success, answer) {
if (success) {
trace(answer);
if ((answer.firstChild.attributes.name == "") || (answer.firstChild.attributes.name == undefined)) {
_this.id = "";
return(undefined);
}
leagueTable_mc.leagueName_txt.autoSize = true;
leagueTable_mc.leagueName_txt.text = answer.firstChild.attributes.name;
grab_hand_mc.leagueTable_mc.leagueName_txt.autoSize = true;
grab_hand_mc.leagueTable_mc.leagueName_txt.text = answer.firstChild.attributes.name;
var i = 0;
var aNode = answer.firstChild.firstChild;
while (aNode != null) {
if (aNode.nodeType == 1) {
var no = aNode.attributes.no;
var bNode = aNode.firstChild;
while (bNode != null) {
switch (bNode.nodeName) {
case "nickname" :
leagueTable_mc.eval("user" + no).name.text = bNode.firstChild.nodeValue;
eval ("grab_hand_mc.leagueTable_mc.user" + no).name.text = bNode.firstChild.nodeValue;
break;
case "points" :
leagueTable_mc.eval("user" + no).points.text = (bNode.firstChild.nodeValue / 1000) + "m";
eval ("grab_hand_mc.leagueTable_mc.user" + no).points.text = (bNode.firstChild.nodeValue / 1000) + "m";
}
bNode = bNode.nextSibling;
}
}
aNode = aNode.nextSibling;
}
} else {
msg_txt.text = "error connection";
}
};
form.onError = function (param) {
trace(param);
};
form.submit(true);
}
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function saveScore(ID, score) {
var _local2 = _root;
loader_mc._visible = true;
var _local1 = new sForm();
_local1.action = _local2.URL + "Play.asmx/LeagueGame";
_local1.actionType = "POST";
_local1.addField("score", score, "variable");
_local1.addField("id", ID, "variable");
_local1.onLoad = function () {
loader_mc._visible = false;
trace("getLeagueInfo:" + _root.id);
getLeagueInfo(_root.id);
};
_local1.submit(true);
}
function saveSingleScore(score) {
trace("try to set single score....");
loader_mc._visible = true;
var _local1 = new sForm();
_local1.action = _root.URL + "Play.asmx/SinglePlayerUnregistered";
_local1.actionType = "POST";
_local1.addField("score", score, "variable");
_local1.onLoad = function () {
trace("single score updated!");
};
_local1.submit(true);
}
stop();
msg_txt.text = "";
info_mc._visible = true;
var score;
loader_mc._visible = false;
newLeague_bt.onRelease = function () {
gotoAndStop ("register");
};
grab_hand_mc.leagueTable_mc.addPlayer_bt.onRelease = function () {
_root.resultsLeague_mc.gotoAndStop("addPlayer");
};
winLink_bt.onRelease = function () {
atlasTag("Competition_Entry");
getURL (winLink, "_blank");
};
tell_bt.onRelease = function () {
atlasTag("Refer_a_Friend");
getURL (tellAFriend_link);
};
tell_bt.onRollOver = function () {
tell_mc.gotoAndStop(2);
};
tell_bt.onRollOut = function () {
tell_mc.gotoAndStop(1);
};
playSingleAgain_bt.onRelease = function () {
atlasTag("Play_Again");
init();
};
playSingleAgain_bt.onRollOver = function () {
playSingleAgain_mc.gotoAndStop(2);
};
playSingleAgain_bt.onRollOut = function () {
playSingleAgain_mc.gotoAndStop(1);
};
getLeagueInfo(_root.id);
if (_root.distMeter > 0) {
score_txt.text = _root.distMeter + "m";
score = Math.round(bestDist * 1000);
saveScore(_root.id, score);
}
trace("try to get global rank....");
getGlobalRank(score);
msg_txt.text = "";
loader_mc._visible = false;
gamesPlayed_mc.gamesPlayed_mc.count_txt.text = "";
gamesPlayed_mc.gamesPlayed_mc.games_txt.text = "";
getGameCount();
grab_hand_mc.league_bt.onRelease = function () {
atlasTag("Create_a_League");
_root.plane_mc._visible = false;
gotoAndStop ("register");
};
grab_hand_mc.league_bt.onRollOver = function () {
grab_hand_mc.league_mc.gotoAndStop(2);
};
grab_hand_mc.league_bt.onRollOut = function () {
grab_hand_mc.league_mc.gotoAndStop(1);
};
grab_hand_mc.tell_bt.onRelease = function () {
atlasTag("Refer_a_Friend");
getURL (tellAFriend_link);
};
grab_hand_mc.tell_bt.onRollOver = function () {
grab_hand_mc.tell_mc.gotoAndStop(2);
};
grab_hand_mc.tell_bt.onRollOut = function () {
grab_hand_mc.tell_mc.gotoAndStop(1);
};
grab_hand_mc.winLink_bt.onRelease = function () {
atlasTag("Competition_Entry");
getURL (winLink, "_blank");
};
if (((((bestDist != undefined) && (bestDist != undefined)) && (bestDist != "")) && (bestDist != null)) && (bestDist != "null")) {
score = Math.round(bestDist * 1000);
getGlobalRank(score);
}
Symbol 268 MovieClip Frame 3
function getLeagueInfo(LID) {
loader_mc._visible = true;
var form = new sForm();
var _this = this;
form.action = _root.URL + "League.asmx/LeagueInfoByID";
form.actionType = "POST";
form.responseType = "XML";
form.addField("lastActiveDays", 0, "variable");
form.addField("id", LID, "variable");
form.onLoad = function (success, answer) {
if (success) {
trace(answer);
if ((answer.firstChild.attributes.name == "") || (answer.firstChild.attributes.name == undefined)) {
_this.id = "";
return(undefined);
}
leagueTable_mc.leagueName_txt.autoSize = true;
leagueTable_mc.leagueName_txt.text = answer.firstChild.attributes.name;
grab_hand_mc.leagueTable_mc.leagueName_txt.autoSize = true;
grab_hand_mc.leagueTable_mc.leagueName_txt.text = answer.firstChild.attributes.name;
var i = 0;
var aNode = answer.firstChild.firstChild;
while (aNode != null) {
if (aNode.nodeType == 1) {
var no = aNode.attributes.no;
var bNode = aNode.firstChild;
while (bNode != null) {
switch (bNode.nodeName) {
case "nickname" :
leagueTable_mc.eval("user" + no).name.text = bNode.firstChild.nodeValue;
eval ("grab_hand_mc.leagueTable_mc.user" + no).name.text = bNode.firstChild.nodeValue;
break;
case "points" :
leagueTable_mc.eval("user" + no).points.text = (bNode.firstChild.nodeValue / 1000) + "m";
eval ("grab_hand_mc.leagueTable_mc.user" + no).points.text = (bNode.firstChild.nodeValue / 1000) + "m";
}
bNode = bNode.nextSibling;
}
}
aNode = aNode.nextSibling;
}
} else {
msg_txt.text = "error connection";
}
};
form.onError = function (param) {
trace(param);
};
form.submit(true);
}
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function saveScore(ID, score) {
var _local2 = _root;
loader_mc._visible = true;
var _local1 = new sForm();
_local1.action = _local2.URL + "Play.asmx/LeagueGame";
_local1.actionType = "POST";
_local1.addField("score", score, "variable");
_local1.addField("id", ID, "variable");
_local1.onLoad = function () {
loader_mc._visible = false;
trace("getLeagueInfo:" + _root.id);
getLeagueInfo(_root.id);
};
_local1.submit(true);
}
function saveSingleScore(score) {
trace("try to set single score....");
loader_mc._visible = true;
var _local1 = new sForm();
_local1.action = _root.URL + "Play.asmx/SinglePlayerUnregistered";
_local1.actionType = "POST";
_local1.addField("score", score, "variable");
_local1.onLoad = function () {
trace("single score updated!");
};
_local1.submit(true);
}
loader_mc._visible = false;
bestScore_txt.text = bestDist_Display;
stop();
msg_txt.text = "";
info_mc._visible = true;
var score;
loader_mc._visible = false;
newLeague_bt.onRelease = function () {
gotoAndStop ("register");
};
grab_hand_mc.leagueTable_mc.addPlayer_bt.onRelease = function () {
_root.resultsLeague_mc.gotoAndStop("addPlayer");
};
winLink_bt.onRelease = function () {
atlasTag("Competition_Entry");
getURL (winLink, "_blank");
};
tell_bt.onRelease = function () {
atlasTag("Refer_a_Friend");
getURL (tellAFriend_link);
};
tell_bt.onRollOver = function () {
tell_mc.gotoAndStop(2);
};
tell_bt.onRollOut = function () {
tell_mc.gotoAndStop(1);
};
playSingleAgain_bt.onRelease = function () {
atlasTag("Play_Again");
init();
};
playSingleAgain_bt.onRollOver = function () {
playSingleAgain_mc.gotoAndStop(2);
};
playSingleAgain_bt.onRollOut = function () {
playSingleAgain_mc.gotoAndStop(1);
};
trace("try to set league score...");
score_txt.text = _root.distMeter + "m";
score = Math.round(bestDist * 1000);
saveScore(_root.id, score);
trace("try to get global rank....");
getGlobalRank(score);
Symbol 268 MovieClip Frame 4
msg_txt.text = "";
leagueName_txt.tabIndex = 1;
creatorEmail_txt.tabIndex = 2;
nick_txt.tabIndex = 3;
var idx = 4;
var i = 1;
while (i <= 10) {
this["nick_txt" + i].tabIndex = idx;
idx++;
this["email_txt" + i].tabIndex = idx;
idx++;
i++;
}
var i = 1;
while (i <= 10) {
this["status" + i]._visible = false;
i++;
}
loader_mc._visible = false;
var leagueForm = new sForm();
leagueForm.action = _root.URL + "League.asmx/CreateLeague";
leagueForm.actionType = "POST";
leagueForm.addField("leagueName", leagueName_txt, "text");
leagueForm.addField("creatorEmail", creatorEmail_txt, "text");
leagueForm.addField("creatorName", nick_txt, "text");
leagueForm.onError = function (param) {
switch (param) {
case "leagueName" :
msg_txt.text = "please enter league Name";
return;
case "creatorEmail" :
msg_txt.text = "please enter creator Email";
return;
case "creatorName" :
msg_txt.text = "please enter Nick Name";
}
};
leagueForm.onLoad = function (success, answer) {
var _local1 = answer;
loader_mc._visible = false;
trace("loaded");
if (success) {
trace(_local1);
switch (_local1.result) {
case "0" :
atlasTag("Submit_League");
msg_txt.text = "success";
id = _local1.id;
_root.id = id;
_root.inLeague = true;
init();
break;
case "1" :
msg_txt.text = "email/password not exists";
break;
case "2" :
msg_txt.text = "invalid friends parameter";
break;
case "3" :
msg_txt.text = "invalid leagueName";
break;
case "4" :
msg_txt.text = "user try to invite himself (creator email in friends list)";
break;
case "5" :
msg_txt.text = "empty friends param";
break;
case "6" :
msg_txt.text = "email can't be sent due server problems";
break;
case "7" :
msg_txt.text = "server error";
break;
default :
msg_txt.text = "server error " + _local1.result;
}
} else {
msg_txt.text = "error connection";
}
};
var _this = this;
submit_bt.onRelease = function () {
trace("click");
var _local3 = leagueForm.submit(false);
if (_local3) {
_local3 = true;
var _local1 = 1;
while (_local1 <= 10) {
allSymbols = _this["nick_txt" + _local1].text.length + _this["email_txt" + _local1].text.length;
st = (_this["nick_txt" + _local1].text.length > 0) && (_this["email_txt" + _local1].text.length > 0);
_this["status" + _local1]._visible = true;
if ((!st) && (allSymbols > 0)) {
_this["status" + _local1].gotoAndStop("invalid");
msg_txt.text = "friends param not valid";
_local3 = false;
} else if (allSymbols > 0) {
_this["status" + _local1].gotoAndStop("valid");
} else {
_this["status" + _local1]._visible = false;
}
_local1++;
}
if (_local3) {
msg_txt.text = "";
loader_mc._visible = true;
var _local2 = "";
_local1 = 1;
while (_local1 <= 10) {
if (_this["nick_txt" + _local1].text.length > 0) {
_local2 = _local2 + (((_this["nick_txt" + _local1].text + ";") + _this["email_txt" + _local1].text) + "!");
}
_local1++;
}
_local2 = _local2.substr(0, _local2.length - 1);
trace(_local2);
leagueForm.addField("friends", _local2, "variable");
leagueForm.submit(true);
}
}
};
submit_bt.onRollOver = function () {
submit_mv.gotoAndStop(2);
};
submit_bt.onRollOut = (submit_bt.onDragOut = function () {
submit_mc.gotoAndStop(1);
});
playSingleAgain_bt.onRelease = function () {
atlasTag("Play_Again");
init();
};
playSingleAgain_bt.onRollOver = function () {
playSingleAgain_mc.gotoAndStop(2);
};
playSingleAgain_bt.onRollOut = function () {
playSingleAgain_mc.gotoAndStop(1);
};
stop();
Symbol 268 MovieClip Frame 5
function checkForm() {
loader_mc._visible = true;
var _local1 = new sForm();
_local1.action = _root.URL + "League.asmx/AddNewPlayer";
_local1.actionType = "POST";
_local1.addField("email", email_txt, "text");
_local1.addField("nickName", nick_txt, "text");
_local1.addField("id", _root.id, "variable");
_local1.onError = function (param) {
loader_mc._visible = false;
switch (param) {
case "email" :
msg_txt.text = "please enter Email";
return;
case "nickName" :
msg_txt.text = "please enter Nick Name";
}
};
_local1.onLoad = function (success, answer) {
loader_mc._visible = false;
if (success) {
switch (answer.result) {
case "0" :
msg_txt.text = "success";
init();
return;
default :
msg_txt.text = "server error " + answer.result;
}
}
};
_local1.submit(true);
}
msg_txt.text = "";
_root.plane_mc._visible = false;
loader_mc._visible = false;
submit_bt.onRelease = function () {
checkForm();
};
submit_bt.onRollOver = function () {
submit_mc.gotoAndStop(2);
};
submit_bt.onRollOut = function () {
submit_mc.gotoAndStop(1);
};
playSingleAgain_bt.onRelease = function () {
atlasTag("Play_Again");
init();
};
playSingleAgain_bt.onRollOver = function () {
playSingleAgain_mc.gotoAndStop(2);
};
playSingleAgain_bt.onRollOut = function () {
playSingleAgain_mc.gotoAndStop(1);
};
stop();
Symbol 268 MovieClip Frame 6
function getLeagueInfo(LID) {
loader_mc._visible = true;
var form = new sForm();
var _this = this;
form.action = _root.URL + "League.asmx/LeagueInfoByID";
form.actionType = "POST";
form.responseType = "XML";
form.addField("lastActiveDays", 0, "variable");
form.addField("id", LID, "variable");
form.onLoad = function (success, answer) {
if (success) {
trace(answer);
if ((answer.firstChild.attributes.name == "") || (answer.firstChild.attributes.name == undefined)) {
_this.id = "";
return(undefined);
}
leagueTable_mc.leagueName_txt.autoSize = true;
leagueTable_mc.leagueName_txt.text = answer.firstChild.attributes.name;
grab_hand_mc.leagueTable_mc.leagueName_txt.autoSize = true;
grab_hand_mc.leagueTable_mc.leagueName_txt.text = answer.firstChild.attributes.name;
var i = 0;
var aNode = answer.firstChild.firstChild;
while (aNode != null) {
if (aNode.nodeType == 1) {
var no = aNode.attributes.no;
var bNode = aNode.firstChild;
while (bNode != null) {
switch (bNode.nodeName) {
case "nickname" :
leagueTable_mc.eval("user" + no).name.text = bNode.firstChild.nodeValue;
eval ("grab_hand_mc.leagueTable_mc.user" + no).name.text = bNode.firstChild.nodeValue;
break;
case "points" :
leagueTable_mc.eval("user" + no).points.text = (bNode.firstChild.nodeValue / 1000) + "m";
eval ("grab_hand_mc.leagueTable_mc.user" + no).points.text = (bNode.firstChild.nodeValue / 1000) + "m";
}
bNode = bNode.nextSibling;
}
}
aNode = aNode.nextSibling;
}
} else {
msg_txt.text = "error connection";
}
};
form.onError = function (param) {
trace(param);
};
form.submit(true);
}
function randRange(min, max) {
var _local1 = Math.floor(Math.random() * ((max - min) + 1)) + min;
return(_local1);
}
function saveScore(ID, score) {
var _local2 = _root;
loader_mc._visible = true;
var _local1 = new sForm();
_local1.action = _local2.URL + "Play.asmx/LeagueGame";
_local1.actionType = "POST";
_local1.addField("score", score, "variable");
_local1.addField("id", ID, "variable");
_local1.onLoad = function () {
loader_mc._visible = false;
trace("getLeagueInfo:" + _root.id);
getLeagueInfo(_root.id);
};
_local1.submit(true);
}
function saveSingleScore(score) {
trace("try to set single score....");
loader_mc._visible = true;
var _local1 = new sForm();
_local1.action = _root.URL + "Play.asmx/SinglePlayerUnregistered";
_local1.actionType = "POST";
_local1.addField("score", score, "variable");
_local1.onLoad = function () {
trace("single score updated!");
};
_local1.submit(true);
}
function lastFunc() {
var _local1 = _root;
trace(">>>>>>>>>>>>>" + mc);
score_txt.text = _local1.distMeter + "m";
score = Math.round(bestDist * 1000);
saveSingleScore(score);
if (_local1.id != undefined) {
saveScore(_local1.id, score);
}
trace(getGlobalRank);
getGlobalRank(score);
}
stop();
loader_mc._visible = false;
var mc = this;
msg_txt.text = "";
info_mc._visible = true;
var score;
loader_mc._visible = false;
newLeague_bt.onRelease = function () {
gotoAndStop ("register");
};
grab_hand_mc.leagueTable_mc.addPlayer_bt.onRelease = function () {
_root.resultsLeague_mc.gotoAndStop("addPlayer");
};
winLink_bt.onRelease = function () {
atlasTag("Competition_Entry");
getURL (winLink, "_blank");
};
tell_bt.onRelease = function () {
atlasTag("Refer_a_Friend");
getURL (tellAFriend_link);
};
tell_bt.onRollOver = function () {
tell_mc.gotoAndStop(2);
};
tell_bt.onRollOut = function () {
tell_mc.gotoAndStop(1);
};
playSingleAgain_bt.onRelease = function () {
atlasTag("Play_Again");
init();
};
playSingleAgain_bt.onRollOver = function () {
playSingleAgain_mc.gotoAndStop(2);
};
playSingleAgain_bt.onRollOut = function () {
playSingleAgain_mc.gotoAndStop(1);
};
if (_root.spid == undefined) {
var my_so = SharedObject.getLocal("xbox");
var requestForm = new sForm();
requestForm.actionType = "POST";
if ((my_so.data.spid != "") && (my_so.data.spid != undefined)) {
trace("spidSO=" + my_so.data.spid);
requestForm.action = _root.URL + "Play.asmx/SetSPID";
requestForm.addField("spid", my_so.data.spid, "variable");
requestForm.onLoad = function (success, answer) {
_root.spid = my_so.data.spid;
lastFunc();
};
} else {
requestForm.action = _root.URL + "Play.asmx/RequestSPID";
requestForm.onLoad = function (success, answer) {
var _local2 = answer;
var _local1 = SharedObject.getLocal("xbox");
_root.spid = _local2.SPID;
_local1.data.spid = _local2.SPID;
trace("spid=" + _local2.SPID);
lastFunc();
};
}
requestForm.submit(true);
} else {
trace("include mygame");
lastFunc();
}
bestScore_txt.text = bestDist_Display;
tips_mc.gotoAndStop(1);
if (!_root.affectAllY) {
_global.frame++;
if (frame > tips_mc._totalframes) {
_global.frame = 2;
}
tips_mc.gotoAndStop(frame);
} else {
_global.frame++;
if ((frame < 7) || (frame > tips_mc._totalframes)) {
_global.frame = 7;
}
tips_mc.gotoAndStop(frame);
}
Symbol 275 MovieClip Frame 1
stop();
Symbol 287 Button
on (release) {
getURL ("http://www.amnesia.com.au", "_blank");
}
Symbol 295 MovieClip Frame 14
stop();
Instance of Symbol 295 MovieClip in Symbol 297 MovieClip Frame 1
onClipEvent (load) {
_root.distMeter = 0;
percentLoader1 = 0;
percentLoader2 = 0;
stop();
}
onClipEvent (enterFrame) {
if (!_root.gamePaused) {
_root.distMeter1000 = _root.distMeter * 1000;
percentLoader_str = String(_root.distMeter1000);
if (percentLoader_str > 0) {
percentLoader1 = percentLoader_str.charAt(percentLoader_str.length - 1);
percentLoader2 = Number(percentLoader1) - 1;
if (percentLoader2 < 0) {
percentLoader2 = 9;
}
gotoAndPlay (1);
} else {
_root.altMeter = 0;
percentLoader1 = 0;
percentLoader2 = 0;
stop();
}
} else {
percentLoader1 = 0;
percentLoader2 = 0;
}
}
Instance of Symbol 295 MovieClip in Symbol 297 MovieClip Frame 1
onClipEvent (load) {
stop();
percentLoader1 = 0;
percentLoader2 = 0;
}
onClipEvent (enterFrame) {
percentLoader_str = String(_root.distMeter1000);
if (percentLoader_str.charAt(percentLoader_str.length - 2) > 0) {
if (percentLoader1 != percentLoader_str.charAt(percentLoader_str.length - 2)) {
percentLoader1 = percentLoader_str.charAt(percentLoader_str.length - 2);
percentLoader2 = Number(percentLoader1) - 1;
if (percentLoader2 < 0) {
percentLoader2 = 9;
}
gotoAndPlay (1);
}
} else {
percentLoader1 = 0;
percentLoader2 = 0;
stop();
}
}
Instance of Symbol 295 MovieClip in Symbol 297 MovieClip Frame 1
onClipEvent (load) {
stop();
percentLoader1 = 0;
percentLoader2 = 0;
}
onClipEvent (enterFrame) {
percentLoader_str = String(_root.distMeter1000);
if (percentLoader_str.charAt(percentLoader_str.length - 3) > 0) {
if (percentLoader1 != percentLoader_str.charAt(percentLoader_str.length - 3)) {
percentLoader1 = percentLoader_str.charAt(percentLoader_str.length - 3);
percentLoader2 = Number(percentLoader1) - 1;
if (percentLoader2 < 0) {
percentLoader2 = 9;
}
gotoAndPlay (1);
}
} else {
percentLoader1 = 0;
percentLoader2 = 0;
stop();
}
}
Instance of Symbol 295 MovieClip in Symbol 297 MovieClip Frame 1
onClipEvent (load) {
stop();
percentLoader1 = 9;
percentLoader2 = 9;
}
onClipEvent (enterFrame) {
percentLoader_str = String(_root.distMeter1000);
if (percentLoader_str.charAt(percentLoader_str.length - 4) > 0) {
if (percentLoader1 != percentLoader_str.charAt(percentLoader_str.length - 4)) {
percentLoader1 = percentLoader_str.charAt(percentLoader_str.length - 4);
percentLoader2 = Number(percentLoader1) - 1;
if (percentLoader2 < 0) {
percentLoader2 = 9;
}
gotoAndPlay (1);
}
} else {
percentLoader1 = 0;
percentLoader2 = 0;
stop();
}
}
Instance of Symbol 295 MovieClip in Symbol 297 MovieClip Frame 1
onClipEvent (load) {
stop();
percentLoader1 = 0;
percentLoader2 = 0;
this._alpha = 0;
}
onClipEvent (enterFrame) {
percentLoader_str = String(_root.distMeter1000);
if (percentLoader_str.charAt(percentLoader_str.length - 5) > 0) {
this._alpha = 100;
if (percentLoader1 != percentLoader_str.charAt(percentLoader_str.length - 5)) {
percentLoader1 = percentLoader_str.charAt(percentLoader_str.length - 5);
percentLoader2 = Number(percentLoader1) - 1;
if (percentLoader2 < 0) {
percentLoader2 = 9;
}
gotoAndPlay (1);
}
} else {
percentLoader1 = 0;
percentLoader2 = 0;
stop();
}
}
Instance of Symbol 295 MovieClip in Symbol 297 MovieClip Frame 1
onClipEvent (load) {
stop();
percentLoader1 = 0;
percentLoader2 = 0;
this._alpha = 0;
}
onClipEvent (enterFrame) {
percentLoader_str = String(_root.distMeter1000);
if (percentLoader_str.charAt(percentLoader_str.length - 6) > 0) {
this._alpha = 100;
if (percentLoader1 != percentLoader_str.charAt(percentLoader_str.length - 6)) {
percentLoader1 = percentLoader_str.charAt(percentLoader_str.length - 6);
percentLoader2 = Number(percentLoader1) - 1;
if (percentLoader2 < 0) {
percentLoader2 = 9;
}
gotoAndPlay (1);
}
} else {
percentLoader1 = 0;
percentLoader2 = 0;
stop();
}
}
Symbol 299 MovieClip Frame 1
stop();
Symbol 299 MovieClip Frame 189
gotoAndPlay (2);
Symbol 300 MovieClip Frame 1
stop();
Symbol 302 MovieClip Frame 1
stop();
Symbol 303 MovieClip Frame 1
stop();
Symbol 307 MovieClip Frame 1
stop();
Symbol 307 MovieClip Frame 2
stop();
Symbol 310 MovieClip Frame 1
stop();
Symbol 310 MovieClip Frame 2
stop();
Symbol 311 MovieClip Frame 1
stop();
Symbol 311 MovieClip Frame 2
stop();