Frame 1
loadMovieNum ("http://watches.whodidit.co.uk/watch55.swf", 10);
Application.main(this);
Frame 11
Sounds.setSounds();
Frame 32
stop();
Frame 52
stop();
Symbol 11 MovieClip [game over] Frame 1
#initclip 32
Object.registerClass("game over", GameOver);
#endinitclip
Symbol 18 MovieClip [summary] Frame 1
#initclip 29
Object.registerClass("summary", Summary);
#endinitclip
Symbol 32 MovieClip [ScrollBar] Frame 1
#initclip 30
Object.registerClass("ScrollBar", Scrollbar);
#endinitclip
Symbol 39 MovieClip [loader] Frame 1
#initclip 31
Object.registerClass("loader", Loader);
#endinitclip
Symbol 421 MovieClip [__Packages.Application] Frame 0
class Application extends MovieClip
{
static var instance, sBasePath;
var __proto__, stop;
function Application (root) {
super();
root.__proto__ = __proto__;
root.__constructor__ = Application;
this=root;//parameter overwritten
instance = this;
init();
}
static function main(root) {
var _local1 = new Application(root);
}
static function tr() {
trace(arguments.join(" : "));
}
function init(Void) {
(stop());// not popped
sBasePath = _root.basepath;
if (sBasePath == undefined) {
sBasePath = "Scripts/";
}
}
static function goto(sLabel) {
instance.gotoAndStop(sLabel);
}
}
Symbol 422 MovieClip [__Packages.Fps] Frame 0
class Fps
{
var mcContainer, tfDisplay, f, t;
function Fps () {
mcContainer = _root.createEmptyMovieClip("mcContainer", 9999);
tfDisplay = mcContainer.createTextField("tfDisplay", mcContainer.getNextHighestDepth(), 0, 0, 22, 22);
tfDisplay._x = Stage.width - tfDisplay._width;
tfDisplay.border = true;
tfDisplay.background = true;
tfDisplay.backgroundColor = 16777215 /* 0xFFFFFF */;
f = 0;
t = getTimer();
mcContainer.onEnterFrame = mx.utils.Delegate.create(this, count);
}
function count(Void) {
if ((getTimer() - t) > 1000) {
tfDisplay.text = String(f);
t = getTimer();
f = 0;
} else {
f++;
}
}
}
Symbol 423 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}
Symbol 424 MovieClip [__Packages.Summary] Frame 0
class Summary extends MovieClip
{
static var instance;
var onEnterFrame, sURL, mcDescription, oSpaceLst, gotoAndPlay, mcStatusBar;
function Summary () {
super();
instance = this;
onEnterFrame = init;
}
function init(Void) {
onEnterFrame = null;
sURL = Application.sBasePath + "SaveScore.php";
if (Game.getInstance().sMissionType == "hostages") {
setHostAlpha(100);
} else {
setHostAlpha(20);
}
mcDescription.mcTexts.gotoAndStop(1);
mcDescription.btnPlay.onRelease = mx.utils.Delegate.create(this, onReleasePlayFirst);
oSpaceLst = new Object();
oSpaceLst.onKeyDown = mx.utils.Delegate.create(this, onPressSpaceFirst);
Key.addListener(oSpaceLst);
setBonusGauge(Game.getInstance().bonus);
}
static function getInstance(Void) {
return(instance);
}
function startGame(Void) {
Game.getInstance().startGame();
}
function onReleasePlayFirst(Void) {
Key.removeListener(oSpaceLst);
(gotoAndPlay("firstOut"));// not popped
Sounds.stopAllSounds();
}
function setFuelGauge(amount) {
mcStatusBar.mcFuelGauge.gotoAndStop(101 - amount);
}
function setChafsGauge(amount) {
mcStatusBar.chaffs = amount;
}
function setLivesGauge(amount) {
mcStatusBar.lives = amount;
}
function setPointsGauge(amount) {
mcStatusBar.points = amount;
}
function setOnBoardGauge(amount, maxAmount) {
mcStatusBar.onBoard = (amount + "/") + maxAmount;
}
function setBonusGauge(amount) {
mcStatusBar.bonus = amount;
}
function showMission(Void) {
(gotoAndPlay("panelIn"));// not popped
mcDescription.mcTexts.gotoAndStop(Game.level + 2);
mcDescription.btnPlay.onRelease = mx.utils.Delegate.create(this, onReleasePlay);
oSpaceLst = new Object();
oSpaceLst.onKeyDown = mx.utils.Delegate.create(this, onPressSpace);
Key.addListener(oSpaceLst);
}
function showGameOver(bSuccess) {
(gotoAndPlay("panelIn"));// not popped
if (bSuccess) {
mcDescription.gotoAndStop("win");
mcDescription.btnEnter.onRelease = mx.utils.Delegate.create(this, onReleaseSend);
oSpaceLst = new Object();
oSpaceLst.onKeyDown = mx.utils.Delegate.create(this, onPressEnterWin);
Key.addListener(oSpaceLst);
Selection.setFocus(mcDescription.tfName);
} else {
mcDescription.gotoAndStop("lose");
mcDescription.btnPlay.onRelease = mx.utils.Delegate.create(this, onReleasePlayAgain);
mcDescription.btnFriend.onRelease = mx.utils.Delegate.create(this, onReleaseFriend);
oSpaceLst = new Object();
oSpaceLst.onKeyDown = mx.utils.Delegate.create(this, onPressSpaceLose);
Key.addListener(oSpaceLst);
}
}
function onReleasePlay(Void) {
Key.removeListener(oSpaceLst);
Game.getInstance().setNextLevel();
(gotoAndPlay("panelOut"));// not popped
Sounds.stopAllSounds();
}
function onReleasePlayAgain(Void) {
Key.removeListener(oSpaceLst);
_root.gotoAndPlay("gameOut");
}
function onReleaseSend(Void) {
Key.removeListener(oSpaceLst);
var _local3 = mcDescription;
if (_local3.tfName.length > 0) {
_local3.mcBlockade.gotoAndStop("show");
var _local2 = new LoadVars();
_local2.NAME = _local3.tfName.text;
_local2.SCORE = Game.getInstance().getPoints();
_local2.onLoad = mx.utils.Delegate.create(this, onSendScore);
_local2.sendAndLoad(sURL, _local2, "POST");
} else {
_local3.mcName.gotoAndPlay("error");
Selection.setFocus(_local3.tfName);
oSpaceLst = new Object();
oSpaceLst.onKeyDown = mx.utils.Delegate.create(this, onPressEnterWin);
Key.addListener(oSpaceLst);
}
}
function onSendScore(bSuccess) {
if (bSuccess) {
mcDescription.mcBlockade.gotoAndStop("hide");
_root.gotoAndPlay("gameOut");
_root.mcInterface.gotoAndStop("high");
} else {
mcDescription.mcBlockade.gotoAndPlay("error");
oSpaceLst = new Object();
oSpaceLst.onKeyDown = mx.utils.Delegate.create(this, onPressEnterWin);
Key.addListener(oSpaceLst);
}
}
function onPressSpaceFirst(Void) {
if (Key.isDown(32)) {
onReleasePlayFirst();
}
}
function onPressSpace(Void) {
if (Key.isDown(32)) {
onReleasePlay();
}
}
function onPressSpaceLose(Void) {
if (Key.isDown(32)) {
onReleasePlayAgain();
}
}
function onPressEnterWin(Void) {
if (Key.isDown(13)) {
onReleaseSend();
}
}
function setHostAlpha(value) {
mcStatusBar.tfHostages._alpha = value;
}
function onReleaseFriend(Void) {
Key.removeListener(oSpaceLst);
_root.gotoAndPlay("gameOut");
_root.mcInterface.gotoAndStop("send");
}
}
Symbol 425 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
static var instance, bmpCanvas, bmpDead, bmpChopper, bmpShots, bmpForeground;
var aBonuses, aBgNames, aObstaclesDef, aHostilesDef, aPlatformsDef, aHostagesDef, aVehiclesDef, bonus, aHostagesInd, aVehiclesInd, aHostilesInd, onEnterFrame, btnSkip, aAllyShots, aHostileShots, aAllyMissiles, aHostileMissiles, aChafs, aPoints, chopper, unloadedHostages, placedVehicles, sMissionType, aBgBmps, aPlatforms, aHostages, aHostiles, aObstacles, aVehicles, mcCanvas, levelWidth, mcPanel;
function Game (Void) {
super();
instance = this;
level = 0;
aBonuses = new Array(3000, 4000, 5000, 6000, 7000, 9000);
aBgNames = new Array();
aObstaclesDef = new Array();
aHostilesDef = new Array();
aPlatformsDef = new Array();
aHostagesDef = new Array();
aVehiclesDef = new Array();
aBgNames[0] = new Array();
aBgNames[0][0] = new Array();
aBgNames[0][0][0] = "bg_jungle_back";
aBgNames[0][1] = new Array();
aBgNames[0][1][0] = "bg_jungle_middle";
aBgNames[0][2] = new Array();
aBgNames[0][2][0] = "bg_jungle_front001";
aBgNames[0][2][1] = "bg_jungle_front002";
aBgNames[0][2][2] = "bg_jungle_front001";
aBgNames[0][2][3] = "bg_jungle_front002";
aBgNames[0][3] = new Array();
aBgNames[0][3][0] = "bg_jungle_foreground001";
aBgNames[0][3][1] = "bg_jungle_foreground001";
aBgNames[0][3][2] = "bg_jungle_foreground001";
aBgNames[0][3][3] = "bg_jungle_foreground001";
aObstaclesDef[0] = new Array();
aObstaclesDef[0].push({sLinkage:"bg_jungle_obstacle003", position:new flash.geom.Point(2200, 20)});
aObstaclesDef[0].push({sLinkage:"bg_jungle_obstacle005", position:new flash.geom.Point(2800, 20)});
aObstaclesDef[0].push({sLinkage:"bg_jungle_obstacle001", position:new flash.geom.Point(4200, 20)});
aObstaclesDef[0].push({sLinkage:"bg_jungle_obstacle002", position:new flash.geom.Point(800, 20)});
aObstaclesDef[0].push({sLinkage:"bg_jungle_obstacle001", position:new flash.geom.Point(1600, 20)});
aObstaclesDef[0].push({sLinkage:"bg_jungle_obstacle003", position:new flash.geom.Point(3600, 20)});
aHostilesDef[0] = new Array();
aHostilesDef[0].push({type:Cannon, position:new flash.geom.Point(1100, 40), id:0});
aHostilesDef[0].push({type:Cannon, position:new flash.geom.Point(3800, 40), id:0});
aPlatformsDef[0] = new Array();
aPlatformsDef[0].push({sType:"base", position:new flash.geom.Point(200, 160)});
aPlatformsDef[0].push({sType:"refill", position:new flash.geom.Point(3100, 80)});
aHostagesDef[0] = new Array();
aHostagesDef[0].push({position:new flash.geom.Point(2500, 40), id:1});
aHostagesDef[0].push({position:new flash.geom.Point(2400, 40), id:0});
aHostagesDef[0].push({position:new flash.geom.Point(4500, 40), id:3});
aHostagesDef[0].push({position:new flash.geom.Point(3900, 40), id:2});
aHostagesDef[0].push({position:new flash.geom.Point(3900, 40), id:1});
aVehiclesDef[0] = null;
aBgNames[1] = new Array();
aBgNames[1][0] = new Array();
aBgNames[1][0][0] = "bg_desert_back";
aBgNames[1][1] = new Array();
aBgNames[1][1][0] = "bg_desert_middle";
aBgNames[1][2] = new Array();
aBgNames[1][2][0] = "bg_desert_front001";
aBgNames[1][2][1] = "bg_desert_front002";
aBgNames[1][2][2] = "bg_desert_front001";
aBgNames[1][2][3] = "bg_desert_front001";
aBgNames[1][2][4] = "bg_desert_front002";
aBgNames[1][3] = new Array();
aBgNames[1][3][0] = "bg_desert_foreground001";
aBgNames[1][3][1] = "bg_desert_foreground001";
aBgNames[1][3][2] = "bg_desert_foreground001";
aBgNames[1][3][3] = "bg_desert_foreground001";
aBgNames[1][3][4] = "bg_desert_foreground001";
aObstaclesDef[1] = new Array();
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle003", position:new flash.geom.Point(2200, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle005", position:new flash.geom.Point(2800, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle001", position:new flash.geom.Point(4200, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle002", position:new flash.geom.Point(800, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle006", position:new flash.geom.Point(1200, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle001", position:new flash.geom.Point(1600, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle004", position:new flash.geom.Point(3200, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle003", position:new flash.geom.Point(3600, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle004", position:new flash.geom.Point(300, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle001", position:new flash.geom.Point(5000, 10)});
aObstaclesDef[1].push({sLinkage:"bg_desert_obstacle002", position:new flash.geom.Point(5500, 10)});
aHostilesDef[1] = new Array();
aHostilesDef[1].push({type:Cannon, position:new flash.geom.Point(1000, 40), id:2});
aHostilesDef[1].push({type:Cannon, position:new flash.geom.Point(4700, 40), id:2});
aHostilesDef[1].push({type:MissileLauncher, position:new flash.geom.Point(3800, 30), id:2});
aPlatformsDef[1] = new Array();
aPlatformsDef[1].push({sType:"base", position:new flash.geom.Point(2400, 160)});
aPlatformsDef[1].push({sType:"refill", position:new flash.geom.Point(5200, 80)});
aHostagesDef[1] = new Array();
aHostagesDef[1].push({position:new flash.geom.Point(500, 40), id:1});
aHostagesDef[1].push({position:new flash.geom.Point(1400, 40), id:0});
aHostagesDef[1].push({position:new flash.geom.Point(4500, 40), id:3});
aHostagesDef[1].push({position:new flash.geom.Point(3400, 40), id:2});
aHostagesDef[1].push({position:new flash.geom.Point(200, 40), id:2});
aHostagesDef[1].push({position:new flash.geom.Point(600, 40), id:3});
aHostagesDef[1].push({position:new flash.geom.Point(4600, 40), id:0});
aHostagesDef[1].push({position:new flash.geom.Point(5800, 40), id:1});
aHostagesDef[1].push({position:new flash.geom.Point(5700, 40), id:3});
aVehiclesDef[1] = null;
aBgNames[2] = new Array();
aBgNames[2][0] = new Array();
aBgNames[2][0][0] = "bg_jungle_back";
aBgNames[2][1] = new Array();
aBgNames[2][1][0] = "bg_jungle_middle";
aBgNames[2][2] = new Array();
aBgNames[2][2][0] = "bg_jungle_front002";
aBgNames[2][2][1] = "bg_jungle_front001";
aBgNames[2][2][2] = "bg_jungle_front001";
aBgNames[2][2][3] = "bg_jungle_front002";
aBgNames[2][2][4] = "bg_jungle_front001";
aBgNames[2][3] = new Array();
aBgNames[2][3][0] = "bg_jungle_foreground001";
aBgNames[2][3][1] = "bg_jungle_foreground001";
aBgNames[2][3][2] = "bg_jungle_foreground001";
aBgNames[2][3][3] = "bg_jungle_foreground001";
aBgNames[2][3][4] = "bg_jungle_foreground001";
aObstaclesDef[2] = new Array();
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle003", position:new flash.geom.Point(2200, 20)});
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle005", position:new flash.geom.Point(2800, 20)});
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle001", position:new flash.geom.Point(4200, 20)});
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle002", position:new flash.geom.Point(800, 20)});
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle004", position:new flash.geom.Point(1200, 20)});
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle001", position:new flash.geom.Point(1600, 20)});
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle004", position:new flash.geom.Point(3200, 20)});
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle003", position:new flash.geom.Point(3600, 20)});
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle005", position:new flash.geom.Point(5300, 20)});
aObstaclesDef[2].push({sLinkage:"bg_jungle_obstacle002", position:new flash.geom.Point(4700, 20)});
aHostilesDef[2] = new Array();
aHostilesDef[2].push({type:Cannon, position:new flash.geom.Point(1100, 40), id:0});
aHostilesDef[2].push({type:Cannon, position:new flash.geom.Point(3000, 40), id:0});
aHostilesDef[2].push({type:Cannon, position:new flash.geom.Point(4900, 40), id:0});
aPlatformsDef[2] = new Array();
aPlatformsDef[2].push({sType:"base", position:new flash.geom.Point(300, 160)});
aPlatformsDef[2].push({sType:"refill", position:new flash.geom.Point(4500, 80)});
aPlatformsDef[2].push({sType:"dropZone", position:new flash.geom.Point(5600, 35)});
aHostagesDef[2] = null;
aVehiclesDef[2] = new Array();
aVehiclesDef[2].push({position:new flash.geom.Point(200, 40), type:0});
aBgNames[3] = new Array();
aBgNames[3][0] = new Array();
aBgNames[3][0][0] = "bg_desert_back";
aBgNames[3][1] = new Array();
aBgNames[3][1][0] = "bg_desert_middle";
aBgNames[3][2] = new Array();
aBgNames[3][2][0] = "bg_desert_front002";
aBgNames[3][2][1] = "bg_desert_front001";
aBgNames[3][2][2] = "bg_desert_front001";
aBgNames[3][2][3] = "bg_desert_front002";
aBgNames[3][2][4] = "bg_desert_front001";
aBgNames[3][3] = new Array();
aBgNames[3][3][0] = "bg_desert_foreground001";
aBgNames[3][3][1] = "bg_desert_foreground001";
aBgNames[3][3][2] = "bg_desert_foreground001";
aBgNames[3][3][3] = "bg_desert_foreground001";
aBgNames[3][3][4] = "bg_desert_foreground001";
aObstaclesDef[3] = new Array();
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle003", position:new flash.geom.Point(2200, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle005", position:new flash.geom.Point(2800, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle001", position:new flash.geom.Point(4200, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle002", position:new flash.geom.Point(900, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle004", position:new flash.geom.Point(1200, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle001", position:new flash.geom.Point(1600, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle004", position:new flash.geom.Point(3200, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle003", position:new flash.geom.Point(3600, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle004", position:new flash.geom.Point(300, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle005", position:new flash.geom.Point(5300, 10)});
aObstaclesDef[3].push({sLinkage:"bg_desert_obstacle002", position:new flash.geom.Point(4700, 10)});
aHostilesDef[3] = new Array();
aHostilesDef[3].push({type:Cannon, position:new flash.geom.Point(700, 40), id:2});
aHostilesDef[3].push({type:Cannon, position:new flash.geom.Point(3000, 40), id:2});
aHostilesDef[3].push({type:Cannon, position:new flash.geom.Point(3900, 40), id:2});
aHostilesDef[3].push({type:MissileLauncher, position:new flash.geom.Point(4900, 30), id:2});
aHostilesDef[3].push({type:MissileLauncher, position:new flash.geom.Point(400, 30), id:2});
aPlatformsDef[3] = new Array();
aPlatformsDef[3].push({sType:"base", position:new flash.geom.Point(2400, 160)});
aPlatformsDef[3].push({sType:"refill", position:new flash.geom.Point(5800, 80)});
aPlatformsDef[3].push({sType:"dropZone", position:new flash.geom.Point(500, 35)});
aHostagesDef[3] = null;
aVehiclesDef[3] = new Array();
aVehiclesDef[3].push({position:new flash.geom.Point(5680, 40), type:0});
aBgNames[4] = new Array();
aBgNames[4][0] = new Array();
aBgNames[4][0][0] = "bg_snow_back";
aBgNames[4][1] = new Array();
aBgNames[4][1][0] = "bg_snow_middle";
aBgNames[4][2] = new Array();
aBgNames[4][2][0] = "bg_snow_front002";
aBgNames[4][2][1] = "bg_snow_front001";
aBgNames[4][2][2] = "bg_snow_front002";
aBgNames[4][2][3] = "bg_snow_front002";
aBgNames[4][2][4] = "bg_snow_front001";
aBgNames[4][3] = new Array();
aBgNames[4][3][0] = "bg_snow_foreground001";
aBgNames[4][3][1] = "bg_snow_foreground001";
aBgNames[4][3][2] = "bg_snow_foreground001";
aBgNames[4][3][3] = "bg_snow_foreground001";
aBgNames[4][3][4] = "bg_snow_foreground001";
aObstaclesDef[4] = new Array();
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle005", position:new flash.geom.Point(900, 10)});
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle002", position:new flash.geom.Point(2000, 10)});
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle005", position:new flash.geom.Point(3000, 10)});
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle001", position:new flash.geom.Point(3700, 10)});
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle004", position:new flash.geom.Point(2400, 10)});
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle003", position:new flash.geom.Point(1500, 10)});
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle002", position:new flash.geom.Point(4500, 10)});
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle004", position:new flash.geom.Point(5000, 10)});
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle001", position:new flash.geom.Point(5900, 10)});
aObstaclesDef[4].push({sLinkage:"bg_snow_obstacle003", position:new flash.geom.Point(400, 10)});
aHostilesDef[4] = new Array();
aHostilesDef[4].push({type:Cannon, position:new flash.geom.Point(700, 40), id:1});
aHostilesDef[4].push({type:Cannon, position:new flash.geom.Point(3400, 40), id:1});
aHostilesDef[4].push({type:Cannon, position:new flash.geom.Point(4700, 40), id:1});
aHostilesDef[4].push({type:MissileLauncher, position:new flash.geom.Point(1800, 30), id:1});
aHostilesDef[4].push({type:MissileLauncher, position:new flash.geom.Point(2800, 30), id:1});
aHostilesDef[4].push({type:MissileLauncher, position:new flash.geom.Point(1100, 30), id:1});
aPlatformsDef[4] = new Array();
aPlatformsDef[4].push({sType:"base", position:new flash.geom.Point(5500, 160)});
aPlatformsDef[4].push({sType:"refill", position:new flash.geom.Point(2150, 80)});
aHostagesDef[4] = new Array();
aHostagesDef[4].push({position:new flash.geom.Point(200, 40), id:1});
aHostagesDef[4].push({position:new flash.geom.Point(100, 40), id:2});
aHostagesDef[4].push({position:new flash.geom.Point(1100, 40), id:0});
aHostagesDef[4].push({position:new flash.geom.Point(1200, 40), id:3});
aHostagesDef[4].push({position:new flash.geom.Point(1300, 40), id:1});
aHostagesDef[4].push({position:new flash.geom.Point(1600, 40), id:2});
aHostagesDef[4].push({position:new flash.geom.Point(2600, 40), id:0});
aHostagesDef[4].push({position:new flash.geom.Point(2700, 40), id:3});
aHostagesDef[4].push({position:new flash.geom.Point(3200, 40), id:1});
aHostagesDef[4].push({position:new flash.geom.Point(3600, 40), id:2});
aHostagesDef[4].push({position:new flash.geom.Point(4000, 40), id:0});
aHostagesDef[4].push({position:new flash.geom.Point(4100, 40), id:3});
aHostagesDef[4].push({position:new flash.geom.Point(4200, 40), id:1});
aHostagesDef[4].push({position:new flash.geom.Point(4900, 40), id:2});
aVehiclesDef[4] = null;
aBgNames[5] = new Array();
aBgNames[5][0] = new Array();
aBgNames[5][0][0] = "bg_snow_back";
aBgNames[5][1] = new Array();
aBgNames[5][1][0] = "bg_snow_middle";
aBgNames[5][2] = new Array();
aBgNames[5][2][0] = "bg_snow_front001";
aBgNames[5][2][1] = "bg_snow_front001";
aBgNames[5][2][2] = "bg_snow_front002";
aBgNames[5][2][3] = "bg_snow_front001";
aBgNames[5][2][4] = "bg_snow_front002";
aBgNames[5][2][5] = "bg_snow_front001";
aBgNames[5][3] = new Array();
aBgNames[5][3][0] = "bg_snow_foreground001";
aBgNames[5][3][1] = "bg_snow_foreground001";
aBgNames[5][3][2] = "bg_snow_foreground001";
aBgNames[5][3][3] = "bg_snow_foreground001";
aBgNames[5][3][4] = "bg_snow_foreground001";
aBgNames[5][3][5] = "bg_snow_foreground001";
aObstaclesDef[5] = new Array();
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle001", position:new flash.geom.Point(1100, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle003", position:new flash.geom.Point(2000, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle002", position:new flash.geom.Point(3000, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle003", position:new flash.geom.Point(3800, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle001", position:new flash.geom.Point(2400, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle004", position:new flash.geom.Point(1500, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle002", position:new flash.geom.Point(4500, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle005", position:new flash.geom.Point(5000, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle004", position:new flash.geom.Point(5900, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle003", position:new flash.geom.Point(400, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle002", position:new flash.geom.Point(6400, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle001", position:new flash.geom.Point(6800, 10)});
aObstaclesDef[5].push({sLinkage:"bg_snow_obstacle003", position:new flash.geom.Point(5500, 10)});
aHostilesDef[5] = new Array();
aHostilesDef[5].push({type:Cannon, position:new flash.geom.Point(900, 40), id:1});
aHostilesDef[5].push({type:Cannon, position:new flash.geom.Point(3400, 40), id:1});
aHostilesDef[5].push({type:Cannon, position:new flash.geom.Point(4700, 40), id:1});
aHostilesDef[5].push({type:Cannon, position:new flash.geom.Point(6100, 40), id:1});
aHostilesDef[5].push({type:MissileLauncher, position:new flash.geom.Point(1800, 30), id:1});
aHostilesDef[5].push({type:MissileLauncher, position:new flash.geom.Point(4800, 30), id:1});
aHostilesDef[5].push({type:MissileLauncher, position:new flash.geom.Point(800, 30), id:1});
aHostilesDef[5].push({type:MissileLauncher, position:new flash.geom.Point(6900, 30), id:1});
aPlatformsDef[5] = new Array();
aPlatformsDef[5].push({sType:"base", position:new flash.geom.Point(2700, 160)});
aPlatformsDef[5].push({sType:"refill", position:new flash.geom.Point(6600, 80)});
aPlatformsDef[5].push({sType:"refill", position:new flash.geom.Point(500, 80)});
aPlatformsDef[5].push({sType:"dropZone", position:new flash.geom.Point(7000, 35)});
aHostagesDef[5] = null;
aVehiclesDef[5] = new Array();
aVehiclesDef[5].push({position:new flash.geom.Point(100, 40), type:0});
aVehiclesDef[5].push({position:new flash.geom.Point(200, 40), type:0});
bonus = aBonuses[level];
aHostagesInd = new Array();
aVehiclesInd = new Array();
aHostilesInd = new Array();
initLevel();
onEnterFrame = init;
}
static function getInstance(Void) {
return(instance);
}
static function getCanvas(Void) {
return(bmpCanvas);
}
function init(Void) {
onEnterFrame = null;
btnSkip.onRelease = mx.utils.Delegate.create(this, onReleaseSkip);
setOnBoardGauge(0);
setPointsGauge(0);
setLivesGauge(lives);
}
function initLevel(Void) {
aAllyShots = new Array();
aHostileShots = new Array();
aAllyMissiles = new Array();
aHostileMissiles = new Array();
aChafs = new Array();
aPoints = new Array();
createBackground();
setObstacles();
setHostiles();
setHostages();
var _local2 = setPlatforms();
setVehicles(_local2.aDropZones);
chopper = new Chopper(_local2.hqPos);
setLivesGauge(lives);
unloadedHostages = aHostagesInd.length;
placedVehicles = aVehiclesInd.length;
if (aHostagesDef[level].length > 0) {
sMissionType = "hostages";
Summary.getInstance().setHostAlpha(100);
} else {
sMissionType = "vehicle";
Summary.getInstance().setHostAlpha(20);
}
draw();
setBonusGauge(bonus);
setOnBoardGauge(0);
}
function startGame(Void) {
trace("START GAME");
Sounds.setVolume("airnuke", 30);
Sounds.playSound("airnuke", 99999);
Sounds.playSound("CHOPPER2", 99999);
Sounds.startAmbience();
onEnterFrame = mainLoop;
}
function stopGame(Void) {
trace("STOP GAME");
Sounds.stopAmbience();
Sounds.stopAllSounds();
onEnterFrame = null;
}
function clearLevel(Void) {
aAllyShots = new Array();
aHostileShots = new Array();
aAllyMissiles = new Array();
aHostileMissiles = new Array();
aChafs = new Array();
aBgBmps = new Array();
aPlatforms = new Array();
aHostages = new Array();
aHostiles = new Array();
aObstacles = new Array();
aVehicles = new Array();
bmpCanvas.dispose();
bmpDead.dispose();
bmpChopper.dispose();
bmpShots.dispose();
}
function createBackground() {
var _local5 = aBgNames[level].length;
aBgBmps = new Array(_local5);
var _local2 = 0;
while (_local2 < _local5) {
var _local4 = aBgNames[level][_local2].length;
aBgBmps[_local2] = new Object();
aBgBmps[_local2].aBmps = new Array(_local4);
aBgBmps[_local2].totalWidth = 0;
aBgBmps[_local2].segmentWidth = 0;
var _local3 = 0;
while (_local3 < _local4) {
aBgBmps[_local2].aBmps[_local3] = flash.display.BitmapData.loadBitmap(aBgNames[level][_local2][_local3]);
aBgBmps[_local2].totalWidth = aBgBmps[_local2].totalWidth + aBgBmps[_local2].aBmps[_local3].width;
aBgBmps[_local2].segmentWidth = aBgBmps[_local2].aBmps[_local3].width;
_local3++;
}
_local2++;
}
bmpCanvas = new flash.display.BitmapData(screenW, screenH, true, 0);
mcCanvas.attachBitmap(bmpCanvas, 0, "Never");
bmpDead = new flash.display.BitmapData(screenW, screenH, true, 0);
mcCanvas.attachBitmap(bmpDead, 1);
bmpChopper = new flash.display.BitmapData(screenW, screenH, true, 0);
mcCanvas.attachBitmap(bmpChopper, 2, "Never");
bmpShots = new flash.display.BitmapData(screenW, screenH, true, 0);
mcCanvas.attachBitmap(bmpShots, 3, "Never");
bmpForeground = new flash.display.BitmapData(screenW, screenH, true, 0);
mcCanvas.attachBitmap(bmpForeground, 4, "Never");
levelWidth = aBgBmps[2].aBmps.length * 1200;
}
function setObstacles(Void) {
aObstacles = new Array();
var _local4 = aObstaclesDef[level].length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = aObstaclesDef[level][_local2];
aObstacles[_local2] = new Obstacle(_local3.sLinkage, _local3.position);
_local2++;
}
}
function setHostiles(Void) {
aHostiles = new Array();
var _local4 = aHostilesDef[level].length;
var _local2 = 0;
while (_local2 < _local4) {
if (!isHostileInd(_local2)) {
var _local3 = aHostilesDef[level][_local2];
aHostiles[_local2] = new _local3.type(_local3.position, _local3.id, _local2);
}
_local2++;
}
}
function removeHostile(refHostile) {
var _local4 = aHostiles.length;
var _local2 = 0;
while (_local2 < _local4) {
if (refHostile == aHostiles[_local2]) {
aHostiles.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function setPlatforms(Void) {
var _local6;
var _local5 = new Array();
aPlatforms = new Array();
var _local4 = aPlatformsDef[level].length;
var _local2 = 0;
while (_local2 < _local4) {
var _local3 = aPlatformsDef[level][_local2];
aPlatforms[_local2] = new Platform(_local3.sType, _local3.position);
if (_local3.sType == "base") {
_local6 = aPlatforms[_local2].plaPos.clone();
_local6.x = _local6.x + (aPlatforms[_local2].plaWidth / 2);
} else if (_local3.sType == "dropZone") {
_local5.push(aPlatforms[_local2]);
}
_local2++;
}
return({hqPos:_local6, aDropZones:_local5});
}
function setHostages(Void) {
aHostages = new Array();
var _local4 = aHostagesDef[level].length;
var _local2 = 0;
while (_local2 < _local4) {
if (!isHostageInd(_local2)) {
var _local3 = aHostagesDef[level][_local2];
aHostages[_local2] = new Hostage(_local3.position, _local3.id, _local2);
}
_local2++;
}
}
function addHostage(pos, id, index) {
if ((index == undefined) || (index == null)) {
index = aHostages.length;
}
var _local3 = new Hostage(pos, id, index);
aHostages.push(_local3);
return(_local3);
}
function removeHostage(refHostage) {
var _local4 = aHostages.length;
var _local2 = 0;
while (_local2 < _local4) {
if (refHostage == aHostages[_local2]) {
aHostages.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function setVehicles(aDropZones) {
aVehicles = new Array();
var _local4 = aVehiclesDef[level].length;
var _local2 = 0;
while (_local2 < _local4) {
if (!isVehicleInd(_local2)) {
var _local3 = aVehiclesDef[level][_local2];
aVehicles[_local2] = new Vehicle(_local3.position, _local3.type, aDropZones, _local2);
}
_local2++;
}
}
function removeVehicle(refVehicle) {
var _local4 = aVehicles.length;
var _local2 = 0;
while (_local2 < _local4) {
if (refVehicle == aVehicles[_local2]) {
aVehicles.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function mainLoop(Void) {
step();
draw();
}
function step(Void) {
chopper.step(aHostiles, aPlatforms);
var _local6 = chopper.getPosition();
var _local5 = chopper.getVelocity();
var _local2 = aAllyShots.length;
var _local3 = 0;
while (_local3 < _local2) {
aAllyShots[_local3].step();
_local3++;
}
_local2 = aHostileShots.length;
_local3 = 0;
while (_local3 < _local2) {
aHostileShots[_local3].step();
_local3++;
}
_local2 = aHostileMissiles.length;
_local3 = 0;
while (_local3 < _local2) {
var _local4;
if (aChafs.length > 0) {
_local4 = aHostileMissiles[_local3].findNearest(aChafs);
} else {
_local4 = chopper;
}
aHostileMissiles[_local3].step(_local4, false);
_local3++;
}
_local2 = aHostiles.length;
_local3 = 0;
while (_local3 < _local2) {
aHostiles[_local3].step(_local6, _local5, aAllyShots);
_local3++;
}
_local2 = aHostages.length;
_local3 = 0;
while (_local3 < _local2) {
aHostages[_local3].step(chopper.rope);
_local3++;
}
_local2 = aVehicles.length;
_local3 = 0;
while (_local3 < _local2) {
aVehicles[_local3].step(chopper.rope);
_local3++;
}
_local2 = aChafs.length;
_local3 = 0;
while (_local3 < _local2) {
aChafs[_local3].step();
_local3++;
}
_local2 = aPoints.length;
_local3 = 0;
while (_local3 < _local2) {
aPoints[_local3].step();
_local3++;
}
if (bonus > 0) {
bonus = bonus - 0.5;
setBonusGauge(Math.floor(bonus));
}
}
function draw(Void) {
var _local7 = chopper.getPosition();
bmpDead.fillRect(bmpDead.rectangle, 0);
bmpForeground.fillRect(new flash.geom.Rectangle(0, 330, screenW, 70), 0);
bmpShots.fillRect(bmpShots.rectangle, 0);
var _local10 = chopper.getScreenPos();
bmpChopper.fillRect(new flash.geom.Rectangle(_local10.x - 70, (screenH - _local10.y) - 65, 140, 130), 0);
var _local5;
var _local3;
var _local2;
_local3 = _local7.x - (screenW * 0.5);
_local3 = _local3 * ((aBgBmps[0].totalWidth - 550) / (levelWidth - 550));
if (_local3 < 0) {
_local3 = 0;
} else if ((_local3 + screenW) > aBgBmps[0].totalWidth) {
_local3 = aBgBmps[0].totalWidth - screenW;
}
bmpCanvas.copyPixels(aBgBmps[0].aBmps[0], new flash.geom.Rectangle(_local3, 0, _local3 + screenW, 400), new flash.geom.Point(0, 0), null, null, true);
_local3 = _local7.x - (screenW * 0.5);
_local3 = _local3 * ((aBgBmps[1].totalWidth - 550) / (levelWidth - 550));
if (_local3 < 0) {
_local3 = 0;
} else if ((_local3 + screenW) > aBgBmps[1].totalWidth) {
_local3 = aBgBmps[1].totalWidth - screenW;
}
bmpCanvas.copyPixels(aBgBmps[1].aBmps[0], new flash.geom.Rectangle(_local3, 0, _local3 + screenW, 400), new flash.geom.Point(0, 400 - aBgBmps[1].aBmps[0].height), null, null, true);
_local3 = _local7.x - (screenW * 0.5);
_local3 = _local3 * ((aBgBmps[2].totalWidth - 550) / (levelWidth - 550));
if (_local3 < 0) {
_local3 = 0;
} else if ((_local3 + screenW) > aBgBmps[2].totalWidth) {
_local3 = aBgBmps[2].totalWidth - screenW;
}
var _local6 = Math.floor(_local3 / aBgBmps[2].segmentWidth);
var _local8 = _local3 - (aBgBmps[2].segmentWidth * _local6);
bmpCanvas.copyPixels(aBgBmps[2].aBmps[_local6], new flash.geom.Rectangle(_local8, 0, _local8 + screenW, 400), new flash.geom.Point(0, 400 - aBgBmps[2].aBmps[_local6].height), null, null, true);
if ((_local8 + screenW) > aBgBmps[2].segmentWidth) {
_local6++;
var _local9 = aBgBmps[2].segmentWidth - _local8;
bmpCanvas.copyPixels(aBgBmps[2].aBmps[_local6], new flash.geom.Rectangle(0, 0, (screenW - _local9) + 2, 400), new flash.geom.Point(_local9, 400 - aBgBmps[2].aBmps[_local6].height), null, null, true);
}
_local3 = _local7.x - (screenW * 0.5);
if (_local3 < 0) {
_local3 = 0;
} else if ((_local3 + screenW) > levelWidth) {
_local3 = levelWidth - screenW;
}
_local2 = _local3;
_local5 = aPlatforms.length;
var _local4 = 0;
while (_local4 < _local5) {
aPlatforms[_local4].draw(_local2);
_local4++;
}
_local5 = aObstacles.length;
_local4 = 0;
while (_local4 < _local5) {
aObstacles[_local4].draw(_local2);
_local4++;
}
_local3 = _local7.x - (screenW * 0.5);
_local3 = _local3 * ((aBgBmps[3].totalWidth - 550) / (levelWidth - 550));
if (_local3 < 0) {
_local3 = 0;
} else if ((_local3 + screenW) > aBgBmps[3].totalWidth) {
_local3 = aBgBmps[3].totalWidth - screenW;
}
_local6 = Math.floor(_local3 / aBgBmps[3].segmentWidth);
_local8 = _local3 - (aBgBmps[3].segmentWidth * _local6);
bmpForeground.copyPixels(aBgBmps[3].aBmps[_local6], new flash.geom.Rectangle(_local8, 0, _local8 + screenW, 400), new flash.geom.Point(0, 400 - aBgBmps[3].aBmps[_local6].height), null, null, true);
if ((_local8 + screenW) > aBgBmps[3].segmentWidth) {
_local6++;
var _local9 = aBgBmps[3].segmentWidth - _local8;
bmpForeground.copyPixels(aBgBmps[3].aBmps[_local6], new flash.geom.Rectangle(0, 0, (screenW - _local9) + 2, 400), new flash.geom.Point(_local9, 400 - aBgBmps[3].aBmps[_local6].height), null, null, true);
}
chopper.draw(levelWidth);
_local5 = aHostages.length;
_local4 = 0;
while (_local4 < _local5) {
aHostages[_local4].draw(_local2);
_local4++;
}
_local5 = aVehicles.length;
_local4 = 0;
while (_local4 < _local5) {
aVehicles[_local4].draw(_local2);
_local4++;
}
_local5 = aHostiles.length;
_local4 = 0;
while (_local4 < _local5) {
aHostiles[_local4].draw(_local2);
_local4++;
}
_local5 = aAllyShots.length;
_local4 = 0;
while (_local4 < _local5) {
aAllyShots[_local4].draw(_local2);
_local4++;
}
_local5 = aHostileShots.length;
_local4 = 0;
while (_local4 < _local5) {
aHostileShots[_local4].draw(_local2);
_local4++;
}
_local5 = aHostileMissiles.length;
_local4 = 0;
while (_local4 < _local5) {
aHostileMissiles[_local4].draw(_local2);
_local4++;
}
_local5 = aChafs.length;
_local4 = 0;
while (_local4 < _local5) {
aChafs[_local4].draw(_local2);
_local4++;
}
_local5 = aPoints.length;
_local4 = 0;
while (_local4 < _local5) {
aPoints[_local4].draw(_local2);
_local4++;
}
}
function createShot(bAlly, shotPos, shotVel, flightTime) {
if (bAlly) {
var _local2 = new Shot("chopper shot", shotPos, shotVel);
aAllyShots.push(_local2);
} else {
var _local2 = new ShotHostile("tank shot", shotPos, shotVel, flightTime);
aHostileShots.push(_local2);
}
}
function removeAllyShot(refShot) {
var _local4 = aAllyShots.length;
var _local2 = 0;
while (_local2 < _local4) {
if (refShot == aAllyShots[_local2]) {
aAllyShots.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function removeHostileShot(refShot) {
var _local4 = aHostileShots.length;
var _local2 = 0;
while (_local2 < _local4) {
if (refShot == aHostileShots[_local2]) {
aHostileShots.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function createExplosion(pos) {
aHostileShots.push(new AirExplosion(pos));
}
function createMissile(bAlly, missilePos, refTarget) {
if (bAlly) {
var _local2 = new Missile("missile", missilePos, refTarget);
aAllyMissiles.push(_local2);
} else {
var _local2 = new Missile("missile", missilePos, chopper);
aHostileMissiles.push(_local2);
}
}
function removeAllyMissile(refMissile) {
var _local4 = aAllyMissiles.length;
var _local2 = 0;
while (_local2 < _local4) {
if (refMissile == aAllyMissiles[_local2]) {
aAllyMissiles.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function removeHostileMissile(refMissile) {
var _local4 = aHostileMissiles.length;
var _local2 = 0;
while (_local2 < _local4) {
if (refMissile == aHostileMissiles[_local2]) {
aHostileMissiles.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function createChaf(chafPos, chafVel) {
aChafs.push(new Chaf(chafPos, chafVel));
}
function removeChaf(refChaf) {
var _local4 = aChafs.length;
var _local2 = 0;
while (_local2 < _local4) {
if (refChaf == aChafs[_local2]) {
aChafs.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function createPoints(pos, value) {
aPoints.push(new PointsCloud(pos, value));
}
function removePoints(refPoints) {
var _local4 = aPoints.length;
var _local2 = 0;
while (_local2 < _local4) {
if (refPoints == aPoints[_local2]) {
aPoints.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function setFuelGauge(amount) {
Summary.getInstance().setFuelGauge(Math.round(amount));
}
function setChafsGauge(amount) {
Summary.getInstance().setChafsGauge(amount);
}
function setLivesGauge(amount) {
Summary.getInstance().setLivesGauge(amount);
}
function setPointsGauge(amount) {
Summary.getInstance().setPointsGauge(amount);
}
function setOnBoardGauge(amount, maxAmount) {
if (amount == undefined) {
amount = 0;
}
amount = amount + unloadedHostages;
maxAmount = aHostagesDef[level].length;
if (maxAmount == undefined) {
maxAmount = 0;
}
Summary.getInstance().setOnBoardGauge(amount, maxAmount);
}
function setBonusGauge(amount) {
Summary.getInstance().setBonusGauge(amount);
}
function actionOnPlatform(sType, pos) {
if (sType == "base") {
if (((unloadTime--) < 0) && (chopper.aHostTaken.length > 0)) {
unloadTime = 40;
var _local2 = chopper.aHostTaken.shift();
var _local3 = addHostage(new flash.geom.Point(), _local2.id, _local2.index);
_local3.getOut(pos);
setOnBoardGauge(chopper.aHostTaken.length, chopper.maxLoad);
addPoints(chopper.getPosition(), 500);
}
}
if (sType != "dropZone") {
chopper.fuel = chopper.fuel + 1;
if (chopper.fuel > 100) {
chopper.fuel = 100;
}
chopper.chafs = chopper.chafs + 1;
if (chopper.chafs > chopper.maxChafs) {
chopper.chafs = chopper.maxChafs;
}
setChafsGauge(chopper.chafs);
}
}
function onLooseLife(Void) {
lives--;
setLivesGauge(lives);
stopGame();
if (lives == 0) {
gameOver(false);
} else {
clearLevel();
initLevel();
startGame();
}
}
function gameOver(bSuccess) {
mcPanel.showGameOver(bSuccess);
Sounds.playSound("loop3", 99999);
}
function checkIfCompleted(Void) {
if (sMissionType == "hostages") {
if (aHostagesDef[level].length == unloadedHostages) {
stopGame();
showSummary();
points = points + Math.floor(bonus);
setPointsGauge(points);
}
} else {
placedVehicles++;
if (placedVehicles == aVehiclesDef[level].length) {
stopGame();
showSummary();
points = points + Math.floor(bonus);
setPointsGauge(points);
}
}
}
function showSummary() {
if (level >= lastLevel) {
gameOver(true);
} else {
mcPanel.showMission();
}
Sounds.playSound("loop3", 99999);
}
function setNextLevel(Void) {
aHostagesInd = new Array();
aHostilesInd = new Array();
aVehiclesInd = new Array();
clearLevel();
level++;
initLevel();
bonus = aBonuses[level];
}
function addPoints(pos, value) {
points = points + value;
createPoints(pos, value);
setPointsGauge(points);
}
function getPoints(Void) {
return(points);
}
function onReleaseSkip(Void) {
stopGame();
showSummary();
points = points + Math.floor(bonus);
setPointsGauge(points);
}
function saveHostageInd(ind) {
aHostagesInd.push(ind);
}
function removeHostageInd(ind) {
var _local3 = aHostagesInd.length;
var _local2 = 0;
while (_local2 < _local3) {
if (ind == aHostagesInd[_local2]) {
aHostages.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function isHostageInd(ind) {
var _local3 = aHostagesInd.length;
var _local2 = 0;
while (_local2 < _local3) {
if (ind == aHostagesInd[_local2]) {
return(true);
}
_local2++;
}
return(false);
}
function saveHostileInd(ind) {
aHostilesInd.push(ind);
}
function removeHostileInd(ind) {
var _local3 = aHostilesInd.length;
var _local2 = 0;
while (_local2 < _local3) {
if (ind == aHostilesInd[_local2]) {
aHostiles.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function isHostileInd(ind) {
var _local3 = aHostilesInd.length;
var _local2 = 0;
while (_local2 < _local3) {
if (ind == aHostilesInd[_local2]) {
return(true);
}
_local2++;
}
return(false);
}
function saveVehicleInd(ind) {
aVehiclesInd.push(ind);
}
function removeVehicleInd(ind) {
var _local3 = aVehiclesInd.length;
var _local2 = 0;
while (_local2 < _local3) {
if (ind == aVehiclesInd[_local2]) {
aVehicles.splice(_local2, 1);
return(undefined);
}
_local2++;
}
}
function isVehicleInd(ind) {
var _local3 = aVehiclesInd.length;
var _local2 = 0;
while (_local2 < _local3) {
if (ind == aVehiclesInd[_local2]) {
return(true);
}
_local2++;
}
return(false);
}
function createShrapnel(pos) {
aPoints.push(new Particle(pos));
aPoints.push(new Particle(pos));
aPoints.push(new Particle(pos));
}
function removeShrapnel(refShrapnel) {
removePoints(refShrapnel);
}
static var gravity = 0.02;
static var screenH = 400;
static var screenW = 550;
static var level = 0;
static var lastLevel = 5;
var lives = 3;
var points = 0;
var unloadTime = 10;
}
Symbol 426 MovieClip [__Packages.Chopper] Frame 0
class Chopper
{
var refGame, bmpChopper, bmpBackRot, bmpTopRot, bmpExplode, bmpWheels, bmpTmp, bmpCanvas, width, height, acc, accMax, speed, position, bOnPlatform, screenPos, frame, backFrame, topFrame, frameExp, screenH, airDrag, rotation, maxRot, bShowWheels, frameWheels, fuel, aHostTaken, energy, bDestroyed, bShowExplosion, bTurn, turnDir, turnDelay, chafs, bChaf, chafDelay, bShot, shotDelay, cannonAngle, cannonAngleMin, cannonAngleMax, bAutoAim, aCannonPos, aTopPos, rope, ropePos, aBottom, ropeEndPos, bRopePress;
function Chopper (newPos) {
refGame = Game.getInstance();
bmpChopper = flash.display.BitmapData.loadBitmap("chopper");
bmpBackRot = flash.display.BitmapData.loadBitmap("backRot");
bmpTopRot = flash.display.BitmapData.loadBitmap("topRot");
bmpExplode = flash.display.BitmapData.loadBitmap("explosion0");
bmpWheels = flash.display.BitmapData.loadBitmap("chopper wheels");
bmpTmp = new flash.display.BitmapData(130, 58);
bmpCanvas = Game.bmpChopper;
width = 130;
height = 53;
acc = new flash.geom.Point(0, 0);
accMax = new flash.geom.Point(15, 5);
speed = new flash.geom.Point(0, 0);
position = newPos.clone();
position.y = position.y + 27;
bOnPlatform = false;
screenPos = new flash.geom.Point();
frame = 3;
backFrame = 1;
topFrame = 1;
frameExp = 0;
screenH = Game.screenH;
airDrag = 0.98;
rotation = 0;
maxRot = 0.523598775598299;
bShowWheels = true;
frameWheels = 6;
fuel = 100;
aHostTaken = new Array();
energy = 5;
bDestroyed = false;
bShowExplosion = false;
bTurn = false;
turnDir = -1;
turnDelay = 0;
chafs = maxChafs;
bChaf = false;
chafDelay = 0;
bShot = false;
shotDelay = 0;
cannonAngle = 0;
cannonAngleMin = -0.785398163397448;
cannonAngleMax = 0.174532925199433;
bAutoAim = true;
aCannonPos = new Array();
aCannonPos[0] = new flash.geom.Point(-15, -50);
aCannonPos[3] = new flash.geom.Point(0, -50);
aCannonPos[6] = new flash.geom.Point(15, -50);
aTopPos = new Array();
aTopPos[0] = new flash.geom.Point(49, 19);
aTopPos[1] = new flash.geom.Point(59, 19);
aTopPos[2] = new flash.geom.Point(65, 19);
aTopPos[3] = new flash.geom.Point(65, 19);
aTopPos[4] = new flash.geom.Point(65, 19);
aTopPos[5] = new flash.geom.Point(72, 19);
aTopPos[6] = new flash.geom.Point(84, 19);
rope = new Rope(this);
ropePos = new flash.geom.Point(0, -24);
refGame.setFuelGauge(fuel);
refGame.setChafsGauge(chafs);
refGame.setOnBoardGauge(0, maxLoad);
aBottom = new Array();
aBottom[0] = {x0:-22, x1:2};
aBottom[3] = {x0:-12, x1:12};
aBottom[6] = {x0:-2, x1:22};
}
function getPosition(Void) {
return(position.clone());
}
function getScreenPos(Void) {
return(screenPos.clone());
}
function getVelocity(Void) {
return(speed.clone());
}
function step(aTargets, aPlatforms) {
if (bDestroyed) {
return(undefined);
}
keyControl();
if (bOnPlatform) {
acc.x = 0;
}
bOnPlatform = false;
if (rope.bHasCargo) {
var _local7 = rope.refCargo.weightFactor;
if ((_local7 > 1) && (rope.length >= 50)) {
acc.y = acc.y - 0.1;
acc.x = acc.x / _local7;
acc.y = acc.y / _local7;
}
}
if (fuel > 0) {
if (!bGodMode) {
fuel = fuel - 0.05;
if ((fuel < 30) && (!bFuelSnd)) {
bFuelSnd = true;
Sounds.playSound("warning_alarm", 99999);
} else if ((fuel > 30) && (bFuelSnd)) {
bFuelSnd = false;
Sounds.stopSound("warning_alarm");
}
}
} else {
acc.y = -0.2;
}
refGame.setFuelGauge(fuel);
if (bTurn || (((frame != 0) && (frame != 3)) && (frame != 6))) {
if ((turnDelay--) < 0) {
frame = frame + turnDir;
turnDelay = 1;
if (frame <= 0) {
frame = 0;
if (!bTurn) {
bTurn = false;
}
} else if (frame >= 6) {
frame = 6;
if (!bTurn) {
bTurn = false;
}
}
}
}
var _local2 = new flash.geom.Point();
_local2.x = position.x;
_local2.y = position.y - 25;
switch (frame) {
case 0 :
_local2.x = _local2.x - (15 * Math.cos(-rotation));
_local2.y = _local2.y + (15 * Math.sin(-rotation));
break;
case 6 :
_local2.x = _local2.x + (15 * Math.cos(rotation));
_local2.y = _local2.y + (15 * Math.sin(rotation));
}
if (bAutoAim) {
var _local8 = findNearest(aTargets, true);
if (_local8 != null) {
var _local9 = _local8.getPosition();
var _local11 = _local9.x - _local2.x;
var _local10 = _local9.y - _local2.y;
var _local13 = Math.atan2(_local10, _local11);
cannonAngle = _local13 - rotation;
if (frame == 6) {
if (cannonAngle > cannonAngleMax) {
cannonAngle = cannonAngleMax;
} else if (cannonAngle < cannonAngleMin) {
cannonAngle = cannonAngleMin;
}
} else if (frame == 0) {
if ((cannonAngle > 0) && (cannonAngle < (Math.PI - cannonAngleMax))) {
cannonAngle = Math.PI - cannonAngleMax;
} else if ((cannonAngle < 0) && (cannonAngle > (-3.14159265358979 - cannonAngleMin))) {
cannonAngle = -3.14159265358979 - cannonAngleMin;
}
}
} else {
cannonAngle = ((frame == 6) ? 0 : Math.PI);
}
}
var _local3 = rotation + cannonAngle;
if (frame == 0) {
_local3 = rotation + cannonAngle;
}
if (bShot && (((frame == 0) || (frame == 6)) || (frame == 3))) {
if ((shotDelay--) < 0) {
shotDelay = 3;
var _local14 = true;
var _local5 = new flash.geom.Point(0, 0);
var _local4 = 13;
switch (frame) {
case 0 :
_local5 = new flash.geom.Point(_local4 * Math.cos(_local3), _local4 * Math.sin(_local3));
_local2.y = _local2.y - Math.round(4 * Math.random());
break;
case 3 :
_local5 = new flash.geom.Point(0, -_local4);
break;
case 6 :
_local5 = new flash.geom.Point(_local4 * Math.cos(_local3), _local4 * Math.sin(_local3));
_local2.y = _local2.y - Math.round(4 * Math.random());
}
_local5.x = _local5.x + speed.x;
refGame.createShot(_local14, _local2, _local5);
}
}
if ((chafDelay--) < 0) {
chafDelay = 0;
}
if ((bChaf && (chafDelay == 0)) && (chafs > 0)) {
chafDelay = 10;
chafs--;
refGame.setChafsGauge(chafs);
var _local12 = position.clone();
var _local6 = new flash.geom.Point();
if (speed.x == 0) {
speed.x = Number.MIN_VALUE;
}
if (speed.y == 0) {
speed.y = Number.MIN_VALUE;
}
_local6.x = ((-(0 + (1 * Math.random()))) * Math.abs(speed.x)) / speed.x;
_local6.y = ((-(0 + (1 * Math.random()))) * Math.abs(speed.y)) / speed.y;
refGame.createChaf(_local12, _local6);
}
backFrame++;
backFrame = backFrame % 7;
topFrame++;
topFrame = topFrame % 14;
acc.y = acc.y - Game.gravity;
speed.x = speed.x + acc.x;
speed.y = speed.y + acc.y;
speed.x = speed.x * airDrag;
speed.y = speed.y * airDrag;
position.x = position.x + speed.x;
position.y = position.y + speed.y;
if (position.x < 0) {
position.x = 0;
speed.x = speed.x - (speed.x * 0.1);
} else if (position.x > refGame.levelWidth) {
position.x = refGame.levelWidth;
speed.x = speed.x - (speed.x * 0.1);
}
if (position.y < 50) {
position.y = 50;
die();
} else if (position.y > 340) {
position.y = 340;
speed.y = 0;
}
rotation = (-12.5663706143592 * speed.x) / 180;
if (rotation > maxRot) {
rotation = maxRot;
} else if (rotation < (-maxRot)) {
rotation = -maxRot;
}
var _local15 = new flash.geom.Point(24 * Math.sin(rotation), -24 * Math.cos(rotation));
ropeEndPos = rope.step(position.add(_local15), speed);
checkPlatforms(aPlatforms);
if (!bOnPlatform) {
if (checkCollision()) {
die();
}
}
}
function draw(levelWidth) {
if (!bDestroyed) {
bmpTmp.fillRect(bmpTmp.rectangle, 0);
if (frame == 0) {
drawTopRot(aTopPos[frame]);
drawChopper();
drawBackRot();
} else if (frame == 6) {
drawBackRot();
drawTopRot(aTopPos[frame]);
drawChopper();
} else {
drawTopRot(aTopPos[frame]);
drawChopper();
}
var _local3 = new flash.geom.Matrix();
_local3.translate((-bmpTmp.width) / 2, (-bmpTmp.height) / 2);
var _local5 = new flash.geom.Matrix();
_local5.rotate(-rotation);
_local3.concat(_local5);
var _local13 = bmpTmp.width;
var _local11 = bmpTmp.height;
var _local2 = Game.screenW * 0.5;
if (position.x < (Game.screenW * 0.5)) {
_local2 = position.x;
} else if (position.x > (levelWidth - (Game.screenW * 0.5))) {
_local2 = _local2 * 2;
_local2 = _local2 - (levelWidth - position.x);
}
var _local4 = new flash.geom.Matrix();
_local4.translate(_local2, screenH - position.y);
_local3.concat(_local4);
var _local7 = null;
var _local6 = "normal";
var _local8 = null;
var _local10 = true;
screenPos.y = position.y;
screenPos.x = _local2;
bmpCanvas.draw(bmpTmp, _local3, _local7, _local6, _local8, _local10);
if (bShowExplosion) {
drawExplosion(screenPos, false);
}
var _local9 = new flash.geom.Point(24 * Math.sin(rotation), -24 * Math.cos(rotation));
rope.draw(screenPos.add(_local9));
} else {
drawExplosion(screenPos, true);
}
}
function drawBackRot(Void) {
var _local3 = new flash.geom.Rectangle(0, 23 * backFrame, 23, 23);
var _local2 = new flash.geom.Point();
if (frame == 0) {
_local2.x = 105;
_local2.y = 0;
} else if (frame == 6) {
_local2.x = 1;
_local2.y = 0;
}
bmpTmp.copyPixels(bmpBackRot, _local3, _local2, null, null, true);
}
function drawTopRot(pos) {
pos = new flash.geom.Point(65, 15);
if ((topFrame % 2) == 0) {
var _local3 = new flash.geom.Point(pos.x - (bmpTopRot.width / 2), pos.y - bmpTopRot.height);
bmpTmp.copyPixels(bmpTopRot, bmpTopRot.rectangle, _local3, null, null, true);
}
}
function drawChopper(Void) {
if (bShowWheels) {
if (frameWheels < 6) {
frameWheels = frameWheels + 2;
}
var _local2 = new flash.geom.Rectangle(0, 10 * Math.round(frame / 3), 130, 10);
var _local3 = new flash.geom.Point(0, 41 + frameWheels);
bmpTmp.copyPixels(bmpWheels, _local2, _local3, null, null, true);
} else if (frameWheels > 0) {
if ((frame % 3) != 0) {
frameWheels = 0;
}
var _local2 = new flash.geom.Rectangle(0, 10 * Math.round(frame / 3), 130, 10);
var _local3 = new flash.geom.Point(0, 41 + frameWheels);
bmpTmp.copyPixels(bmpWheels, _local2, _local3, null, null, true);
frameWheels = frameWheels - 2;
}
var _local2 = new flash.geom.Rectangle(0, 53 * frame, 130, 53);
var _local3 = new flash.geom.Point(0, 0);
bmpTmp.copyPixels(bmpChopper, _local2, _local3, null, null, true);
}
function drawExplosion(pos, bRemove) {
var _local3 = _root.attachMovie("explosion0", "mcExp", _root.getNextHighestDepth());
_local3.gotoAndStop(frameExp + 1);
var _local4 = new flash.geom.Matrix();
_local4.translate(pos.x, Game.screenH - pos.y);
bmpCanvas.draw(_local3, _local4, null, null, null, true);
_local3.removeMovieClip();
frameExp++;
if (frameExp == 35) {
if (bRemove) {
onEndDeadAnim();
} else {
bShowExplosion = false;
}
}
}
function keyControl(Void) {
var _local3 = 38;
var _local7 = 40;
var _local4 = 37;
var _local6 = 39;
var _local2 = 67;
var _local9 = 88;
var _local5 = 90;
var _local8 = 32;
acc.y = 0;
if (Key.isDown(_local3)) {
acc.y = acc.y + 0.25;
if (acc.y > accMax.y) {
acc.y = accMax.y;
}
} else if (Key.isDown(_local7)) {
acc.y = acc.y - 0.25;
if (acc.y < (-accMax.y)) {
acc.y = -accMax.y;
}
}
acc.x = 0;
if (!bOnPlatform) {
if (Key.isDown(_local4)) {
acc.x = -0.3;
if ((!bShot) && ((!bTurn) || (turnDir == 1))) {
bTurn = true;
turnDir = -1;
turnDelay = 0;
}
} else if (Key.isDown(_local6)) {
acc.x = 0.3;
if ((!bShot) && ((!bTurn) || (turnDir == -1))) {
bTurn = true;
turnDir = 1;
turnDelay = 0;
}
} else {
bTurn = false;
}
}
if (Key.isDown(_local5)) {
bChaf = true;
} else {
bChaf = false;
}
if (Key.isDown(_local2) && (!bShot)) {
bShot = true;
Sounds.playSound("ak47", 99999);
} else if ((!Key.isDown(_local2)) && (bShot)) {
bShot = false;
Sounds.stopSound("ak47");
}
if (Key.isDown(_local8) && (aHostTaken.length < maxLoad)) {
if (!bRopePress) {
bRopePress = true;
rope.switchMode();
}
} else {
bRopePress = false;
}
}
function getDamage(damage) {
energy = energy - damage;
if (energy <= 0) {
die();
} else {
frameExp = 0;
bShowExplosion = true;
}
}
function die(Void) {
if (bGodMode) {
return(undefined);
}
Sounds.stopSound("CHOPPER2");
Sounds.playSound("bazooka");
bDestroyed = true;
frameExp = 0;
Game.getInstance().removeHostage(rope.refCargo);
if (rope.refCargo.sType == "vehicle") {
rope.switchMode();
}
}
function findNearest(aObjects, bInFront) {
var _local11 = aObjects.length;
var _local8 = Number.MAX_VALUE;
var _local6 = Number.MAX_VALUE;
var _local10 = null;
var _local9 = null;
var _local2 = 0;
while (_local2 < _local11) {
if (aObjects[_local2].bOnScreen) {
var _local4 = aObjects[_local2].getPosition();
var _local7 = _local4.subtract(position);
var _local3 = _local7.length;
if (_local3 < _local8) {
_local8 = _local3;
_local10 = aObjects[_local2];
}
if ((((frame == 0) && (_local4.x < position.x)) && (_local3 < _local6)) || (((frame == 6) && (_local4.x > position.x)) && (_local3 < _local6))) {
_local6 = _local3;
_local9 = aObjects[_local2];
}
}
_local2++;
}
return((bInFront ? (_local9) : (_local10)));
}
function increaseLoad(id, index) {
aHostTaken.push({id:id, index:index});
refGame.setOnBoardGauge(aHostTaken.length, maxLoad);
if (aHostTaken.length >= maxLoad) {
refGame.mcAlert.gotoAndPlay("show");
}
}
function onEndDeadAnim(Void) {
refGame.onLooseLife();
}
function checkCollision(Void) {
var _local1 = new flash.geom.Point(0, 0);
return(Game.bmpDead.hitTest(_local1, 50, Game.bmpChopper, _local1, 254));
}
function checkPlatforms(aPlatforms) {
bOnPlatform = false;
var _local7 = aPlatforms.length;
var _local10 = 40;
var _local9 = height;
var _local4 = 0;
while (_local4 < _local7) {
var _local2 = aPlatforms[_local4];
if (_local2.bOnScreen) {
var _local3;
if (((frame != 0) && (frame != 3)) && (frame != 6)) {
_local3 = aBottom[3];
} else {
_local3 = aBottom[frame];
}
var _local6 = position.x + _local3.x0;
var _local5 = position.x + _local3.x1;
if (((_local2.plaPos.x < _local6) && ((_local2.plaPos.x + _local2.plaWidth) > _local5)) && (position.y > _local2.plaPos.y)) {
if ((position.y - _local2.plaPos.y) < ((height / 2) + 2)) {
if (!bShowWheels) {
bShowWheels = true;
frameWheels = 0;
}
if (speed.length < 2) {
if (acc.y <= 0) {
speed.x = 0;
speed.y = 0;
rotation = 0;
position.y = (1 + _local2.plaPos.y) + (height / 2);
}
bOnPlatform = true;
refGame.actionOnPlatform(_local2.sType, _local2.position);
break;
}
} else if ((position.y - _local2.plaPos.y) < ((height / 2) + 3)) {
if (!bShowWheels) {
bShowWheels = true;
frameWheels = 0;
}
} else {
bShowWheels = false;
}
}
}
_local4++;
}
}
var bGodMode = false;
var maxChafs = 5;
var bFuelSnd = false;
var maxLoad = 5;
var unloadTime = 20;
}
Symbol 427 MovieClip [__Packages.Rope] Frame 0
class Rope
{
var refChopper, bmpRope, bmpCanvas, begPos, endPos, bHasCargo, length, maxLength, mode, angle, maxAngle, angleVel, refCargo, scrPos;
function Rope (refChopperNew) {
refChopper = refChopperNew;
bmpRope = flash.display.BitmapData.loadBitmap("rope");
bmpCanvas = Game.bmpShots;
begPos = new flash.geom.Point();
endPos = new flash.geom.Point();
bHasCargo = false;
length = 0;
maxLength = 100;
mode = 0;
angle = 0;
maxAngle = 1.0471975511966;
angleVel = 0;
refCargo = null;
}
function step(begPosNew, chopVel) {
begPos = begPosNew.clone();
if (mode == 1) {
if (refCargo.sType == "vehicle") {
if (length > 62) {
length = length - 2;
} else if (length < 58) {
length = length + 2;
}
} else if (length < maxLength) {
length = length + 2;
}
} else if (mode == 2) {
if (length > 0) {
length = length - 2;
} else {
refCargo = null;
bHasCargo = false;
length = 0;
angleVel = 0;
setMode(0);
}
}
if (length > 0) {
angle = angle + ((Math.PI * chopVel.x) / 240);
if (angle > maxAngle) {
angle = angle + ((maxAngle - angle) * 0.1);
} else if (angle < (-maxAngle)) {
angle = angle + (((-maxAngle) - angle) * 0.1);
}
var _local3 = 0.006;
var _local2 = (-angle) * _local3;
angleVel = angleVel + _local2;
angleVel = angleVel * 0.97;
angle = angle + angleVel;
do {
endPos.x = begPos.x - (length * Math.sin(angle));
endPos.y = begPos.y - (length * Math.cos(angle));
if (checkCollision() || (endPos.y < 30)) {
length = length - 1;
}
} while (checkCollision() || (endPos.y < 30));
return(endPos);
}
}
function draw(scrPosNew) {
scrPos = scrPosNew.clone();
var _local4 = new flash.display.BitmapData(1, length);
_local4.copyPixels(bmpRope, bmpRope.rectangle, new flash.geom.Point(0, 0));
var _local2 = new flash.geom.Matrix();
_local2.rotate(angle);
var _local3 = new flash.geom.Matrix();
if (angle > 0) {
_local3.translate(scrPos.x, Game.screenH - scrPos.y);
} else {
_local3.translate(scrPos.x, Game.screenH - scrPos.y);
}
_local2.concat(_local3);
var _local5 = true;
bmpCanvas.draw(_local4, _local2, null, null, null, _local5);
}
function setMode(modeNew) {
mode = modeNew;
if (mode == 1) {
endPos = begPos.clone();
}
}
function switchMode(Void) {
if ((mode == 0) || (mode == 2)) {
setMode(1);
} else if (mode == 1) {
setMode(2);
if (refCargo.sType == "vehicle") {
refCargo.mode = 2;
refCargo.vel = refChopper.speed.clone();
}
}
}
function checkCollision(Void) {
var _local3 = scrPos.x + (endPos.x - begPos.x);
var _local2 = Game.screenH - endPos.y;
return(Game.bmpDead.hitTest(new flash.geom.Point(0, 0), 250, new flash.geom.Point(_local3, _local2)));
}
}
Symbol 428 MovieClip [__Packages.Sounds] Frame 0
class Sounds
{
static var mainSounds, mcSoundsHolder, soundsList, randomSoundNamesList, ambienceInterval;
function Sounds () {
}
static function setSounds(Void) {
if (mainSounds == undefined) {
mainSounds = new Sound(_root);
mcSoundsHolder = _root.createEmptyMovieClip("mcSoundsHolder", _root.getNextHighestDepth());
init();
mainSoundUp();
playSound("loop3", 99999);
}
}
static function mainSoundUp(Void) {
_root.mcSoundBtn.gotoAndStop("up");
_root.mcSoundBtn.btnSound.onRelease = mainSoundDown;
mainSounds.setVolume(100);
}
static function mainSoundDown(Void) {
_root.mcSoundBtn.gotoAndStop("down");
_root.mcSoundBtn.btnSound.onRelease = mainSoundUp;
mainSounds.setVolume(0);
}
static function init(Void) {
var _local6 = new Array("airnuke", "ak47", "CHOPPER2", "bazooka", "explos", "explsion", "gunfire", "missile_snd", "warning_alarm", "loop3");
soundsList = new Object();
var _local5 = _local6.length;
var _local2 = 0;
while (_local2 < _local5) {
var _local1 = _local6[_local2];
var _local4 = mcSoundsHolder.createEmptyMovieClip("holder" + _local2, _local2);
soundsList[_local1] = new Sound(_local4);
soundsList[_local1].attachSound(_local1);
_local2++;
}
setVolume("ak47", 150);
setVolume("CHOPPER2", 50);
setVolume("explsion", 150);
randomSoundNamesList = new Array("30cal5", "auto", "explos", "helicopt", "machinegun", "tankfire");
_local5 = randomSoundNamesList.length;
_local2 = 0;
while (_local2 < _local5) {
var _local1 = randomSoundNamesList[_local2];
if (soundsList[_local1] == undefined) {
var _local3 = mcSoundsHolder.getNextHighestDepth();
var _local4 = mcSoundsHolder.createEmptyMovieClip("holder" + _local3, _local3);
soundsList[_local1] = new Sound(_local4);
soundsList[_local1].attachSound(_local1);
}
_local2++;
}
}
static function playSound(name, loops) {
if (loops == undefined) {
loops = 0;
}
soundsList[name].start(0, loops);
}
static function stopSound(name) {
soundsList[name].stop();
}
static function stopAllSounds(sExcept) {
for (var _local1 in soundsList) {
if (_local1 != sExcept) {
stopSound(_local1);
}
}
}
static function setVolume(name, volume) {
soundsList[name].setVolume(volume);
}
static function getVolume(name) {
return(soundsList[name].getVolume());
}
static function playAmbience(Void) {
var _local2 = randomSoundNamesList.length;
var _local3 = Math.floor(_local2 * Math.random());
var _local1 = randomSoundNamesList[_local3];
var _local4 = 20 + Math.floor(15 * Math.random());
setVolume(_local1, _local4);
playSound(_local1, 0);
stopAmbience();
startAmbience();
}
static function startAmbience(bFirst) {
var _local1;
if (bFirst) {
_local1 = 1000 + Math.round(1000 * Math.random());
} else {
_local1 = 1000 + Math.round(1000 * Math.random());
}
ambienceInterval = setInterval(playAmbience, _local1);
}
static function stopAmbience() {
clearInterval(ambienceInterval);
}
}
Symbol 429 MovieClip [__Packages.Platform] Frame 0
class Platform
{
var sType, position, bOnScreen, bmpCanvas, plaPos, plaWidth, radarPos, arrowPos, bmpPlatform, width, screenPos;
function Platform (sTypeNew, pos) {
sType = sTypeNew;
position = pos.clone();
bOnScreen = false;
bmpCanvas = Game.bmpDead;
var _local2;
if (sType == "base") {
_local2 = "platform hq";
plaPos = new flash.geom.Point(position.x + 17, position.y - 87);
plaWidth = 90;
radarPos = new flash.geom.Point(166, 0);
} else if (sType == "refill") {
_local2 = "platform refill";
plaPos = new flash.geom.Point(position.x + 7, position.y - 29);
plaWidth = 84;
radarPos = new flash.geom.Point(131, 0);
} else if (sType == "dropZone") {
_local2 = "platform drop zone";
plaPos = new flash.geom.Point(position.x + 0, position.y - 0);
plaWidth = 89;
arrowPos = new flash.geom.Point(45, 80);
}
bmpPlatform = flash.display.BitmapData.loadBitmap(_local2);
width = bmpPlatform.width;
}
function draw(leftEdge) {
var _local2 = position.x - leftEdge;
var _local3 = position.y;
screenPos = new flash.geom.Point(_local2, _local3);
if ((_local2 > (-bmpPlatform.width)) && (_local2 < Game.screenW)) {
bOnScreen = true;
if (((frame >= 13) && (frame <= 36)) && (sType != "dropZone")) {
drawRadar();
}
bmpCanvas.copyPixels(bmpPlatform, bmpPlatform.rectangle, new flash.geom.Point(screenPos.x, Game.screenH - screenPos.y), null, null, true);
if (((frame < 13) || (frame > 36)) && (sType != "dropZone")) {
drawRadar();
}
if (sType == "dropZone") {
drawArrow();
}
}
}
function drawRadar(Void) {
frame++;
frame = frame % 50;
var _local3 = _root.attachMovie("radar", "radar", 993);
_local3.gotoAndStop(frame + 1);
var _local4 = new flash.geom.Matrix();
_local4.translate(screenPos.x + radarPos.x, Game.screenH - (screenPos.y + radarPos.y));
bmpCanvas.draw(_local3, _local4, null, null, null, true);
_local3.removeMovieClip();
}
function drawArrow(Void) {
frame++;
frame = frame % 10;
var _local3 = _root.attachMovie("arrow", "arrow", 994);
_local3.gotoAndStop(frame + 1);
var _local4 = new flash.geom.Matrix();
_local4.translate(screenPos.x + arrowPos.x, Game.screenH - (screenPos.y + arrowPos.y));
Game.bmpCanvas.draw(_local3, _local4, null, null, null, true);
_local3.removeMovieClip();
}
var frame = 0;
}
Symbol 430 MovieClip [__Packages.Cannon] Frame 0
class Cannon
{
var index, bmpBase, bmpBarrel, bmpExplode, bmpCanvas, position, VEL, energy, frameExp, shotDelay, bOnScreen, bFlash, rotation, screenPos;
function Cannon (pos, type, indexNew) {
index = indexNew;
var _local2 = flash.display.BitmapData.loadBitmap("gunTank");
bmpBase = new flash.display.BitmapData(77, 56, true, 0);
bmpBase.copyPixels(_local2, new flash.geom.Rectangle(0, type * 56, 77, 56), new flash.geom.Point(0, 0), null, null, true);
_local2 = flash.display.BitmapData.loadBitmap("gunTankGun");
bmpBarrel = new flash.display.BitmapData(39, 24, true, 0);
bmpBarrel.copyPixels(_local2, new flash.geom.Rectangle(0, type * 24, 39, 24), new flash.geom.Point(0, 0), null, null, true);
bmpExplode = flash.display.BitmapData.loadBitmap("explosion0");
bmpCanvas = Game.bmpDead;
position = pos.clone();
VEL = 10;
energy = 5;
frameExp = 0;
shotDelay = 1;
bOnScreen = false;
bFlash = false;
}
function getPosition(Void) {
return(position.clone());
}
function step(chopperPos, chopperVel, aShots) {
if ((!bOnScreen) || (energy == 0)) {
return(undefined);
}
var _local4 = aShots.length;
var _local3 = 0;
while (_local3 < _local4) {
var _local2 = Shot(aShots[_local3]);
var _local7 = _local2.position.x - position.x;
var _local6 = _local2.position.y - (position.y - 2);
if (((_local7 * _local7) + (_local6 * _local6)) < 1600) {
Game.getInstance().removeAllyShot(_local2);
energy--;
bFlash = true;
Game.getInstance().createShrapnel(_local2.position);
if (energy == 0) {
Game.getInstance().saveHostileInd(index);
Game.getInstance().addPoints(position, 200);
Sounds.playSound("bazooka");
trace("destroyed");
}
break;
}
_local3++;
}
var _local7 = (chopperPos.x + (chopperVel.x * 10)) - position.x;
var _local6 = (chopperPos.y + (chopperVel.y * 10)) - position.y;
rotation = Math.atan2(_local6, _local7);
if (rotation > maxRot) {
rotation = maxRot;
} else if (rotation < minRot) {
rotation = minRot;
}
if ((shotDelay--) <= 0) {
shotDelay = 40 + Math.round(30 * Math.random());
var _local10 = new flash.geom.Point((position.x - 24) + (30 * Math.cos(rotation)), (position.y + 52) + (30 * Math.sin(rotation)));
var _local9 = rotation + ((Math.PI * Math.round(15 * (1 - (2 * Math.random())))) / 180);
var _local11 = new flash.geom.Point(VEL * Math.cos(_local9), VEL * Math.sin(_local9));
var _local8 = 20 + Math.round(15 * Math.random());
_local8 = (5 + Math.round(Math.sqrt((_local7 * _local7) + (_local6 * _local6)) / VEL)) + Math.round(15 * (1 - (2 * Math.random())));
Game.getInstance().createShot(false, _local10, _local11, _local8);
Sounds.playSound("gunfire");
}
}
function draw(leftEdge) {
var _local8 = (position.x - leftEdge) - (bmpBase.width / 2);
var _local7 = position.y + (bmpBase.height / 2);
screenPos = new flash.geom.Point(_local8, _local7);
if ((_local8 > ((-bmpBase.width) * 1)) && (_local8 < Game.screenW)) {
bOnScreen = true;
if (energy > 0) {
var _local2 = new flash.display.BitmapData(bmpBarrel.width, bmpBarrel.height, true, 0);
_local2.copyPixels(bmpBarrel, bmpBarrel.rectangle, new flash.geom.Point(0, 0), null, null, true);
var _local3 = new flash.geom.Matrix();
_local3.translate((-_local2.width) / 2, (-_local2.height) / 2);
var _local6 = new flash.geom.Matrix();
_local6.rotate(-rotation);
_local3.concat(_local6);
var _local5 = new flash.geom.Matrix();
_local5.translate(_local8 + 14, Game.screenH - (_local7 - 4));
_local3.concat(_local5);
var _local9 = (bFlash ? (new flash.geom.ColorTransform(0, 0, 0, 0, 255, 255, 255, 255)) : null);
bmpCanvas.draw(_local2, _local3, _local9, null, null, true);
var _local4 = bmpBase.clone();
if (bFlash) {
_local4.colorTransform(_local4.rectangle, new flash.geom.ColorTransform(0, 0, 0, 0, 255, 255, 255, 255));
}
bmpCanvas.copyPixels(_local4, _local4.rectangle, new flash.geom.Point(screenPos.x, Game.screenH - screenPos.y), null, null, true);
bFlash = false;
} else {
_local8 = position.x - leftEdge;
_local7 = position.y;
screenPos = new flash.geom.Point(_local8, _local7);
drawExplosion(screenPos, true);
}
} else {
bOnScreen = false;
}
}
function drawExplosion(pos, bRemove) {
var _local3 = _root.attachMovie("explosion2", "mcExp", _root.getNextHighestDepth());
_local3.gotoAndStop(frameExp + 1);
var _local4 = new flash.geom.Matrix();
_local4.translate(pos.x, Game.screenH - pos.y);
bmpCanvas.draw(_local3, _local4, null, null, null, true);
_local3.removeMovieClip();
frameExp++;
if (frameExp == 27) {
if (bRemove) {
onEndDeadAnim();
}
}
}
function onEndDeadAnim(Void) {
Game.getInstance().removeHostile(this);
}
var maxRot = 2.61799387799149;
var minRot = 0.523598775598299;
}
Symbol 431 MovieClip [__Packages.WorkObject] Frame 0
interface WorkObject
{
}
Symbol 432 MovieClip [__Packages.Shot] Frame 0
class Shot implements WorkObject
{
var bmpShot, bmpCanvas, position, velocity, acc, rotation, ct, colorInd, bChopper, screenPos;
function Shot (sLinkageId, pos, vel) {
bmpShot = flash.display.BitmapData.loadBitmap(sLinkageId);
bmpCanvas = Game.bmpShots;
position = pos.clone();
position.x = position.x - (bmpShot.width / 2);
position.y = position.y - (bmpShot.height / 2);
velocity = vel.clone();
var _local4 = vel.x * 0.05;
var _local3 = vel.y * 0.05;
acc = new flash.geom.Point(_local4, _local3);
rotation = Math.atan2(vel.y, vel.x);
var _local5 = Math.random();
ct = new flash.geom.ColorTransform(_local5, 1, 1, 1, 0, 0, 0, 0);
colorInd = Math.floor(180 * Math.random());
bChopper = true;
}
function step(Void) {
velocity.x = velocity.x + acc.x;
velocity.y = velocity.y + acc.y;
position.x = position.x + velocity.x;
position.y = position.y + velocity.y;
if (bChopper) {
if (checkCollision() || (position.y < 20)) {
Game.getInstance().removeAllyShot(this);
}
}
if ((((screenPos.y < 0) || (screenPos.y > Game.screenH)) || (screenPos.x < 0)) || (screenPos.x > Game.screenW)) {
Game.getInstance().removeAllyShot(this);
}
}
function draw(leftEdge) {
var _local6 = position.x - leftEdge;
var _local5 = position.y;
screenPos = new flash.geom.Point(_local6, _local5);
var _local2 = new flash.display.BitmapData(bmpShot.width, bmpShot.height, true, 0);
_local2.copyPixels(bmpShot, bmpShot.rectangle, new flash.geom.Point(0, 0), null, null, true);
var _local3 = new flash.geom.Matrix();
_local3.translate((-_local2.width) / 2, (-_local2.height) / 2);
var _local7 = new flash.geom.Matrix();
_local7.rotate(-rotation);
_local3.concat(_local7);
var _local4 = new flash.geom.Matrix();
_local4.translate(_local6, Game.screenH - _local5);
_local3.concat(_local4);
if (ct != null) {
colorInd = colorInd + 600;
var _local12 = 0.2 + ((0.8 * (Math.sin((Math.PI * colorInd) / 180) + 1)) / 2);
ct = new flash.geom.ColorTransform(1, _local12, 0, 1, 0, 0, 0, 100);
}
var _local9 = ct;
var _local8 = "normal";
var _local10 = null;
var _local11 = true;
bmpCanvas.draw(_local2, _local3, _local9, _local8, _local10, _local11);
}
function checkCollision(Void) {
var _local3 = screenPos.x;
var _local2 = Game.screenH - (screenPos.y - 10);
return(Game.bmpDead.hitTest(new flash.geom.Point(0, 0), 250, new flash.geom.Point(_local3, _local2)));
}
}
Symbol 433 MovieClip [__Packages.MissileLauncher] Frame 0
class MissileLauncher
{
var index, bmpBase, bmpHead, bmpExplode, bmpCanvas, position, VEL, energy, frameExp, shotDelay, bOnScreen, bFlash, rotation, screenPos;
function MissileLauncher (pos, type, indexNew) {
index = indexNew;
bmpBase = flash.display.BitmapData.loadBitmap("ml base");
bmpHead = flash.display.BitmapData.loadBitmap("ml head");
bmpExplode = flash.display.BitmapData.loadBitmap("explosion0");
bmpCanvas = Game.bmpDead;
position = pos.clone();
VEL = 10;
energy = 5;
frameExp = 0;
shotDelay = Math.round(10 * Math.random());
bOnScreen = false;
bFlash = false;
}
function getPosition(Void) {
return(position.clone());
}
function step(chopperPos, chopperVel, aShots) {
if ((!bOnScreen) && (energy > 0)) {
return(undefined);
}
var _local4 = aShots.length;
var _local3 = 0;
while (_local3 < _local4) {
var _local2 = Shot(aShots[_local3]);
var _local7 = _local2.position.x - position.x;
var _local6 = _local2.position.y - position.y;
if (((_local7 * _local7) + (_local6 * _local6)) < 400) {
Game.getInstance().removeAllyShot(_local2);
energy--;
bFlash = true;
Game.getInstance().createShrapnel(_local2.position);
if (energy == 0) {
Game.getInstance().saveHostileInd(index);
Game.getInstance().addPoints(position, 500);
Sounds.playSound("bazooka");
trace("destroyed");
}
break;
}
_local3++;
}
var _local7 = chopperPos.x - position.x;
var _local6 = chopperPos.y - position.y;
rotation = Math.atan2(_local6, _local7);
if (rotation > maxRot) {
rotation = maxRot;
} else if (rotation < minRot) {
rotation = minRot;
}
if ((shotDelay--) <= 0) {
shotDelay = 90 + Math.round(60 * Math.random());
var _local8 = new flash.geom.Point(position.x + (30 * Math.cos(rotation)), position.y + (30 * Math.sin(rotation)));
Game.getInstance().createMissile(false, _local8, null);
Sounds.playSound("missile_snd");
}
}
function draw(leftEdge) {
var _local8 = (position.x - leftEdge) - (bmpBase.width / 2);
var _local7 = position.y + (bmpBase.height / 2);
screenPos = new flash.geom.Point(_local8, _local7);
if ((_local8 > ((-bmpBase.width) * 1)) && (_local8 < (Game.screenW + (bmpBase.width * 0.5)))) {
bOnScreen = true;
if (energy > 0) {
var _local2 = new flash.display.BitmapData(bmpHead.width, bmpHead.height, true, 0);
_local2.copyPixels(bmpHead, bmpHead.rectangle, new flash.geom.Point(0, 0), null, null, true);
var _local3 = new flash.geom.Matrix();
_local3.translate((-_local2.width) / 2, (-_local2.height) / 2);
var _local6 = new flash.geom.Matrix();
_local6.rotate(-rotation);
_local3.concat(_local6);
var _local5 = new flash.geom.Matrix();
_local5.translate(_local8 + (bmpBase.width * 0.5), Game.screenH - ((_local7 - bmpBase.height) + 22));
_local3.concat(_local5);
var _local9 = (bFlash ? (new flash.geom.ColorTransform(0, 0, 0, 0, 255, 255, 255, 255)) : null);
bmpCanvas.draw(_local2, _local3, _local9, null, null, true);
var _local4 = bmpBase.clone();
if (bFlash) {
_local4.colorTransform(_local4.rectangle, new flash.geom.ColorTransform(0, 0, 0, 0, 255, 255, 255, 255));
}
bmpCanvas.copyPixels(_local4, _local4.rectangle, new flash.geom.Point(screenPos.x, Game.screenH - screenPos.y), null, null, true);
bFlash = false;
} else {
_local8 = position.x - leftEdge;
_local7 = position.y;
screenPos = new flash.geom.Point(_local8, _local7);
drawExplosion(screenPos, true);
}
} else {
bOnScreen = false;
}
}
function drawExplosion(pos, bRemove) {
var _local3 = _root.attachMovie("explosion2", "mcExp", _root.getNextHighestDepth());
_local3.gotoAndStop(frameExp + 1);
var _local4 = new flash.geom.Matrix();
_local4.translate(pos.x, Game.screenH - pos.y);
bmpCanvas.draw(_local3, _local4, null, null, null, true);
_local3.removeMovieClip();
frameExp++;
if (frameExp == 27) {
if (bRemove) {
onEndDeadAnim();
}
}
}
function onEndDeadAnim(Void) {
Game.getInstance().removeHostile(this);
}
var maxRot = 2.35619449019234;
var minRot = (Math.PI/4);
}
Symbol 434 MovieClip [__Packages.Obstacle] Frame 0
class Obstacle
{
var position, bOnScreen, bmpCanvas, bmpObstacle, width, screenPos;
function Obstacle (sLinkage, pos) {
position = pos.clone();
bOnScreen = false;
bmpCanvas = Game.bmpDead;
bmpObstacle = flash.display.BitmapData.loadBitmap(sLinkage);
width = bmpObstacle.width;
}
function draw(leftEdge) {
var _local2 = (position.x - leftEdge) - (width / 2);
var _local3 = position.y + bmpObstacle.height;
screenPos = new flash.geom.Point(_local2, _local3);
if ((_local2 > (-bmpObstacle.width)) && (_local2 < (Game.screenW + (bmpObstacle.width / 2)))) {
bOnScreen = true;
bmpCanvas.copyPixels(bmpObstacle, bmpObstacle.rectangle, new flash.geom.Point(screenPos.x, Game.screenH - screenPos.y), null, null, true);
}
}
}
Symbol 435 MovieClip [__Packages.Hostage] Frame 0
class Hostage
{
var mode, id, index, basePos, position, bmpCanvas, aBmp, aFrames, frame, bOnScreen, dir, modeTime, screenPos, endPos, bmpHostage;
function Hostage (basePosNew, idNew, indexNew) {
mode = 0;
id = idNew;
index = indexNew;
basePos = basePosNew.clone();
position = basePos.clone();
bmpCanvas = Game.bmpShots;
aBmp = new Array();
aBmp[0] = flash.display.BitmapData.loadBitmap("hostage walk " + id);
aBmp[1] = flash.display.BitmapData.loadBitmap("hostage jump " + id);
aBmp[2] = flash.display.BitmapData.loadBitmap("hostage hold " + id);
aBmp[3] = flash.display.BitmapData.loadBitmap("hostage walk " + id);
aFrames = new Array();
aFrames[0] = 10;
aFrames[1] = 10;
aFrames[2] = 1;
aFrames[3] = 10;
frame = Math.round(9 * Math.random());
}
function step(refRope) {
if (!bOnScreen) {
return(undefined);
}
if ((mode == 0) || (mode == 1)) {
var _local3 = refRope.endPos.x - position.x;
var _local4 = refRope.endPos.y - position.y;
if (((Math.abs(_local4) < 20) && (Math.abs(_local3) < 60)) && (!refRope.bHasCargo)) {
if (_local3 < 0) {
dir = -1;
} else {
dir = 1;
}
mode = 0;
position.x = position.x + (2 * dir);
if (Math.abs(_local3) < 10) {
mode = 2;
refRope.refCargo = this;
refRope.bHasCargo = true;
}
} else {
if (modeTime > 0) {
modeTime--;
} else {
modeTime = 30 + Math.round(30 * Math.random());
mode = Math.round(1 * Math.random());
if (mode == 0) {
dir = ((Math.random() < 0.5) ? -1 : 1);
}
}
if (mode == 0) {
position.x = position.x + (2 * dir);
screenPos.x = screenPos.x + (2 * dir);
if (position.x < (basePos.x - maxDist)) {
dir = 1;
} else if (position.x > (basePos.x + maxDist)) {
dir = -1;
}
}
if ((screenPos.x > (width / 2)) && (screenPos.x < (Game.screenW - (width / 2)))) {
while (checkCollision() == 0) {
screenPos.x = screenPos.x + 2;
position.x = position.x + 2;
dir = 1;
}
while (checkCollision() == 1) {
screenPos.x = screenPos.x - 2;
position.x = position.x - 2;
dir = -1;
}
}
}
} else if (mode == 2) {
position.x = refRope.endPos.x;
position.y = refRope.endPos.y;
if (refRope.length == 0) {
Game.getInstance().addPoints(position, 100);
Game.getInstance().chopper.increaseLoad(id, index);
Game.getInstance().removeHostage(this);
}
} else if (mode == 3) {
position.x = position.x + 1;
if (position.x >= endPos.x) {
Game.getInstance().unloadedHostages++;
Game.getInstance().checkIfCompleted();
Game.getInstance().removeHostage(this);
Game.getInstance().setOnBoardGauge();
}
}
frame++;
frame = frame % aFrames[mode];
}
function draw(leftEdge) {
bOnScreen = false;
var _local2 = (position.x - leftEdge) - (width / 2);
var _local4 = position.y + (height / 2);
screenPos = new flash.geom.Point(_local2, _local4);
if ((_local2 > ((-width) / 2)) && (_local2 < (Game.screenW + (width / 2)))) {
bOnScreen = true;
bmpHostage = new flash.display.BitmapData(width, height, true, 0);
var _local3 = frame;
if ((mode == 0) || (mode == 3)) {
_local3 = Math.floor(frame / 2);
if (dir == -1) {
_local3 = _local3 + 5;
}
}
var _local5 = new flash.geom.Rectangle(0, height * _local3, width, height);
bmpHostage.copyPixels(aBmp[mode], _local5, new flash.geom.Point(0, 0), null, null, true);
bmpCanvas.copyPixels(bmpHostage, bmpHostage.rectangle, new flash.geom.Point(_local2, Game.screenH - _local4), null, null, true);
}
}
function getOut(hqPos) {
mode = 3;
position.x = hqPos.x + 116;
position.y = hqPos.y - 122;
endPos = position.clone();
endPos.x = endPos.x + 44;
dir = 1;
Game.getInstance().saveHostageInd(index);
}
function checkCollision(Void) {
var _local2 = screenPos.x + (width / 2);
var _local3 = Game.screenH - position.y;
if (Game.bmpDead.hitTest(new flash.geom.Point(0, 0), 250, new flash.geom.Point(_local2, _local3))) {
return(0);
}
_local2 = screenPos.x + width;
if (Game.bmpDead.hitTest(new flash.geom.Point(0, 0), 250, new flash.geom.Point(_local2, _local3))) {
return(1);
}
return(null);
}
var sType = "hostage";
static var maxDist = 70;
static var width = 24;
static var height = 30;
var weightFactor = 1;
}
Symbol 436 MovieClip [__Packages.Vehicle] Frame 0
class Vehicle
{
var index, position, aDropZones, bmpCanvas, bmpVehicle, width, height, bDestroyed, mode, frameExp, bTaken, vel, screenPos, bOnScreen;
function Vehicle (posNew, id, aDropZonesNew, indexNew) {
index = indexNew;
position = posNew.clone();
aDropZones = aDropZonesNew;
bmpCanvas = Game.bmpShots;
bmpVehicle = flash.display.BitmapData.loadBitmap("vehicle " + id);
width = bmpVehicle.width;
height = bmpVehicle.height;
bDestroyed = false;
mode = 0;
frameExp = 0;
bTaken = false;
vel = new flash.geom.Point(0, 0);
}
function step(refRope) {
if (mode == 0) {
var _local6 = refRope.endPos.x - position.x;
var _local5 = refRope.endPos.y - position.y;
if (((Math.abs(_local5) < 10) && (Math.abs(_local6) < 10)) && (!refRope.bHasCargo)) {
mode = 1;
refRope.refCargo = this;
refRope.bHasCargo = true;
Game.getInstance().mcAlert.gotoAndPlay("show2");
}
} else if (mode == 1) {
position.x = refRope.endPos.x;
position.y = refRope.endPos.y;
if (checkPlatform()) {
Game.getInstance().saveVehicleInd(index);
Game.getInstance().checkIfCompleted();
mode = null;
refRope.refCargo = null;
refRope.bHasCargo = false;
} else {
var _local7 = checkCollision();
if ((_local7 || (position.y < 41)) && (bTaken)) {
die();
} else if ((!bTaken) && (position.y > 44)) {
bTaken = true;
}
}
} else if (mode == 2) {
vel.y = vel.y - 0.5;
vel.x = vel.x * 0.98;
vel.y = vel.y * 0.98;
position.x = position.x + vel.x;
position.y = position.y + vel.y;
var _local3 = 0;
while (_local3 < aDropZones.length) {
var _local2 = aDropZones[_local3];
if ((((position.x - (width / 2)) > _local2.plaPos.x) && ((position.x + (width / 2)) < (_local2.plaPos.x + _local2.plaWidth))) && ((position.y - _local2.plaPos.y) < ((height / 2) + 2))) {
position.y = _local2.plaPos.y + (height / 2);
if (Math.abs(vel.y) < 0.5) {
Game.getInstance().saveVehicleInd(index);
Game.getInstance().checkIfCompleted();
mode = null;
}
vel.x = 0;
vel.y = Math.abs(vel.y) * 0.7;
} else if (checkCollision() || (position.y < 40)) {
die();
}
_local3++;
}
}
}
function draw(leftEdge) {
var _local2 = (position.x - leftEdge) - (width / 2);
var _local5 = position.y + (height / 2);
screenPos = new flash.geom.Point(_local2, _local5);
if (!bDestroyed) {
if ((_local2 > (-width)) && (_local2 < (Game.screenW + width))) {
bOnScreen = true;
if (mode == 0) {
var _local3 = Math.sin(angle) + 1;
angle = angle + 0.6;
var _local6 = new flash.display.BitmapData(width + 10, height + 10, true, 0);
var _local9 = 16777215 /* 0xFFFFFF */;
var _local15 = 0.4 + (0.4 * _local3);
var _local12 = 3 + (4 * _local3);
var _local11 = 3 + (4 * _local3);
var _local13 = 4 + (4 * _local3);
var _local7 = 1;
var _local10 = false;
var _local14 = false;
var _local8 = new flash.filters.GlowFilter(_local9, _local15, _local12, _local11, _local13, _local7, _local10, _local14);
_local6.applyFilter(bmpVehicle, bmpVehicle.rectangle, new flash.geom.Point(5, 5), _local8);
var _local4 = new flash.geom.Matrix();
_local4.translate(screenPos.x + 5, (Game.screenH - screenPos.y) - 5);
bmpCanvas.draw(_local6, _local4, null, null, null, true);
} else {
bmpCanvas.copyPixels(bmpVehicle, bmpVehicle.rectangle, new flash.geom.Point(_local2, Game.screenH - _local5), null, null, true);
}
}
} else {
drawExplosion(new flash.geom.Point(position.x - leftEdge, position.y), true);
}
if ((mode == null) && ((_local2 < (-width)) || (_local2 > (Game.screenW + width)))) {
Game.getInstance().removeVehicle(this);
}
}
function die(Void) {
mode = null;
bDestroyed = true;
Sounds.playSound("bazooka");
}
function drawExplosion(pos, bRemove) {
var _local3 = _root.attachMovie("explosion2", "mcExp", _root.getNextHighestDepth());
_local3.gotoAndStop(frameExp + 1);
var _local4 = new flash.geom.Matrix();
_local4.translate(pos.x, Game.screenH - pos.y);
bmpCanvas.draw(_local3, _local4, null, null, null, true);
_local3.removeMovieClip();
frameExp++;
if (frameExp == 27) {
if (bRemove) {
onEndDeadAnim();
}
}
}
function onEndDeadAnim(Void) {
Game.getInstance().onLooseLife();
}
function checkCollision(Void) {
var _local3 = -screenPos.x;
var _local2 = -(Game.screenH - screenPos.y);
return(Game.bmpDead.hitTest(new flash.geom.Point(_local3, _local2), 250, bmpVehicle, new flash.geom.Point(0, 0), 250));
}
function checkPlatform(Void) {
var _local3 = 0;
while (_local3 < aDropZones.length) {
var _local2 = aDropZones[_local3];
if ((((position.x - (width / 2)) > _local2.plaPos.x) && ((position.x + (width / 2)) < (_local2.plaPos.x + _local2.plaWidth))) && ((position.y - _local2.plaPos.y) < ((height / 2) + 2))) {
position.y = _local2.plaPos.y + (height / 2);
return(true);
}
_local3++;
}
return(false);
}
var sType = "vehicle";
static var maxDist = 10;
var weightFactor = 3;
var angle = 0;
}
Symbol 437 MovieClip [__Packages.ShotHostile] Frame 0
class ShotHostile extends Shot
{
var flightTime, acc, ct, bChopper, velocity, position, screenPos;
function ShotHostile (sLinkageId, pos, vel, newFlightTime) {
super(sLinkageId, pos, vel);
flightTime = newFlightTime;
acc.x = 0;
acc.y = -0.15;
ct = null;
bChopper = false;
}
function step(Void) {
if ((flightTime--) > 0) {
velocity.x = velocity.x + acc.x;
velocity.y = velocity.y + acc.y;
position.x = position.x + velocity.x;
position.y = position.y + velocity.y;
if ((((screenPos.y < 50) || (screenPos.y > Game.screenH)) || (screenPos.x < -30)) || (screenPos.x > (Game.screenW + 30))) {
Game.getInstance().removeHostileShot(this);
}
} else {
Game.getInstance().createExplosion(position);
Game.getInstance().removeHostileShot(this);
}
}
}
Symbol 438 MovieClip [__Packages.AirExplosion] Frame 0
class AirExplosion
{
var position, bmpCanvas, bmpExplosion, scale, screenPos;
function AirExplosion (pos) {
position = pos.clone();
bmpCanvas = Game.bmpDead;
bmpExplosion = flash.display.BitmapData.loadBitmap("explosion3");
scale = 0;
Sounds.playSound("explsion");
}
function step(Void) {
scale = scale + ((0.75 - scale) * 0.15);
if (scale > 0.7) {
Game.getInstance().removeHostileShot(this);
}
}
function draw(leftEdge) {
var _local5 = position.x - leftEdge;
var _local7 = position.y;
screenPos = new flash.geom.Point(_local5, _local7);
var _local2 = new flash.geom.Matrix();
_local2.translate((-bmpExplosion.width) / 2, (-bmpExplosion.height) / 2);
var _local6 = new flash.geom.Matrix();
_local6.scale(scale, scale);
_local2.concat(_local6);
var _local13 = (bmpExplosion.width * scale) / 2;
var _local12 = (bmpExplosion.height * scale) / 2;
var _local4 = new flash.geom.Matrix();
_local4.translate(_local5, Game.screenH - position.y);
_local2.concat(_local4);
var _local3 = (1 - (scale / 0.7)) * 255;
var _local9 = new flash.geom.ColorTransform(0, 0, 0, 1 - scale, _local3, _local3, _local3, _local3);
var _local8 = "normal";
var _local10 = null;
var _local11 = true;
bmpCanvas.draw(bmpExplosion, _local2, _local9, _local8, _local10, _local11);
}
}
Symbol 439 MovieClip [__Packages.Missile] Frame 0
class Missile
{
var bAlly, bExp, bmpMissile, bmpCanvas, position, velMax, velLin, velocity, rotation, acc, screenPos, frameExp;
function Missile (sLinkageId, pos, refTarget, bAllyNew) {
bAlly = true;
bExp = false;
bmpMissile = flash.display.BitmapData.loadBitmap(sLinkageId);
if (bAlly) {
bmpCanvas = Game.bmpShots;
} else {
bmpCanvas = Game.bmpDead;
}
position = pos.clone();
velMax = 15;
velLin = 0;
velocity = new flash.geom.Point();
var _local2 = refTarget.getPosition();
var _local4 = _local2.x - position.x;
var _local3 = _local2.y - position.y;
rotation = Math.atan2(_local3, _local4);
acc = new flash.geom.Point();
draw();
}
function step(refTarget, bAlly) {
if (bExp) {
return(undefined);
}
var _local6 = refTarget.getPosition();
var _local4 = _local6.x - position.x;
var _local3 = _local6.y - position.y;
var _local2 = Math.atan2(_local3, _local4);
var _local5 = _local2 - rotation;
if ((_local2 / rotation) < 0) {
if ((_local2 > 0) && (_local5 > Math.PI)) {
_local2 = _local2 - (Math.PI*2);
} else if ((_local2 < 0) && (_local5 < -3.14159265358979)) {
_local2 = _local2 + (Math.PI*2);
}
}
rotation = rotation + ((_local2 - rotation) * 0.2);
var _local8 = velocity.length;
if (velLin < velMax) {
velLin = velLin + 0.15;
} else {
velLin = velMax;
}
velocity.x = velLin * Math.cos(rotation);
velocity.y = velLin * Math.sin(rotation);
position.x = position.x + velocity.x;
position.y = position.y + velocity.y;
if ((screenPos.x < -200) || (screenPos.x > (Game.screenW + 200))) {
if (bAlly) {
Game.getInstance().removeAllyMissile(this);
} else {
Game.getInstance().removeHostileMissile(this);
}
}
if (Math.sqrt((_local4 * _local4) + (_local3 * _local3)) < 30) {
refTarget.getDamage(100);
if (bAlly) {
Game.getInstance().removeAllyMissile(this);
} else {
Game.getInstance().removeHostileMissile(this);
}
}
if (Game.bmpDead.hitTest(new flash.geom.Point(0, 0), 250, new flash.geom.Point(screenPos.x, Game.screenH - screenPos.y))) {
bExp = true;
frameExp = 0;
}
}
function draw(leftEdge) {
var _local6 = position.x - leftEdge;
var _local5 = position.y;
screenPos = new flash.geom.Point(_local6, _local5);
if (bExp) {
drawExplosion(screenPos, true);
} else {
var _local2 = new flash.display.BitmapData(bmpMissile.width, bmpMissile.height, true, 0);
_local2.copyPixels(bmpMissile, bmpMissile.rectangle, new flash.geom.Point(0, 0), null, null, true);
var _local3 = new flash.geom.Matrix();
_local3.translate((-_local2.width) / 2, (-_local2.height) / 2);
var _local7 = new flash.geom.Matrix();
_local7.rotate(-rotation);
_local3.concat(_local7);
var _local4 = new flash.geom.Matrix();
_local4.translate(_local6, Game.screenH - _local5);
_local3.concat(_local4);
var _local9 = null;
var _local8 = "normal";
var _local10 = null;
var _local11 = true;
bmpCanvas.draw(_local2, _local3, _local9, _local8, _local10, _local11);
}
}
function drawExplosion(pos, bRemove) {
var _local4 = _root.attachMovie("explosion0", "mcExp", _root.getNextHighestDepth());
_local4.gotoAndStop(frameExp + 1);
var _local5 = new flash.geom.Matrix();
_local5.translate(pos.x, Game.screenH - pos.y);
var _local3 = new flash.geom.Matrix();
_local3.scale(0.5, 0.5);
_local3.concat(_local5);
bmpCanvas.draw(_local4, _local3, null, null, null, true);
_local4.removeMovieClip();
frameExp++;
if (frameExp == 25) {
if (bRemove) {
onEndDeadAnim();
}
}
}
function onEndDeadAnim(Void) {
if (bAlly) {
Game.getInstance().removeAllyMissile(this);
} else {
Game.getInstance().removeHostileMissile(this);
}
}
function findNearest(aObjects) {
var _local8 = aObjects.length;
var _local5 = Number.MAX_VALUE;
var _local7 = null;
var _local2 = 0;
while (_local2 < _local8) {
var _local3 = aObjects[_local2].getPosition();
_local3.subtract(position);
var _local4 = _local3.length;
if (_local4 < _local5) {
_local5 = _local4;
_local7 = aObjects[_local2];
}
_local2++;
}
return(_local7);
}
}
Symbol 440 MovieClip [__Packages.Chaf] Frame 0
class Chaf
{
var position, velocity, angle, frame, frameExp, bExplode, flightTime, bmpChaf, bmpExplode, bmpCanvas, screenPos;
function Chaf (pos, vel) {
position = pos.clone();
velocity = vel.clone();
angle = 0;
frame = 0;
frameExp = 0;
bExplode = false;
flightTime = 90;
bmpChaf = flash.display.BitmapData.loadBitmap("chaf");
bmpExplode = flash.display.BitmapData.loadBitmap("explosion0");
bmpCanvas = Game.bmpShots;
}
function getPosition(Void) {
return(position.clone());
}
function step(Void) {
if (!bExplode) {
angle = angle + (0.5 * Math.random());
velocity.y = velocity.y - 0.02;
velocity.x = velocity.x * 0.97;
velocity.y = velocity.y * 0.97;
position.x = position.x + velocity.x;
position.y = position.y + velocity.y;
frame++;
frame = frame % 4;
if (((flightTime--) <= 0) || (position.y < 0)) {
Game.getInstance().removeChaf(this);
}
}
}
function draw(leftEdge) {
var _local4 = (position.x - leftEdge) + (10 * Math.cos(angle));
var _local3 = position.y + (5 * Math.sin(angle));
screenPos = new flash.geom.Point(_local4, _local3);
if (!bExplode) {
var _local2 = new flash.display.BitmapData(12, 12, true, 0);
_local2.copyPixels(bmpChaf, new flash.geom.Rectangle(0, Math.floor(frame / 2) * 6, 6, 6), new flash.geom.Point(3, 3), null, null, true);
var _local5 = new flash.filters.BlurFilter(2, 2, 2);
_local2.applyFilter(_local2, _local2.rectangle, new flash.geom.Point(0, 0), _local5);
_local2.colorTransform(_local2.rectangle, new flash.geom.ColorTransform(1, 1, 1, (flightTime + 50) / 90, 0, 0, 0, 0));
bmpCanvas.copyPixels(_local2, _local2.rectangle, new flash.geom.Point(screenPos.x - 6, Game.screenH - (screenPos.y + 6)), null, null, true);
} else {
_local4 = (position.x - leftEdge) + (10 * Math.cos(angle));
_local3 = position.y + (5 * Math.sin(angle));
screenPos = new flash.geom.Point(_local4, _local3);
drawExplosion(screenPos, true);
}
}
function drawExplosion(pos, bRemove) {
var _local3 = _root.attachMovie("explosion1", "mcExp", _root.getNextHighestDepth());
_local3.gotoAndStop(frameExp + 1);
var _local4 = new flash.geom.Matrix();
_local4.translate(pos.x, Game.screenH - pos.y);
bmpCanvas.draw(_local3, _local4, null, null, null, true);
_local3.removeMovieClip();
frameExp++;
if (frameExp == 17) {
if (bRemove) {
onEndDeadAnim();
}
}
}
function onEndDeadAnim(Void) {
Game.getInstance().removeChaf(this);
}
function getDamage(damage) {
Sounds.playSound("explsion");
bExplode = true;
}
}
Symbol 441 MovieClip [__Packages.PointsCloud] Frame 0
class PointsCloud
{
var position, value, frame, bmpCanvas;
function PointsCloud (pos, valueNew) {
position = pos.clone();
value = valueNew;
frame = 0;
bmpCanvas = Game.bmpShots;
}
function step(Void) {
if ((frame++) == 35) {
Game.getInstance().removePoints(this);
}
}
function draw(leftEdge) {
var _local7 = position.x - leftEdge;
var _local6 = position.y;
var _local4 = _root.getNextHighestDepth();
var _local3 = _root.attachMovie("points anim", "mcPoints" + _local4, _local4);
_local3.mcPoints.tfFront.text = value;
_local3.mcPoints.tfOutline0.text = value;
_local3.mcPoints.tfOutline1.text = value;
_local3.mcPoints.tfOutline2.text = value;
_local3.mcPoints.tfOutline3.text = value;
_local3.gotoAndStop(frame);
var _local5 = new flash.geom.Matrix();
_local5.translate(_local7, Game.screenH - _local6);
bmpCanvas.draw(_local3, _local5, null, null, null, true);
_local3.removeMovieClip();
}
}
Symbol 442 MovieClip [__Packages.Particle] Frame 0
class Particle
{
var position, velocity, type, alpha, frame, flightTime, bmpCanvas, screenPos;
function Particle (pos) {
position = pos.clone();
var _local3 = 12 * (1 - (2 * Math.random()));
var _local2 = 7 + (9 * Math.random());
velocity = new flash.geom.Point(_local3, _local2);
type = Math.floor(4 * Math.random());
alpha = 100;
frame = 0;
flightTime = 5 + Math.round(25 * Math.random());
bmpCanvas = Game.bmpShots;
}
function getPosition(Void) {
return(position.clone());
}
function step(Void) {
velocity.y = velocity.y - 1.2;
velocity.x = velocity.x * 0.97;
position.x = position.x + velocity.x;
position.y = position.y + velocity.y;
frame++;
frame = frame % 4;
if (((flightTime--) <= 0) || (position.y < 0)) {
Game.getInstance().removeShrapnel(this);
} else if (flightTime < 10) {
alpha = 10 * flightTime;
}
}
function draw(leftEdge) {
var _local7 = position.x - leftEdge;
var _local6 = position.y;
screenPos = new flash.geom.Point(_local7, _local6);
var _local3 = _root.attachMovie("shrapnel", "mcShr", _root.getNextHighestDepth());
_local3.gotoAndStop(type);
var _local8 = (50 + ((50 * (30 - flightTime)) / 30)) / 100;
var _local4 = new flash.geom.Matrix();
_local4.scale(_local8, _local8);
var _local5 = new flash.geom.Matrix();
_local5.translate(_local7, Game.screenH - _local6);
_local4.concat(_local5);
var _local9 = new flash.geom.ColorTransform(1, 1, 1, alpha / 100, 0, 0, 0, 0);
bmpCanvas.draw(_local3, _local4, _local9, null, null, true);
_local3.removeMovieClip();
}
}
Symbol 443 MovieClip [__Packages.Scrollbar] Frame 0
class Scrollbar extends MovieClip
{
var scrollBarTrackTop, up, scrollBarTrackHeight, _height, lowestYPosForBar, _visible, onMouseUp, down, middle, bg, onEnterFrame, _y;
function Scrollbar () {
super();
}
function attachScrollBar(attachTo, bottomMargin) {
scrollBarTrackTop = (up._y + up._height) + 2;
scrollBarTrackHeight = _height - (scrollBarTrackTop * 2);
lowestYPosForBar = 0;
scrollBarTopOfWindow = attachTo._y;
var _local4 = _height;
if (attachTo._height > _local4) {
scrollerAttachedTo = attachTo;
if (attachTo.selectClass) {
attachTo.selectClass.attachedScrollBar = this;
} else {
attachTo.attachedScrollBar = this;
}
scrollBarWindowShowHeight = _local4;
_visible = true;
onMouseUp = stopScroll;
up.onPress = function () {
this._parent.startScrollUp();
};
down.onPress = function () {
this._parent.startScrollDown();
};
middle.onPress = function () {
this._parent.startScrollDrag();
};
bg.onPress = function () {
this._parent.scrollerBGPressed();
};
scrollBarWindowScrollHeight = attachTo._height + bottomMargin;
checkScrollingWindow();
var _local2 = scrollBarTrackHeight * (scrollBarWindowShowHeight / scrollBarWindowScrollHeight);
if (_local2 > scrollBarTrackHeight) {
_local2 = scrollBarTrackHeight;
}
if (_local2 < 10) {
_local2 = 10;
}
middle._height = _local2;
middle._y = scrollBarTrackTop;
lowestYPosForBar = scrollBarTrackHeight - middle._height;
moveScrollBarPosition();
} else {
removeScrollBar();
}
}
function removeScrollBar(Void) {
_visible = false;
if (scrollerAttachedTo) {
scrollerAttachedTo._y = scrollBarTopOfWindow;
}
scrollerAttachedTo = null;
onMouseUp = null;
up.onPress = null;
down.onPress = null;
middle.onPress = null;
bg.onPress = null;
}
function moveScroller(Void) {
if (scrollerDragging) {
var _local2 = getMouseYRelativeTo(this) - scrollerDragOffset;
if (_local2 < 0) {
_local2 = 0;
}
if (_local2 > lowestYPosForBar) {
_local2 = lowestYPosForBar;
}
scrollerAttachedTo._y = scrollBarTopOfWindow - ((_local2 / lowestYPosForBar) * (scrollBarWindowScrollHeight - scrollBarWindowShowHeight));
checkScrollingWindow();
moveScrollBarPosition();
} else if (scrollerMovingBar != 0) {
scrollerAttachedTo._y = scrollerAttachedTo._y + scrollerMovingBar;
checkScrollingWindow();
moveScrollBarPosition();
}
if ((!scrollerDragging) && (scrollerMovingBar != 0)) {
if (!scrollButtonPressed) {
scrollerMovingBar = scrollerMovingBar * 0.6;
if ((scrollerMovingBar > 0) && (scrollerMovingBar < 1)) {
scrollerMovingBar = 0;
onEnterFrame = null;
} else if ((scrollerMovingBar < 0) && (scrollerMovingBar > -1)) {
scrollerMovingBar = 0;
onEnterFrame = null;
}
} else {
scrollerMovingBar = scrollerMovingBar * 1.1;
}
}
}
function scrollerBGPressed(Void) {
var _local2 = getMouseYRelativeTo(this) - middle._y;
if (_local2 < 0) {
scrollerMovingBar = scrollerMovingBarJump;
}
if (_local2 > middle._height) {
scrollerMovingBar = -scrollerMovingBarJump;
}
scrollButtonPressed = true;
scrollerDragging = false;
onEnterFrame = moveScroller;
}
function jumpToPosition(jumpToPos) {
scrollerAttachedTo._y = _y + jumpToPos;
checkScrollingWindow();
moveScrollBarPosition();
}
function checkScrollingWindow(Void) {
if (scrollerAttachedTo._y < ((scrollBarWindowShowHeight + scrollBarTopOfWindow) - scrollBarWindowScrollHeight)) {
scrollerAttachedTo._y = (scrollBarWindowShowHeight + scrollBarTopOfWindow) - scrollBarWindowScrollHeight;
if (!scrollerDragging) {
stopScroll();
}
}
if (scrollerAttachedTo._y > scrollBarTopOfWindow) {
scrollerAttachedTo._y = scrollBarTopOfWindow;
if (!scrollerDragging) {
stopScroll();
}
}
}
function moveScrollBarPosition(Void) {
if (scrollerAttachedTo) {
middle._y = scrollBarTrackTop + ((Math.abs(scrollerAttachedTo._y - scrollBarTopOfWindow) / (scrollBarWindowScrollHeight - scrollBarWindowShowHeight)) * lowestYPosForBar);
}
}
function startScrollUp(Void) {
scrollerMovingBar = scrollerMovingBarMove;
scrollButtonPressed = true;
scrollerDragging = false;
onEnterFrame = moveScroller;
}
function startScrollDown(Void) {
scrollerMovingBar = -scrollerMovingBarMove;
scrollButtonPressed = true;
scrollerDragging = false;
onEnterFrame = moveScroller;
}
function startScrollDrag(Void) {
scrollerMovingBar = 0;
scrollerDragOffset = (getMouseYRelativeTo(this) - middle._y) + scrollBarTrackTop;
scrollerDragging = true;
scrollButtonPressed = false;
onEnterFrame = moveScroller;
}
function stopScroll(Void) {
scrollButtonPressed = false;
scrollerDragging = false;
}
function getMouseYRelativeTo(relativeTo) {
var _local2 = new Object();
_local2.x = 0;
_local2.y = _root._ymouse;
relativeTo.globalToLocal(_local2);
return(_local2.y);
}
var scrollButtonPressed = false;
var scrollerMovingBar = 0;
var scrollerMovingBarMove = 10;
var scrollerMovingBarJump = 90;
var scrollBarPercentage = 0;
var scrollerDragging = false;
var scrollerDragOffset = 0;
var scrollBarTopOfWindow = 0;
var scrollBarWindowShowHeight = 0;
var scrollBarWindowScrollHeight = 0;
var scrollerAttachedTo = null;
}
Symbol 444 MovieClip [__Packages.Loader] Frame 0
class Loader extends MovieClip
{
var total, onEnterFrame, loaded, mcBar;
function Loader (Void) {
super();
total = _root.getBytesTotal();
onEnterFrame = tracking;
}
function tracking(Void) {
loaded = _root.getBytesLoaded();
if (loaded == total) {
onEnterFrame = null;
_root.gotoAndStop("front");
}
var _local3 = 1 + Math.round((100 * loaded) / total);
mcBar.gotoAndStop(_local3);
}
}
Symbol 445 MovieClip [__Packages.GameOver] Frame 0
class GameOver extends MovieClip
{
var gotoAndStop, btnPlayAgain, btnTryAgain;
function GameOver () {
super();
}
function init(bSuccess) {
if (bSuccess) {
(gotoAndStop("success"));// not popped
btnPlayAgain.onRelease = mx.utils.Delegate.create(this, onReleasePlay);
} else {
(gotoAndStop("failed"));// not popped
btnTryAgain.onRelease = mx.utils.Delegate.create(this, onReleaseTry);
}
}
function onReleasePlay(Void) {
Application.goto("front");
}
function onReleaseTry(Void) {
Application.goto("front");
}
}
Symbol 446 MovieClip [__Packages.SendAFriend] Frame 0
class SendAFriend extends MovieClip
{
var onEnterFrame, sURL, tfFriendsName, tfFriendsEmail, tfYourName, tfYourEmail, btnSend, btnBack, oEnterLst, mcBlockade, mcYourEmail, mcYourName, mcFriendsEmail, mcFriendsName;
function SendAFriend () {
super();
onEnterFrame = init;
}
function init(Void) {
onEnterFrame = null;
sURL = Application.sBasePath + "TellAFriend.php";
tfFriendsName.tabIndex = 0;
tfFriendsEmail.tabIndex = 1;
tfYourName.tabIndex = 2;
tfYourEmail.tabIndex = 3;
tfFriendsEmail.restrict = "A-Za-z0-9_.@\\-";
tfYourEmail.restrict = "A-Za-z0-9_.@\\-";
btnSend.onRelease = mx.utils.Delegate.create(this, onReleaseSend);
btnBack.onRelease = mx.utils.Delegate.create(this, onReleaseBack);
oEnterLst = new Object();
oEnterLst.onKeyDown = mx.utils.Delegate.create(this, onPressKey);
Key.addListener(oEnterLst);
Selection.setFocus(tfFriendsName);
Key.removeListener(Interface.getInstance().oSpaceLst);
}
function onReleaseSend(Void) {
if (tfFriendsName.length > 0) {
if ((tfFriendsEmail.length > 0) && (checkEmail(tfFriendsEmail.text))) {
if (tfYourName.length > 0) {
if ((tfYourEmail.length > 0) && (checkEmail(tfYourEmail.text))) {
mcBlockade.gotoAndStop("show");
var _local2 = new LoadVars();
_local2.SENDERNAME = tfYourName.text;
_local2.SENDEREMAIL = tfYourEmail.text;
_local2.RECEIPIENTNAME = tfFriendsName.text;
_local2.RECEIPIENTEMAIL = tfFriendsEmail.text;
_local2.MESSAGE = "";
_local2.onLoad = mx.utils.Delegate.create(this, onLoadEmail);
_local2.sendAndLoad(sURL, _local2, "POST");
Key.removeListener(oEnterLst);
} else {
mcYourEmail.gotoAndPlay("error");
Selection.setFocus(tfYourEmail);
Selection.setSelection(0, tfYourEmail.length);
}
} else {
mcYourName.gotoAndPlay("error");
Selection.setFocus(tfYourName);
}
} else {
mcFriendsEmail.gotoAndPlay("error");
Selection.setFocus(tfFriendsEmail);
Selection.setSelection(0, tfFriendsEmail.length);
}
} else {
mcFriendsName.gotoAndPlay("error");
Selection.setFocus(tfFriendsName);
}
}
function onLoadEmail(bSuccess) {
if (bSuccess) {
mcBlockade.gotoAndPlay("sent");
} else {
mcBlockade.gotoAndPlay("error");
}
Key.addListener(oEnterLst);
}
function onPressKey(Void) {
if (Key.isDown(13)) {
onReleaseSend();
}
}
function checkEmail(sEmail) {
var _local4 = sEmail.lastIndexOf(".");
var _local2 = sEmail.indexOf("@");
var _local3 = sEmail.indexOf(" ");
var _local5 = sEmail.lastIndexOf("..");
if ((((_local3 < 0) && (_local2 > 0)) && ((_local2 + 1) < _local4)) && (_local5 == -1)) {
return(true);
}
return(false);
}
function onReleaseBack(Void) {
Interface.getInstance().onReleaseSendBack();
}
}
Symbol 447 MovieClip [__Packages.Interface] Frame 0
class Interface extends MovieClip
{
static var instance;
var btnPlay, mcControl, btnInstructions, btnSend, btnHighScore, oSpaceLst, gotoAndPlay, mcInstructionsPanel;
function Interface (Void) {
super();
instance = this;
btnPlay = mcControl.btnPlay;
btnInstructions = mcControl.btnInstructions;
btnSend = mcControl.btnSend;
btnHighScore = mcControl.btnHighScore;
btnPlay.onRelease = mx.utils.Delegate.create(this, onReleasePlay);
btnInstructions.onRelease = mx.utils.Delegate.create(this, onReleaseInstructions);
btnSend.onRelease = mx.utils.Delegate.create(this, onReleaseSend);
btnHighScore.onRelease = mx.utils.Delegate.create(this, onReleaseHighScore);
oSpaceLst = new Object();
oSpaceLst.onKeyDown = mx.utils.Delegate.create(this, onPressSpace);
Key.addListener(oSpaceLst);
}
static function getInstance(Void) {
return(instance);
}
function onReleasePlay(Void) {
Key.removeListener(oSpaceLst);
_root.gotoAndPlay("gameIn");
}
function onReleaseInstructions(Void) {
Key.removeListener(oSpaceLst);
(gotoAndPlay("instructionsIn"));// not popped
mcInstructionsPanel.btnBack.onRelease = mx.utils.Delegate.create(this, onReleaseInstrBack);
}
function onReleaseSend(Void) {
Key.removeListener(oSpaceLst);
(gotoAndPlay("sendIn"));// not popped
}
function onReleaseHighScore(Void) {
Key.removeListener(oSpaceLst);
(gotoAndPlay("highIn"));// not popped
}
function onReleaseInstrBack(Void) {
Key.addListener(oSpaceLst);
gotoAndPlay("instructionsOut");
}
function onReleaseSendBack(Void) {
Key.addListener(oSpaceLst);
(gotoAndPlay("sendOut"));// not popped
}
function onReleaseScoreBack(Void) {
Key.addListener(oSpaceLst);
(gotoAndPlay("highOut"));// not popped
}
function onPressSpace(Void) {
if (Key.isDown(32)) {
onReleasePlay();
}
}
}
Symbol 448 MovieClip [__Packages.Leaderboard] Frame 0
class Leaderboard extends MovieClip
{
var onEnterFrame, sURL, btnBack, _parent, lvScores, gotoAndStop, mcCnt, mcScrollBar;
function Leaderboard () {
super();
onEnterFrame = init;
}
function init(Void) {
onEnterFrame = null;
sURL = Application.sBasePath + "GetScores.php";
loadHighScore();
btnBack = _parent.btnBack;
btnBack.onRelease = mx.utils.Delegate.create(this, onReleaseBack);
trace("btnBack: " + btnBack);
}
function loadHighScore(Void) {
lvScores = new LoadVars();
lvScores.onLoad = mx.utils.Delegate.create(this, onLoadList);
lvScores.load(sURL);
}
function onLoadList(bSuccess) {
for (var _local4 in lvScores) {
trace((("key: " + _local4) + ", value: ") + lvScores[_local4]);
}
(gotoAndStop("done"));// not popped
if (bSuccess) {
var _local2 = 1;
while (_local2 < 21) {
if (lvScores["name" + _local2] != undefined) {
var _local3 = mcCnt.attachMovie("scoreRow", "row" + _local2, _local2);
_local3.rank = _local2 + ".";
_local3.sName = lvScores["name" + _local2];
_local3.score = lvScores["score" + _local2];
_local3._y = 15 * (_local2 - 1);
}
_local2++;
}
}
mcScrollBar.attachScrollBar(mcCnt, 1);
}
function onReleaseBack(Void) {
trace("asd");
Interface.getInstance().onReleaseScoreBack();
}
}
Symbol 207 MovieClip Frame 10
stop();
Symbol 209 MovieClip Frame 10
stop();
Symbol 235 Button
on (release) {
getURL ("http://ad.uk.doubleclick.net/clk;24784572;12355883;r?http://www.rafcareers.com/main", "_blank");
}
Symbol 250 MovieClip [highscore screen] Frame 1
#initclip 35
Object.registerClass("highscore screen", Leaderboard);
#endinitclip
stop();
Symbol 263 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 6
btnBlockade.useHandCursor = false;
Symbol 292 MovieClip Frame 30
gotoAndStop ("hide");
Symbol 292 MovieClip Frame 50
gotoAndStop ("hide");
Symbol 293 MovieClip [send a friend pane] Frame 1
#initclip 33
Object.registerClass("send a friend pane", SendAFriend);
#endinitclip
Symbol 326 MovieClip [panel main] Frame 1
#initclip 34
Object.registerClass("panel main", Interface);
#endinitclip
stop();
Symbol 326 MovieClip [panel main] Frame 42
stop();
Symbol 326 MovieClip [panel main] Frame 58
gotoAndStop ("home");
Symbol 326 MovieClip [panel main] Frame 88
stop();
Symbol 326 MovieClip [panel main] Frame 107
gotoAndStop ("home");
Symbol 326 MovieClip [panel main] Frame 137
stop();
Symbol 326 MovieClip [panel main] Frame 153
gotoAndStop ("home");
Symbol 333 MovieClip Frame 1
stop();
Symbol 371 MovieClip Frame 10
stop();
Symbol 373 MovieClip Frame 10
stop();
Symbol 406 MovieClip Frame 1
stop();
Symbol 411 MovieClip [panel game] Frame 1
#initclip 37
Object.registerClass("panel game", Summary);
#endinitclip
stop();
Symbol 411 MovieClip [panel game] Frame 30
stop();
startGame();
Symbol 411 MovieClip [panel game] Frame 56
stop();
Symbol 411 MovieClip [panel game] Frame 82
stop();
startGame();
Symbol 419 MovieClip Frame 1
stop();
Symbol 419 MovieClip Frame 40
gotoAndStop (1);
Symbol 419 MovieClip Frame 85
gotoAndStop (1);
Symbol 420 MovieClip [GAME] Frame 1
#initclip 36
Object.registerClass("GAME", Game);
#endinitclip