Section 1
//adsafe_214 (Game_fla.adsafe_214)
package Game_fla {
import flash.display.*;
public dynamic class adsafe_214 extends MovieClip {
public function adsafe_214(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 2
//ajfgh_223 (Game_fla.ajfgh_223)
package Game_fla {
import flash.display.*;
public dynamic class ajfgh_223 extends MovieClip {
public var characterMc:MovieClip;
public function ajfgh_223(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 3
//amanMC_210 (Game_fla.amanMC_210)
package Game_fla {
import flash.display.*;
public dynamic class amanMC_210 extends MovieClip {
public var customerMc:MovieClip;
public function amanMC_210(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 4
//amanMc1_213 (Game_fla.amanMc1_213)
package Game_fla {
import flash.display.*;
public dynamic class amanMc1_213 extends MovieClip {
public var customerMc:MovieClip;
public function amanMc1_213(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 5
//amsd_217 (Game_fla.amsd_217)
package Game_fla {
import flash.display.*;
public dynamic class amsd_217 extends MovieClip {
public var customerMc:MovieClip;
public function amsd_217(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 6
//anothercar_141 (Game_fla.anothercar_141)
package Game_fla {
import flash.display.*;
public dynamic class anothercar_141 extends MovieClip {
public var front:MovieClip;
public var left_clip:MovieClip;
public var right_clip:MovieClip;
public var mc:MovieClip;
public var back:MovieClip;
}
}//package Game_fla
Section 7
//area_222 (Game_fla.area_222)
package Game_fla {
import flash.display.*;
public dynamic class area_222 extends MovieClip {
public var characterMc:MovieClip;
public function area_222(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 8
//asecind_218 (Game_fla.asecind_218)
package Game_fla {
import flash.display.*;
public dynamic class asecind_218 extends MovieClip {
public function asecind_218(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 9
//aSymbol13_211 (Game_fla.aSymbol13_211)
package Game_fla {
import flash.display.*;
public dynamic class aSymbol13_211 extends MovieClip {
public function aSymbol13_211(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 10
//ateste_224 (Game_fla.ateste_224)
package Game_fla {
import flash.display.*;
public dynamic class ateste_224 extends MovieClip {
public var characterMc:MovieClip;
public function ateste_224(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 11
//backturnw_192 (Game_fla.backturnw_192)
package Game_fla {
import flash.display.*;
public dynamic class backturnw_192 extends MovieClip {
public function backturnw_192(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 12
//cap_203 (Game_fla.cap_203)
package Game_fla {
import flash.display.*;
public dynamic class cap_203 extends MovieClip {
public function cap_203(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 13
//cap1_206 (Game_fla.cap1_206)
package Game_fla {
import flash.display.*;
public dynamic class cap1_206 extends MovieClip {
public function cap1_206(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 14
//carforSymbol49_99 (Game_fla.carforSymbol49_99)
package Game_fla {
import flash.display.*;
public dynamic class carforSymbol49_99 extends MovieClip {
public var fnt:MovieClip;
public function carforSymbol49_99(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 15
//dcarforSymbol49_88 (Game_fla.dcarforSymbol49_88)
package Game_fla {
import flash.display.*;
public dynamic class dcarforSymbol49_88 extends MovieClip {
public var bck:MovieClip;
public var fnt:MovieClip;
public function dcarforSymbol49_88(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 16
//dsynthetic_92 (Game_fla.dsynthetic_92)
package Game_fla {
import flash.display.*;
public dynamic class dsynthetic_92 extends MovieClip {
public function dsynthetic_92(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 17
//dummycar7_109 (Game_fla.dummycar7_109)
package Game_fla {
import flash.display.*;
public dynamic class dummycar7_109 extends MovieClip {
public function dummycar7_109(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 18
//Engineresce_152 (Game_fla.Engineresce_152)
package Game_fla {
import flash.display.*;
public dynamic class Engineresce_152 extends MovieClip {
public function Engineresce_152(){
addFrameScript(0, frame1, 99, frame100);
}
function frame1(){
stop();
}
function frame100(){
stop();
}
}
}//package Game_fla
Section 19
//FuelAnimation_151 (Game_fla.FuelAnimation_151)
package Game_fla {
import flash.display.*;
public dynamic class FuelAnimation_151 extends MovieClip {
public function FuelAnimation_151(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 20
//FuelCluip_150 (Game_fla.FuelCluip_150)
package Game_fla {
import flash.display.*;
public dynamic class FuelCluip_150 extends MovieClip {
public var fuel:MovieClip;
}
}//package Game_fla
Section 21
//FULL_156 (Game_fla.FULL_156)
package Game_fla {
import flash.display.*;
public dynamic class FULL_156 extends MovieClip {
public function FULL_156(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 22
//horic_189 (Game_fla.horic_189)
package Game_fla {
import flash.display.*;
public dynamic class horic_189 extends MovieClip {
public function horic_189(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 23
//li6intro_1 (Game_fla.li6intro_1)
package Game_fla {
import flash.display.*;
public dynamic class li6intro_1 extends MovieClip {
public var gauge:MovieClip;
}
}//package Game_fla
Section 24
//li6LOADER_2 (Game_fla.li6LOADER_2)
package Game_fla {
import flash.display.*;
public dynamic class li6LOADER_2 extends MovieClip {
public var bar:MovieClip;
public function li6LOADER_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 25
//MainTimeline (Game_fla.MainTimeline)
package Game_fla {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var linkBtn:SimpleButton;
public var enginecount:Number;
public var randomTime2:Array;
public var leftKeyPressed:Boolean;
public var playMoreGame:SimpleButton;
public var enginelife:MovieClip;
public var posArray:Array;
public var prizereducedcount_time:Number;
public var currentTarget:String;
public var i:Number;
public var s:Number;
public var turn:Boolean;
public var freeGame:SimpleButton;
public var acceleration:Number;
public var earnedMoney:TextField;
public var dummy3:MovieClip;
public var playAgain:SimpleButton;
public var loaderId:Number;
public var dummy7:MovieClip;
public var dummy8:MovieClip;
public var dummy2:MovieClip;
public var dummy4:MovieClip;
public var dummy6:MovieClip;
public var dummy9:MovieClip;
public var customermove_1:Boolean;
public var customermove_3:Boolean;
public var customermove_5:Boolean;
public var customermove_6:Boolean;
public var customermove_7:Boolean;
public var customermove_8:Boolean;
public var customermove_4:Boolean;
public var policeCarAnimVar:Boolean;
public var customermove_9:Boolean;
public var customermove_2:Boolean;
public var rightDisabled:Boolean;
public var engineClip:MovieClip;
public var dummy5:MovieClip;
public var intervalId:int;
public var dummy1:MovieClip;
public var dummy10:MovieClip;
public var dummy11:MovieClip;
public var dummy12:MovieClip;
public var dummy13:MovieClip;
public var angle:Number;
public var totalamount:Number;
public var fueltwo:Number;
public var hitCollision:Boolean;
public var enginetxt:TextField;
public var pDirection:Boolean;
public var speedX:Number;
public var speedY:Number;
public var customerpick:String;
public var dummyPolice1:MovieClip;
public var dummyPolice3:MovieClip;
public var dummyPolice4:MovieClip;
public var dummyPolice5:MovieClip;
public var dummyPolice6:MovieClip;
public var dummyPolice7:MovieClip;
public var hitapear:Boolean;
public var cornerhit:Boolean;
public var prizereducedcount:Number;
public var policecarhitter:Boolean;
public var oppPos:Array;
public var currentTargetX:Number;
public var currentTargetY:Number;
public var dummyPolice8:MovieClip;
public var bgClip:MovieClip;
public var dummyPolice2:MovieClip;
public var txtBox:TextField;
public var carMaxSpeed:Number;
public var initTgtX:Number;
public var initTgtY:Number;
public var scoreSubmit:SimpleButton;
public var activeCus:Number;
public var reachedtarget:Boolean;
public var fuelFull:MovieClip;
public var policeclip:MovieClip;
public var wait:Number;
public var decr_clip:MovieClip;
public var foundCustomer:Boolean;
public var congrats:MovieClip;
public var point:Point;
public var customerId:Boolean;
public var ydist:Number;
public var placearray:Array;
public var holder:Number;
public var fuel:Number;
public var targetXArray;
public var frtCar_Vertbar_hit_plus_1:Boolean;
public var frtCar_Vertbar_hit_plus_2:Boolean;
public var upKeyPressed:Boolean;
public var frtCar_Vertbar_hit_plus_0:Boolean;
public var policecarhit:Boolean;
public var backPos2:Boolean;
public var backPos3:Boolean;
public var backPos4:Boolean;
public var backPos5:Boolean;
public var backPos6:Boolean;
public var backPos7:Boolean;
public var place_clips:MovieClip;
public var enginedamagelevel:Number;
public var backPos8:Boolean;
public var backPos1:Boolean;
public var customerPicked:Boolean;
public var timerArray:Array;
public var modeId:Boolean;
public var mute:SimpleButton;
public var xdist:Number;
public var fuelClip:MovieClip;
public var enterclip:MovieClip;
public var characterId:Boolean;
public var randomTime:Array;
public var currentprize:Number;
public var Radians:Number;
public var currentSpeed:Number;
public var targetYArray;
public var policehitamount:Number;
public var txt:TextField;
public var intro:MovieClip;
public var customerArray2:Array;
public var price_txt:TextField;
public var customerArray3:Array;
public var customerpicking:Boolean;
public var customerArray1:Array;
public var spaceKeypressed:Boolean;
public var prizereduction:Boolean;
public var playBtn1:SimpleButton;
public var sndStatus:Number;
public var currentTargetNum:Number;
public var soundBtn:MovieClip;
public var frtCar_Vertbar_hit_plus_180:Boolean;
public var currentIndex:int;
public var spacebarKeyCode:Boolean;
public var priceamount:Number;
public var bgSnd:bgsound;
public var farearray:Array;
public var activeArray:Array;
public var distance1:Number;
public var arrowClip:MovieClip;
public var downKeyPressed:Boolean;
public var verticalPos:Array;
public var Degrees:Number;
public var fixCustomer:Number;
public var oldplacearray:Array;
public var fuelmoneyclip:MovieClip;
public var carHorizantal_1:Boolean;
public var carHorizantal_2:Boolean;
public var carHorizantal_4:Boolean;
public var timerId:Number;
public var carHorizantal_3:Boolean;
public var place_name_clip:MovieClip;
public var turn1:Boolean;
public var turn2:Boolean;
public var Direction:Boolean;
public var totalopponentCars:Number;
public var rotationSpeed:Number;
public var increment:Number;
public var sndChannel:SoundChannel;
public var pricedelaycount:Number;
public var startGame:Boolean;
public var fuellevel:Number;
public var globalCarTurnSpeed:Number;
public var activeArray1:Array;
public var activeArray3:Array;
public var leftDisabled:Boolean;
public var totalmoney_txt:TextField;
public var customermove_10:Boolean;
public var customermove_11:Boolean;
public var customermove_12:Boolean;
public var customermove_13:Boolean;
public var customermove_14:Boolean;
public var customermove_15:Boolean;
public var customermove_16:Boolean;
public var customermove_17:Boolean;
public var customermove_18:Boolean;
public var timerMc:MovieClip;
public var totalPoliceCars:Number;
public var car:MovieClip;
public var introClip:MovieClip;
public var vcharacterId:Boolean;
public var newintdexarray:Array;
public var distance:Number;
public var customerPickup:Boolean;
public var rightKeyPressed:Boolean;
public function MainTimeline(){
addFrameScript(0, frame1, 4, frame5, 9, frame10, 13, frame14, 20, frame21, 24, frame25);
}
public function handlePrice(){
intervalId = setInterval(pricereducedfunc, 3000);
}
public function preloadFinish(){
if (wait > 0){
txtBox.text = ("wait:" + wait);
} else {
clearInterval(loaderId);
this.gotoAndStop("start");
};
wait--;
}
public function timerFun(){
if (timerArray[1] >= 1){
var _local1 = timerArray;
var _local2 = 1;
var _local3 = (_local1[_local2] - 1);
_local1[_local2] = _local3;
timerMc.timeText.text = String(timerArray[1]);
} else {
fuellevel = 0;
clearInterval(intervalId);
clearInterval(timerId);
stage.removeEventListener(Event.ENTER_FRAME, Main);
setTimeout(gameOverFun, 2000);
};
}
public function playMoreFun(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.i6.com/free-games/835/cars?utm_source=games&utm_medium=taxipmg"), "_blank");
}
public function freeGameFun(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.i6.com/freegamesforyoursite.html?utm_source=games&utm_medium=taxifgfys"), "_blank");
}
public function pressed(_arg1:MouseEvent):void{
this.gotoAndStop("playarea");
}
public function secCus(){
var _local1:uint;
var _local2:uint;
var _local3:char;
var _local4:Number;
_local1 = 1;
while (_local1 <= 9) {
_local2 = 1;
while (_local2 <= 3) {
_local3 = new char();
_local4 = Math.round((Math.random() * 4));
_local3.gotoAndStop((_local4 + 1));
_local3.x = (bgClip[("hRef" + _local1)].x - posArray[_local2]);
_local3.y = bgClip[("hRef" + _local1)].y;
_local3.endX = bgClip[("hEnd" + _local1)].x;
_local3.endY = bgClip[("hEnd" + _local1)].y;
_local3.startX = bgClip[("hRef" + _local1)].x;
_local3.startY = bgClip[("hRef" + _local1)].y;
_local3.endPntx = bgClip[("hEnd" + _local1)].x;
_local3.endPnty = bgClip[("hEnd" + _local1)].y;
_local3.cid = 0;
bgClip.addChild(_local3);
customerArray2.push(_local3);
_local3.speed1 = 5;
_local3.addEventListener(Event.ENTER_FRAME, secondCustomer);
_local2++;
};
_local1++;
};
}
public function customerDelay(){
var _local1:uint;
var _local2:uint;
var _local3:customer;
var _local4:Number;
_local1 = 1;
while (_local1 <= 8) {
_local2 = 1;
while (_local2 <= 4) {
_local3 = new customer();
bgClip.addChild(_local3);
_local4 = Math.floor((Math.random() * 4));
_local3.gotoAndStop((_local4 + 1));
_local3.x = (bgClip[("customerPnt" + _local1)].x + posArray[_local2]);
_local3.y = bgClip[("customerPnt" + _local1)].y;
_local3.endX = bgClip[("customerEnd" + _local1)].x;
_local3.endY = bgClip[("customerEnd" + _local1)].y;
_local3.startPntx = bgClip[("customerPnt" + _local1)].x;
_local3.startPnty = bgClip[("customerPnt" + _local1)].y;
_local3.endingX = bgClip[("customerEnd" + _local1)].x;
_local3.endingY = bgClip[("customerEnd" + _local1)].y;
_local3.Rootid = 0;
customerArray1.push(_local3);
_local3.speed = 5;
_local3.addEventListener(Event.ENTER_FRAME, customersMove);
_local2++;
};
_local1++;
};
}
public function playFreeGameFun(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.i6.com/freegamesforyoursite.html?utm_source=games&utm_medium=taxifgfys"), "_blank");
}
function frame14(){
stop();
totalopponentCars = 6;
totalPoliceCars = 4;
initTgtX = bgClip.targetclip_2.x;
initTgtY = bgClip.targetclip_2.y;
policeCarAnimVar = false;
customerPickup = false;
customerPicked = false;
fixCustomer = 0;
startGame = false;
placearray = new Array("Big Ben", "Burkingham Palace", "Millenium Dome", "London Bridge", "London Eye", "London Museum", "St Paul Cathedral", "The Bank of England");
oldplacearray = new Array("Big Ben", "Burkingham Palace", "Millenium Dome", "London Bridge", "London Eye", "London Museum", "St Paul Cathedral", "The Bank of England");
newintdexarray = oldplacearray;
farearray = new Array("350", "550", "750", "680", "890", "770", "1500", "950", "900", "800");
targetXArray = new Array(bgClip.bigben.x, bgClip.burking.x, bgClip.millinium.x, bgClip.bridge.x, bgClip.londoneye.x, bgClip.londonmusium.x, bgClip.stpaul.x, bgClip.bankengland.x);
targetYArray = new Array(bgClip.bigben.y, bgClip.burking.y, bgClip.millinium.y, bgClip.bridge.y, bgClip.londoneye.y, bgClip.londonmusium.y, bgClip.stpaul.y, bgClip.bankengland.y);
fueltwo = 1000;
place_name_clip.visible = false;
currentTargetNum = 0;
currentTarget = "";
randomize(placearray);
spaceKeypressed = false;
spacebarKeyCode = false;
fuel = 10000;
priceamount = 0;
enginecount = 100;
hitapear = false;
price_txt.text = String(priceamount);
txt.text = (Math.round(((fueltwo / 100) * 10)) + " %");
enginetxt.text = (100 + "%");
fuelClip.fuel.gotoAndStop(Math.round(((fueltwo / 100) * 10)));
policecarhit = false;
foundCustomer = false;
customerpicking = false;
arrowClip.visible = false;
prizereduction = false;
totalmoney_txt.text = "0";
prizereducedcount = 0;
prizereducedcount_time = 20;
customerpick = " ";
customermove_1 = false;
customermove_2 = false;
customermove_3 = false;
customermove_4 = false;
customermove_5 = false;
customermove_6 = false;
customermove_7 = false;
customermove_8 = false;
customermove_9 = false;
customermove_10 = false;
customermove_11 = false;
customermove_12 = false;
customermove_13 = false;
customermove_14 = false;
customermove_15 = false;
customermove_16 = false;
customermove_17 = false;
customermove_18 = false;
policehitamount = 0;
pricedelaycount = 500;
reachedtarget = false;
policecarhitter = false;
cornerhit = false;
bgClip.id = 1;
dummy1 = new MovieClip();
dummy2 = new MovieClip();
dummy3 = new MovieClip();
dummy4 = new MovieClip();
dummy5 = new MovieClip();
dummy6 = new MovieClip();
dummy7 = new MovieClip();
dummy8 = new MovieClip();
dummy9 = new MovieClip();
dummy10 = new MovieClip();
dummy11 = new MovieClip();
dummy12 = new MovieClip();
dummy13 = new MovieClip();
Direction = true;
hitCollision = false;
dummyPolice1 = new MovieClip();
dummyPolice2 = new MovieClip();
dummyPolice3 = new MovieClip();
dummyPolice4 = new MovieClip();
dummyPolice5 = new MovieClip();
dummyPolice6 = new MovieClip();
dummyPolice7 = new MovieClip();
dummyPolice8 = new MovieClip();
globalCarTurnSpeed = 2;
rightDisabled = false;
leftDisabled = false;
frtCar_Vertbar_hit_plus_0 = false;
frtCar_Vertbar_hit_plus_180 = false;
frtCar_Vertbar_hit_plus_1 = false;
frtCar_Vertbar_hit_plus_2 = false;
carHorizantal_1 = false;
carHorizantal_2 = false;
carHorizantal_3 = false;
carHorizantal_4 = false;
carMaxSpeed = 6;
speedX = 0;
speedY = 0;
rotationSpeed = 7;
acceleration = 0.3;
currentSpeed = 0;
backPos1 = false;
backPos2 = false;
backPos3 = false;
backPos4 = false;
backPos5 = false;
backPos6 = false;
backPos7 = false;
backPos8 = false;
timerId = 0;
stage.addEventListener(KeyboardEvent.KEY_UP, KeyUP);
stage.addEventListener(KeyboardEvent.KEY_DOWN, KeyDown);
dummyPolice1 = bgClip.pc2;
dummyPolice2 = bgClip.pj2;
dummyPolice3 = bgClip.h2;
dummyPolice4 = bgClip.pi2;
dummyPolice6 = bgClip.ps2;
dummyPolice5 = bgClip.pk2;
dummyPolice7 = bgClip.pt2;
dummyPolice8 = bgClip.pu2;
policeProperties();
pDirection = false;
stage.addEventListener(Event.ENTER_FRAME, Main);
totalamount = 0;
initial();
increment = 0;
dummy1 = bgClip.p2;
dummy2 = bgClip.q2;
dummy3 = bgClip.r2;
dummy4 = bgClip.s2;
dummy5 = bgClip.t2;
dummy6 = bgClip.a2;
dummy7 = bgClip.b2;
dummy8 = bgClip.c2;
dummy9 = bgClip.d2;
dummy10 = bgClip.e2;
dummy11 = bgClip.f2;
dummy12 = bgClip.g2;
dummy13 = bgClip.hc2;
bgSnd = new bgsound();
mute.addEventListener(MouseEvent.CLICK, Mutebtn);
timerArray = new Array("", 300);
stop();
customerArray2 = new Array();
customerArray1 = new Array();
customerArray3 = new Array();
activeCus = 0;
posArray = new Array(0, 200, 800, 1600, 0);
randomTime = new Array(1000, 4000, 11000, 10000, 7000);
randomTime2 = new Array(5000, 8000, 2000, 500, 10000);
customerId = false;
characterId = false;
vcharacterId = false;
s = 0;
activeArray = new Array(0, 4, 6, 12, 6, 9, 15, 20, 1, 2, 10, 18, 25, 22, 28);
activeArray1 = new Array(0, 3, 5, 8, 9, 12, 14, 17, 19, 20, 21, 23);
activeArray3 = new Array(1, 5, 6, 10, 13, 16, 20, 22, 24, 29, 32, 35, 36, 26);
this["car"].customerId = 1;
this["car"].characterId = 1;
this["car"].vcharacterId = 1;
customerDelay();
secCus();
verticalPos = new Array(0, 1000, 1500, 2000, 3000);
verticalCustomer();
oppPos = new Array(500, 0, 1000, 1500);
verticalOpp();
}
function frame1(){
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stop();
MochiServices.connect("72b7dfa77a275607", root);
loaderId = 0;
wait = 10;
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, preloaderFun);
this.loaderInfo.addEventListener(Event.COMPLETE, finished);
linkBtn.addEventListener(MouseEvent.CLICK, linkFun);
}
function frame5(){
MochiBot.track(this, "66286a08");
stop();
stage.scaleMode = StageScaleMode.NO_SCALE;
modeId = true;
sndStatus = 0;
introClip.helpBtn.addEventListener(MouseEvent.MOUSE_DOWN, helpFnGame);
introClip.playBtn.addEventListener(MouseEvent.CLICK, pressed);
introClip.playMoreGames.addEventListener(MouseEvent.CLICK, playMoreFun);
introClip.playFreeGames.addEventListener(MouseEvent.CLICK, playFreeGameFun);
introClip.normalMode.addEventListener(MouseEvent.CLICK, normalModeFun);
introClip.normalMode.buttonMode = true;
introClip.normalMode.gotoAndStop(2);
introClip.fiveminMode.addEventListener(MouseEvent.CLICK, fiveminModeFun);
introClip.fiveminMode.buttonMode = true;
}
function frame21(){
stop();
earnedMoney.text = String(Math.round(totalamount));
fuellevel = 100;
sndChannel.stop();
startGame = false;
if (totalamount >= 2000){
congrats.gotoAndStop(2);
} else {
congrats.gotoAndStop(1);
};
playAgain.addEventListener(MouseEvent.CLICK, playAgainFun);
playMoreGame.addEventListener(MouseEvent.CLICK, playMoreGameFun);
freeGame.addEventListener(MouseEvent.CLICK, freeGameFun);
scoreSubmit.addEventListener(MouseEvent.CLICK, submitScoreFun);
}
function frame10(){
playBtn1.addEventListener(MouseEvent.MOUSE_DOWN, playFnGame1);
}
function frame25(){
stop();
this.gotoAndStop("start");
}
public function finished(_arg1:Event):void{
loaderId = setInterval(preloadFinish, 1000);
}
public function secondCustomer(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:uint;
var _local7:uint;
_local2 = (_arg1.target.endX - _arg1.target.x);
_local3 = (_arg1.target.endY - _arg1.target.y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local5 = Math.atan2(_local3, _local2);
if (_local4 > 10){
_arg1.target.x = (_arg1.target.x + (Math.cos(_local5) * _arg1.target.speed1));
_arg1.target.y = (_arg1.target.y + (Math.sin(_local5) * _arg1.target.speed1));
} else {
_arg1.target.cid++;
if (_arg1.target.cid == 1){
_arg1.target.hwalkMc.gotoAndStop(2);
_arg1.target.endX = _arg1.target.startX;
_arg1.target.endY = _arg1.target.startY;
} else {
if (_arg1.target.cid == 2){
_arg1.target.hwalkMc.gotoAndStop(1);
_arg1.target.endX = _arg1.target.endPntx;
_arg1.target.endY = _arg1.target.endPnty;
_arg1.target.cid = 0;
};
};
};
if ((((characterId == false)) && ((this["car"].characterId == 1)))){
_local6 = 0;
while (_local6 < 12) {
s = activeArray1[_local6];
customerArray2[s].speed1 = 0;
customerArray2[s].hwalkMc.characterMc.gotoAndStop(2);
_local6++;
};
characterId = true;
};
if (this["car"].characterId == 1){
_local7 = 0;
while (_local7 < customerArray2.length) {
if (((this["car"].hitTestObject(customerArray2[_local7])) && ((customerArray2[_local7].hwalkMc.characterMc.currentFrame == 2)))){
customerArray2[_local7].hwalkMc.characterMc.gotoAndStop(3);
currentSpeed = 0;
arrowClip.visible = true;
customerPickup1();
this["car"].characterId = 0;
this["car"].customerId = 0;
this["car"].vcharacterId = 0;
};
_local7++;
};
};
if (this["car"].characterId == 0){
i = 0;
while (i < customerArray2.length) {
if (customerArray2[i].hwalkMc.characterMc.currentFrame == 2){
customerArray2[i].hwalkMc.characterMc.gotoAndStop(1);
customerArray2[i].speed1 = 5;
};
i++;
};
i = 0;
while (i < customerArray1.length) {
if (customerArray1[i].man.customerMc.currentFrame == 2){
customerArray1[i].man.customerMc.gotoAndStop(1);
customerArray1[i].speed = 5;
};
i++;
};
i = 0;
while (i < customerArray3.length) {
if (customerArray3[i].vwalkMc.manMc.currentFrame == 2){
customerArray3[i].vwalkMc.manMc.gotoAndStop(1);
customerArray3[i].vspeed = 5;
};
i++;
};
};
if (((car.hitTestObject(bgClip.targetclip_2)) && ((this["car"].characterId == 0)))){
customerDrop();
};
if ((((fuellevel <= 0)) || ((enginecount <= 0)))){
bgClip.removeChild((_arg1.target as MovieClip));
_arg1.target.removeEventListener(Event.ENTER_FRAME, secondCustomer);
};
}
public function playFnGame1(_arg1:Event):void{
this.gotoAndStop("start");
}
public function policeProperties(){
i = 1;
while (i < 9) {
bgClip[("policeCar" + i)].speed = 20;
bgClip[("policeCar" + i)].id = 2;
i++;
};
}
public function preloaderFun(_arg1:ProgressEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = _arg1.bytesLoaded;
_local3 = _arg1.bytesTotal;
_local4 = Math.round(((_local2 / _local3) * 100));
intro.gauge.gotoAndStop(_local4);
}
public function KeyUP(_arg1:KeyboardEvent){
if (_arg1.keyCode == Keyboard.DOWN){
downKeyPressed = false;
};
if (_arg1.keyCode == Keyboard.LEFT){
leftKeyPressed = false;
};
if (_arg1.keyCode == Keyboard.UP){
upKeyPressed = false;
};
if (_arg1.keyCode == Keyboard.RIGHT){
rightKeyPressed = false;
};
if (_arg1.keyCode == Keyboard.SPACE){
spaceKeypressed = false;
};
}
public function playAgainFun(_arg1:MouseEvent):void{
this.gotoAndStop("start");
}
public function verticalCustomer(){
var _local1:uint;
var _local2:uint;
var _local3:vchar;
_local1 = 1;
while (_local1 <= 14) {
_local2 = 1;
while (_local2 <= 3) {
_local3 = new vchar();
_local3.gotoAndStop((Math.round((Math.random() * 5)) + 1));
_local3.x = bgClip[("vRef" + _local1)].x;
_local3.y = (bgClip[("vRef" + _local1)].y + verticalPos[_local2]);
_local3.endX = bgClip[("vEnd" + _local1)].x;
_local3.endY = bgClip[("vEnd" + _local1)].y;
_local3.startX = bgClip[("vRef" + _local1)].x;
_local3.startY = bgClip[("vRef" + _local1)].y;
_local3.setX = bgClip[("vEnd" + _local1)].x;
_local3.setY = bgClip[("vEnd" + _local1)].y;
customerArray3.push(_local3);
bgClip.addChild(_local3);
_local3.vspeed = 5;
_local3.id = 0;
_local3.addEventListener(Event.ENTER_FRAME, verticalMovement);
_local2++;
};
_local1++;
};
}
public function Mutebtn(_arg1:MouseEvent):void{
if ((((soundBtn.currentFrame == 1)) && ((sndStatus == 0)))){
soundBtn.gotoAndStop(2);
sndStatus = 1;
sndChannel.stop();
} else {
if ((((soundBtn.currentFrame == 2)) && ((sndStatus == 1)))){
soundBtn.gotoAndStop(1);
sndStatus = 0;
sndChannel = bgSnd.play(0, int.MAX_VALUE);
};
};
}
public function checkForCollision(_arg1:DisplayObject, _arg2:DisplayObject, _arg3:Boolean=true, _arg4:int=0xFF){
var _local5:Rectangle;
var _local6:Rectangle;
var _local7:Rectangle;
var _local8:BitmapData;
var _local9:Matrix;
var _local10:Rectangle;
_local5 = _arg1.getBounds(_arg1.parent.parent);
_local6 = _arg2.getBounds(_arg2.parent.parent.parent);
_local7 = _local5.intersection(_local6);
_local7.x = Math.floor(_local7.x);
_local7.y = Math.floor(_local7.y);
_local7.width = Math.ceil(_local7.width);
_local7.height = Math.ceil(_local7.height);
if ((((_local7.width < 1)) || ((_local7.height < 1)))){
return (null);
};
if (!_arg3){
return (_local7);
};
_local8 = new BitmapData(_local7.width, _local7.height, false);
_local9 = _arg1.transform.concatenatedMatrix;
_local9.translate(-(_local7.left), -(_local7.top));
_local8.draw(_arg1, _local9, new ColorTransform(1, 0, 0, 1, 0xFF, -255, -255, _arg4));
_local9 = _arg2.transform.concatenatedMatrix;
_local9.translate(-(_local7.left), -(_local7.top));
_local8.draw(_arg2, _local9, new ColorTransform(1, 1, 1, 1, 0xFF, 0xFF, 0xFF, _arg4), "difference");
_local10 = _local8.getColorBoundsRect(4294967295, 4278255615);
holder = _local10.width;
if (_local10.width == 0){
return (null);
};
_local10.offset(_local7.left, _local7.top);
return (_local10);
}
public function randomize(_arg1:Array){
var _local2:Number;
var _local3:Number;
var _local4:Object;
var _local5:Object;
_local2 = _arg1.length;
if (_local2 > 0){
while (--_local2) {
_local3 = Math.floor((Math.random() * (_local2 + 1)));
_local4 = _arg1[_local2];
_local5 = _arg1[_local3];
_arg1[_local2] = _local5;
_arg1[_local3] = _local4;
};
};
}
public function submitScoreFun(_arg1:MouseEvent):void{
var o:Object;
var boardID:String;
var p:Object;
var boardID1:String;
var evt = _arg1;
if (modeId == false){
o = {n:[3, 13, 4, 9, 14, 13, 12, 9, 11, 10, 2, 7, 12, 3, 2, 2], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID = o.f(0, "");
MochiScores.showLeaderboard({boardID:boardID, score:totalamount});
} else {
p = {n:[3, 3, 15, 3, 12, 11, 9, 11, 11, 2, 8, 12, 0, 14, 10, 13], f:function (_arg1:Number, _arg2:String):String{
if (_arg2.length == 16){
return (_arg2);
};
return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16))));
}};
boardID1 = p.f(0, "");
MochiScores.showLeaderboard({boardID:boardID1, score:totalamount});
};
}
public function customersMove(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:uint;
var _local7:uint;
_local2 = (_arg1.target.endX - _arg1.target.x);
_local3 = (_arg1.target.endY - _arg1.target.y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local5 = Math.atan2(_local3, _local2);
if (_local4 > 10){
_arg1.target.x = (_arg1.target.x + (Math.cos(_local5) * _arg1.target.speed));
_arg1.target.y = (_arg1.target.y + (Math.sin(_local5) * _arg1.target.speed));
} else {
_arg1.target.Rootid++;
if (_arg1.target.Rootid == 1){
_arg1.target.man.gotoAndStop(2);
_arg1.target.endX = _arg1.target.startPntx;
_arg1.target.endY = _arg1.target.startPnty;
} else {
if (_arg1.target.Rootid == 2){
_arg1.target.man.gotoAndStop(1);
_arg1.target.endX = _arg1.target.endingX;
_arg1.target.endY = _arg1.target.endingY;
_arg1.target.Rootid = 0;
};
};
};
if (customerId == false){
_local6 = 0;
while (_local6 < 15) {
activeCus = activeArray[_local6];
customerArray1[activeCus].speed = 0;
customerArray1[activeCus].man.customerMc.gotoAndStop(2);
_local6++;
};
customerId = true;
};
if (this["car"].customerId == 1){
_local7 = 0;
while (_local7 < customerArray1.length) {
if (((this["car"].hitTestObject(customerArray1[_local7])) && ((customerArray1[_local7].man.customerMc.currentFrame == 2)))){
customerArray1[_local7].man.customerMc.gotoAndStop(3);
currentSpeed = 0;
arrowClip.visible = true;
customerPickup1();
this["car"].customerId = 0;
this["car"].characterId = 0;
this["car"].vcharacterId = 0;
};
_local7++;
};
};
if (this["car"].customerId == 0){
_local7 = 0;
while (_local7 < customerArray1.length) {
if (customerArray1[_local7].man.customerMc.currentFrame == 2){
customerArray1[_local7].man.customerMc.gotoAndStop(1);
customerArray1[_local7].speed = 5;
};
_local7++;
};
_local7 = 0;
while (_local7 < customerArray2.length) {
if (customerArray2[_local7].hwalkMc.characterMc.currentFrame == 2){
customerArray2[_local7].hwalkMc.characterMc.gotoAndStop(1);
customerArray2[_local7].speed1 = 5;
};
_local7++;
};
_local7 = 0;
while (_local7 < customerArray3.length) {
if (customerArray3[_local7].vwalkMc.manMc.currentFrame == 2){
customerArray3[_local7].vwalkMc.manMc.gotoAndStop(1);
customerArray3[_local7].vspeed = 5;
};
_local7++;
};
};
if (((car.hitTestObject(bgClip.targetclip_2)) && ((this["car"].customerId == 0)))){
customerDrop();
};
if ((((fuellevel <= 0)) || ((enginecount <= 0)))){
bgClip.removeChild((_arg1.target as MovieClip));
_arg1.target.removeEventListener(Event.ENTER_FRAME, customersMove);
};
}
public function Main(_arg1:Event):void{
var _local2:Point;
if ((((startGame == true)) && ((bgClip.id == 1)))){
bgClip.id = 0;
sndChannel = bgSnd.play(1, int.MAX_VALUE);
if (modeId == false){
timerMc.gotoAndStop(2);
timerId = setInterval(timerFun, 1000);
};
};
if ((((upKeyPressed == true)) || ((downKeyPressed == true)))){
fueltwo = (fueltwo - 0.2);
fuellevel = Math.round(((fueltwo / 100) * 10));
txt.text = (fuellevel + " %");
fuelClip.fuel.gotoAndStop(Math.round(((fueltwo / 100) * 10)));
if (fuellevel <= 0){
clearInterval(timerId);
clearInterval(intervalId);
sndChannel.stop();
stage.removeEventListener(Event.ENTER_FRAME, Main);
setTimeout(gameOverFun, 2000);
};
};
if ((((((totalamount >= 200)) && (car.hitTestObject(bgClip.fueltank)))) && ((spaceKeypressed == true)))){
if ((((fuellevel < 100)) && ((fuellevel > 0)))){
fueltwo = (fueltwo + 0.6);
fuellevel = Math.round(((fueltwo / 100) * 10));
txt.text = (fuellevel + " %");
fuelClip.fuel.gotoAndStop(Math.round(((fueltwo / 100) * 10)));
totalamount = (totalamount - 0.2);
totalmoney_txt.text = String(Math.round(totalamount));
} else {
fuelFull.gotoAndPlay(2);
};
} else {
if ((((((totalamount < 200)) && (car.hitTestObject(bgClip.fueltank)))) && ((spaceKeypressed == true)))){
fuelmoneyclip.gotoAndPlay(2);
};
};
if (startGame == true){
policeCar();
if (((upKeyPressed) && ((currentSpeed < carMaxSpeed)))){
currentSpeed = (currentSpeed + acceleration);
};
if (((downKeyPressed) && ((currentSpeed > -6)))){
currentSpeed = (currentSpeed - acceleration);
};
if (((leftKeyPressed) && ((leftDisabled == false)))){
if (rightDisabled == true){
rightDisabled = false;
};
car.rotation = (car.rotation - (rotationSpeed * (currentSpeed / carMaxSpeed)));
};
if (((rightKeyPressed) && ((rightDisabled == false)))){
if (leftDisabled == true){
leftDisabled = false;
};
car.rotation = (car.rotation + (rotationSpeed * (currentSpeed / carMaxSpeed)));
};
if (((!(upKeyPressed)) && (!(downKeyPressed)))){
if (currentSpeed > 0){
currentSpeed = (currentSpeed - 0.25);
} else {
if (currentSpeed < -1){
currentSpeed = (currentSpeed + 0.25);
} else {
currentSpeed = 0;
};
};
};
checkCorners();
carMoves();
_local2 = new Point(bgClip.targetclip_2.x, bgClip.targetclip_2.y);
Radians = Math.atan2((car.y - bgClip.localToGlobal(_local2).y), (car.x - bgClip.localToGlobal(_local2).x));
Degrees = Math.round(((Radians * 180) / Math.PI));
arrowClip.rotation = Degrees;
};
}
public function policeCar(){
var _local1:uint;
_local1 = 1;
while (_local1 <= 8) {
xdist = (this[("dummyPolice" + _local1)].x - bgClip[("policeCar" + _local1)].x);
ydist = (this[("dummyPolice" + _local1)].y - bgClip[("policeCar" + _local1)].y);
distance = Math.sqrt(((xdist * xdist) + (ydist * ydist)));
angle = Math.atan2(ydist, xdist);
if (distance > 20){
pDirection = true;
bgClip[("policeCar" + _local1)].x = (bgClip[("policeCar" + _local1)].x + (Math.cos(angle) * bgClip[("policeCar" + _local1)].speed));
bgClip[("policeCar" + _local1)].y = (bgClip[("policeCar" + _local1)].y + (Math.sin(angle) * bgClip[("policeCar" + _local1)].speed));
} else {
if ((((bgClip[("policeCar" + _local1)].id < 4)) && ((Direction == true)))){
if (_local1 == 1){
bgClip.policeCar1.id++;
dummyPolice1 = bgClip[("pc" + bgClip.policeCar1.id)];
};
if (_local1 == 2){
bgClip.policeCar2.id++;
dummyPolice2 = bgClip[("pj" + bgClip.policeCar2.id)];
};
if (_local1 == 3){
bgClip.policeCar3.id++;
dummyPolice3 = bgClip[("h" + bgClip.policeCar3.id)];
};
if (_local1 == 4){
bgClip.policeCar4.id++;
dummyPolice4 = bgClip[("pi" + bgClip.policeCar4.id)];
};
if (_local1 == 5){
bgClip.policeCar5.id++;
dummyPolice5 = bgClip[("pk" + bgClip.policeCar5.id)];
};
if (_local1 == 6){
bgClip.policeCar6.id++;
dummyPolice6 = bgClip[("ps" + bgClip.policeCar6.id)];
};
if (_local1 == 7){
bgClip.policeCar7.id++;
dummyPolice7 = bgClip[("pt" + bgClip.policeCar7.id)];
};
if (_local1 == 8){
bgClip.policeCar8.id++;
dummyPolice8 = bgClip[("pu" + bgClip.policeCar8.id)];
};
pDirection = false;
} else {
if (_local1 == 1){
bgClip.policeCar1.id = 1;
dummyPolice1 = bgClip[("pc" + bgClip.policeCar1.id)];
};
if (_local1 == 2){
bgClip.policeCar2.id = 1;
dummyPolice2 = bgClip[("pj" + bgClip.policeCar2.id)];
};
if (_local1 == 3){
bgClip.policeCar3.id = 1;
dummyPolice3 = bgClip[("h" + bgClip.policeCar3.id)];
};
if (_local1 == 4){
bgClip.policeCar4.id = 1;
dummyPolice4 = bgClip[("pi" + bgClip.policeCar4.id)];
};
if (_local1 == 5){
bgClip.policeCar5.id = 1;
dummyPolice5 = bgClip[("pk" + bgClip.policeCar5.id)];
};
if (_local1 == 6){
bgClip.policeCar6.id = 1;
dummyPolice6 = bgClip[("ps" + bgClip.policeCar6.id)];
};
if (_local1 == 7){
bgClip.policeCar7.id = 1;
dummyPolice7 = bgClip[("pt" + bgClip.policeCar7.id)];
};
if (_local1 == 8){
bgClip.policeCar8.id = 1;
dummyPolice8 = bgClip[("pu" + bgClip.policeCar8.id)];
};
};
};
if ((((bgClip[("policeCar" + _local1)].id == 3)) && ((bgClip[("policeCar" + _local1)].rotation < 90)))){
bgClip[("policeCar" + _local1)].rotation = (bgClip[("policeCar" + _local1)].rotation + 10);
};
if ((((bgClip[("policeCar" + _local1)].id == 4)) && ((bgClip[("policeCar" + _local1)].rotation < 180)))){
bgClip[("policeCar" + _local1)].rotation = (bgClip[("policeCar" + _local1)].rotation + 10);
};
if (bgClip[("policeCar" + _local1)].id == 1){
bgClip[("policeCar" + _local1)].rotation = -90;
};
if (bgClip[("policeCar" + _local1)].id == 2){
bgClip[("policeCar" + _local1)].rotation = 0;
};
if (checkCollision(car, bgClip[("policeCar" + _local1)]) == false){
bgClip.policeId = false;
};
if ((((checkCollision(car, bgClip[("policeCar" + _local1)]) == true)) && ((bgClip.policeId == false)))){
respondCar();
SoundFunction("policehitsound");
if (bgClip[("policeCar" + _local1)].id > 0){
policeclip.gotoAndPlay(2);
bgClip[("policeCar" + _local1)].pcarId = bgClip[("policeCar" + _local1)].id;
bgClip[("policeCar" + _local1)].pang = bgClip[("policeCar" + _local1)].rotation;
bgClip[("policeCar" + _local1)].speed = 0;
bgClip[("policeCar" + _local1)].setX = bgClip[("policeCar" + _local1)].x;
bgClip[("policeCar" + _local1)].setY = bgClip[("policeCar" + _local1)].y;
totalamount = (totalamount - 100);
totalmoney_txt.text = String(Math.round(totalamount));
upKeyPressed = false;
};
if (policeclip.currentFrame > 30){
upKeyPressed = true;
};
bgClip[("policeCar" + _local1)].col = 0;
bgClip[("policeCar" + _local1)].x = (bgClip[("policeCar" + _local1)].x + 40);
bgClip[("policeCar" + _local1)].y = (bgClip[("policeCar" + _local1)].y - 50);
bgClip[("policeCar" + _local1)].id = null;
bgClip[("policeCar" + _local1)].rotation = (bgClip[("policeCar" + _local1)].rotation + 45);
bgClip.policeId = true;
};
if (bgClip[("policeCar" + _local1)].col == 0){
bgClip.psetX = bgClip[("policeCar" + _local1)].localToGlobal(point).x;
bgClip.psetY = bgClip[("policeCar" + _local1)].localToGlobal(point).y;
if ((((((((bgClip.psetX > 800)) || ((bgClip.psetY > 700)))) || ((bgClip.psetX < -20)))) || ((bgClip.psetY < -20)))){
bgClip[("policeCar" + _local1)].rotation = bgClip[("policeCar" + _local1)].pang;
bgClip[("policeCar" + _local1)].id = bgClip[("policeCar" + _local1)].pcarId;
bgClip[("policeCar" + _local1)].col = 1;
bgClip[("policeCar" + _local1)].speed = 20;
bgClip[("policeCar" + _local1)].x = bgClip[("policeCar" + _local1)].setX;
bgClip[("policeCar" + _local1)].y = bgClip[("policeCar" + _local1)].setY;
};
};
_local1++;
};
}
public function normalModeFun(_arg1:MouseEvent):void{
_arg1.target.gotoAndStop(2);
introClip.fiveminMode.gotoAndStop(1);
modeId = true;
}
public function SoundFunction(_arg1:String):void{
var _local2:Class;
var _local3:Object;
_local2 = (getDefinitionByName(_arg1) as Class);
_local3 = new (_local2);
_local3.play();
}
public function horiCheck(){
if (carHorizantal_1 == true){
if ((((car.rotation <= 180)) && ((car.rotation > 90)))){
car.rotation = (car.rotation - globalCarTurnSpeed);
} else {
car.rotation = 90;
carHorizantal_1 = false;
};
};
if (carHorizantal_2 == true){
if ((((car.rotation < -90)) && ((car.rotation > -180)))){
car.rotation = (car.rotation + globalCarTurnSpeed);
} else {
car.rotation = -90;
carHorizantal_2 = false;
};
};
if (carHorizantal_3 == true){
if ((((car.rotation < 90)) && ((car.rotation > 1)))){
car.rotation = (car.rotation + globalCarTurnSpeed);
} else {
car.rotation = 90;
carHorizantal_3 = false;
};
};
if (carHorizantal_4 == true){
if ((((car.rotation <= 0)) && ((car.rotation > -90)))){
car.rotation = (car.rotation - globalCarTurnSpeed);
} else {
car.rotation = -90;
carHorizantal_4 = false;
};
};
if (((carHorizantal_4) && (frtCar_Vertbar_hit_plus_1)) == true){
frtCar_Vertbar_hit_plus_1 = false;
leftDisabled = false;
rightDisabled = false;
backPos3 = false;
};
if (((carHorizantal_1) && (frtCar_Vertbar_hit_plus_0)) == true){
carHorizantal_1 = false;
leftDisabled = false;
rightDisabled = false;
};
if (backPos3 == true){
if ((((car.rotation <= 180)) && ((car.rotation > 90)))){
car.rotation = (car.rotation - globalCarTurnSpeed);
} else {
backPos3 = false;
car.rotation = 90;
};
};
if (backPos5 == true){
if ((((car.rotation < 90)) && ((car.rotation >= 0)))){
car.rotation = (car.rotation + globalCarTurnSpeed);
} else {
backPos5 = false;
car.rotation = 90;
};
};
if (backPos6 == true){
if ((((car.rotation < -90)) && ((car.rotation > -180)))){
car.rotation = (car.rotation - globalCarTurnSpeed);
} else {
car.rotation = -90;
backPos6 = false;
};
};
if (backPos1 == true){
if ((((car.rotation < 0)) && ((car.rotation > -90)))){
car.rotation = (car.rotation - globalCarTurnSpeed);
} else {
car.rotation = -90;
backPos1 = false;
};
};
if (((backPos5) && (frtCar_Vertbar_hit_plus_0)) == true){
backPos5 = false;
};
if (((backPos3) && (frtCar_Vertbar_hit_plus_180)) == true){
backPos3 = false;
};
if (((backPos6) && (carHorizantal_2)) == true){
backPos6 = false;
};
if (((backPos1) && (frtCar_Vertbar_hit_plus_1)) == true){
frtCar_Vertbar_hit_plus_1 = false;
};
}
public function verticalMovement(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:uint;
_local2 = (_arg1.target.endX - _arg1.target.x);
_local3 = (_arg1.target.endY - _arg1.target.y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local5 = Math.atan2(_local3, _local2);
if (_local4 > 10){
_arg1.target.x = (_arg1.target.x + (Math.cos(_local5) * _arg1.target.vspeed));
_arg1.target.y = (_arg1.target.y + (Math.sin(_local5) * _arg1.target.vspeed));
} else {
_arg1.target.id++;
if (_arg1.target.id == 1){
_arg1.target.vwalkMc.gotoAndStop(2);
_arg1.target.endX = _arg1.target.startX;
_arg1.target.endY = _arg1.target.startY;
} else {
if (_arg1.target.id == 2){
_arg1.target.vwalkMc.gotoAndStop(1);
_arg1.target.endX = _arg1.target.setX;
_arg1.target.endY = _arg1.target.setY;
_arg1.target.id = 0;
};
};
};
if (vcharacterId == false){
_local6 = 0;
while (_local6 < 13) {
_local7 = activeArray3[_local6];
customerArray3[_local7].vspeed = 0;
customerArray3[_local7].vwalkMc.manMc.gotoAndStop(2);
_local6++;
};
vcharacterId = true;
};
if (this["car"].vcharacterId == 1){
_local8 = 0;
while (_local8 < customerArray3.length) {
if (((this["car"].hitTestObject(customerArray3[_local8])) && ((customerArray3[_local8].vwalkMc.manMc.currentFrame == 2)))){
customerArray3[_local8].vwalkMc.manMc.gotoAndStop(3);
currentSpeed = 0;
arrowClip.visible = true;
customerPickup1();
this["car"].customerId = 0;
this["car"].characterId = 0;
this["car"].vcharacterId = 0;
};
_local8++;
};
};
if (this["car"].customerId == 0){
_local8 = 0;
while (_local8 < customerArray1.length) {
if (customerArray1[_local8].man.customerMc.currentFrame == 2){
customerArray1[_local8].man.customerMc.gotoAndStop(1);
customerArray1[_local8].speed = 5;
};
_local8++;
};
_local8 = 0;
while (_local8 < customerArray2.length) {
if (customerArray2[_local8].hwalkMc.characterMc.currentFrame == 2){
customerArray2[_local8].hwalkMc.characterMc.gotoAndStop(1);
customerArray2[_local8].speed1 = 5;
};
_local8++;
};
};
if (((car.hitTestObject(bgClip.targetclip_2)) && ((this["car"].customerId == 0)))){
customerDrop();
};
if ((((fuellevel <= 0)) || ((enginecount <= 0)))){
bgClip.removeChild((_arg1.target as MovieClip));
_arg1.target.removeEventListener(Event.ENTER_FRAME, verticalMovement);
};
}
public function fiveminModeFun(_arg1:MouseEvent):void{
introClip.normalMode.gotoAndStop(1);
_arg1.target.gotoAndStop(2);
if (_arg1.target.currentFrame == 2){
modeId = false;
};
}
public function checkCorners(){
var _local1:*;
_local1 = 1;
while (_local1 <= 2) {
if (((checkCollision(car, bgClip.bg[("Hz" + _local1)])) || (checkCollision(car, bgClip.bg[("Vz" + _local1)]))) == false){
speedX = (bgClip.y - ((Math.cos(((car.rotation * Math.PI) / 180)) * currentSpeed) * -1));
speedY = (bgClip.x - (Math.sin(((car.rotation * Math.PI) / 180)) * currentSpeed));
bgClip.x = speedY;
bgClip.y = speedX;
};
if (((checkCollision(car, bgClip.bg[("Hz" + _local1)])) || (checkCollision(car, bgClip.bg[("Vz" + _local1)]))) == true){
currentSpeed = ((currentSpeed / carMaxSpeed) * -0.2);
if (_local1 == 1){
if (checkCollision(car, bgClip.bg[("Hz" + _local1)]) == true){
if ((((((car.rotation < 90)) && ((car.rotation >= 0)))) && ((backPos5 == false)))){
backPos5 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation < 0)) && ((car.rotation > -90)))) && ((backPos1 == false)))){
backPos1 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation <= 180)) && ((car.rotation > 90)))) && ((carHorizantal_1 == false)))){
carHorizantal_1 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation < -90)) && ((car.rotation > -180)))) && ((carHorizantal_2 == false)))){
carHorizantal_2 = true;
SoundFunction("placehitsound");
};
bgClip.y = (bgClip.y + 0.8);
car.y = (car.y - 0.8);
};
if (checkCollision(car, bgClip.bg[("Vz" + _local1)]) == true){
if ((((((car.rotation <= 180)) && ((car.rotation > 90)))) && ((backPos4 == false)))){
backPos4 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation < 90)) && ((car.rotation > 0)))) && ((backPos2 == false)))){
backPos2 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation < -90)) && ((car.rotation > -180)))) && ((frtCar_Vertbar_hit_plus_2 == false)))){
frtCar_Vertbar_hit_plus_2 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation < 0)) && ((car.rotation >= -90)))) && ((frtCar_Vertbar_hit_plus_1 == false)))){
frtCar_Vertbar_hit_plus_1 = true;
SoundFunction("placehitsound");
};
bgClip.x = (bgClip.x - 0.8);
car.x = (car.x + 1.2);
};
};
if (_local1 == 2){
if (checkCollision(car, bgClip.bg[("Hz" + _local1)]) == true){
if ((((((car.rotation <= 180)) && ((car.rotation > 90)))) && ((backPos3 == false)))){
backPos3 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation < -90)) && ((car.rotation > -180)))) && ((backPos6 == false)))){
backPos6 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation < 90)) && ((car.rotation > 1)))) && ((carHorizantal_3 == false)))){
carHorizantal_3 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation <= 0)) && ((car.rotation > -90)))) && ((carHorizantal_4 == false)))){
carHorizantal_4 = true;
SoundFunction("placehitsound");
};
bgClip.y = (bgClip.y - 0.8);
car.y = (car.y + 0.8);
};
if (checkCollision(car, bgClip.bg[("Vz" + _local1)]) == true){
if ((((((car.rotation < 0)) && ((car.rotation > -90)))) && ((backPos7 == false)))){
backPos7 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation < -90)) && ((car.rotation > -180)))) && ((backPos8 == false)))){
backPos8 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation <= 90)) && ((car.rotation > 0)))) && ((frtCar_Vertbar_hit_plus_0 == false)))){
frtCar_Vertbar_hit_plus_0 = true;
SoundFunction("placehitsound");
};
if ((((((car.rotation <= 180)) && ((car.rotation > 90)))) && ((frtCar_Vertbar_hit_plus_180 == false)))){
frtCar_Vertbar_hit_plus_180 = true;
SoundFunction("placehitsound");
};
bgClip.x = (bgClip.x + 0.8);
car.x = (car.x - 0.8);
};
};
};
horiCheck();
verticalCheck();
_local1++;
};
}
public function pricereducedfunc(){
decr_clip.gotoAndPlay(2);
if (priceamount > 5){
priceamount = (priceamount - 10);
price_txt.text = String(priceamount);
} else {
clearInterval(intervalId);
};
}
public function booleean(){
i = 1;
while (i <= 18) {
this[(("customer" + i) + "_Active")] = false;
i++;
};
}
public function respondCar(){
enginecount = (enginecount - 5);
engineClip.gotoAndStop(Math.round((100 - enginecount)));
enginetxt.text = (Math.round(enginecount) + " %");
if (upKeyPressed == true){
downKeyPressed = false;
} else {
if (downKeyPressed == true){
upKeyPressed = false;
};
};
if (enginecount <= 0){
clearInterval(timerId);
clearInterval(intervalId);
setTimeout(gameOverFun, 2000);
stage.removeEventListener(Event.ENTER_FRAME, Main);
};
currentSpeed = (((currentSpeed * -2) + currentSpeed) / 1.2);
}
public function checkCollision(_arg1, _arg2){
var _local3:Rectangle;
_local3 = checkForCollision(_arg1, _arg2);
if (_local3){
return (true);
};
return (false);
}
public function linkFun(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.i6.com/free-games/835/cars?utm_source=games&utm_medium=taxipl"), "_blank");
}
public function oppMove(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = (_arg1.target.setX - _arg1.target.x);
_local3 = (_arg1.target.setY - _arg1.target.y);
_local4 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
_local5 = Math.atan2(_local3, _local2);
if (_local4 > 10){
_arg1.target.x = (_arg1.target.x + (Math.cos(_local5) * 5));
_arg1.target.y = (_arg1.target.y + (Math.sin(_local5) * 5));
} else {
_arg1.target.id++;
if (_arg1.target.id == 1){
_arg1.target.bwalkMc.gotoAndStop(2);
_arg1.target.setX = _arg1.target.stX;
_arg1.target.setY = _arg1.target.stY;
} else {
if (_arg1.target.id == 2){
_arg1.target.bwalkMc.gotoAndStop(1);
_arg1.target.setX = _arg1.target.endX;
_arg1.target.setY = _arg1.target.endY;
_arg1.target.id = 0;
};
};
};
if ((((fuellevel <= 0)) || ((enginecount <= 0)))){
bgClip.removeChild((_arg1.target as MovieClip));
_arg1.target.removeEventListener(Event.ENTER_FRAME, oppMove);
};
}
public function verticalCheck(){
if (frtCar_Vertbar_hit_plus_0 == true){
if ((((car.rotation > 0)) && ((car.rotation <= 90)))){
car.rotation = (car.rotation - globalCarTurnSpeed);
} else {
car.rotation = 0;
frtCar_Vertbar_hit_plus_0 = false;
};
};
if (frtCar_Vertbar_hit_plus_1 == true){
if ((((car.rotation <= -1)) && ((car.rotation >= -90)))){
car.rotation = (car.rotation + globalCarTurnSpeed);
} else {
car.rotation = 0;
frtCar_Vertbar_hit_plus_1 = false;
};
};
if (frtCar_Vertbar_hit_plus_180 == true){
if ((((car.rotation <= 180)) && ((car.rotation > 90)))){
car.rotation = (car.rotation + globalCarTurnSpeed);
} else {
car.rotation = 180;
frtCar_Vertbar_hit_plus_180 = false;
};
};
if (frtCar_Vertbar_hit_plus_2 == true){
if ((((car.rotation < -90)) && ((car.rotation > -180)))){
car.rotation = (car.rotation - globalCarTurnSpeed);
} else {
car.rotation = 180;
frtCar_Vertbar_hit_plus_2 = false;
};
};
if (((frtCar_Vertbar_hit_plus_2) && (carHorizantal_2)) == true){
frtCar_Vertbar_hit_plus_2 = false;
leftDisabled = false;
rightDisabled = false;
};
if (((carHorizantal_1) && (frtCar_Vertbar_hit_plus_180)) == true){
frtCar_Vertbar_hit_plus_180 = false;
leftDisabled = false;
rightDisabled = false;
};
if (((frtCar_Vertbar_hit_plus_0) && (carHorizantal_3)) == true){
frtCar_Vertbar_hit_plus_0 = false;
leftDisabled = false;
rightDisabled = false;
backPos2 = false;
backPos6 = false;
};
if (backPos4 == true){
if ((((car.rotation > 90)) && ((car.rotation <= 180)))){
car.rotation = (car.rotation - globalCarTurnSpeed);
} else {
car.rotation = 90;
backPos4 = false;
};
};
if (backPos2 == true){
if ((((car.rotation > 0)) && ((car.rotation < 90)))){
car.rotation = (car.rotation + globalCarTurnSpeed);
} else {
car.rotation = 90;
backPos2 = false;
};
};
if (backPos7 == true){
if ((((car.rotation < 0)) && ((car.rotation > -90)))){
car.rotation = (car.rotation - globalCarTurnSpeed);
} else {
car.rotation = -90;
backPos7 = false;
};
};
if (backPos8 == true){
if ((((car.rotation < -90)) && ((car.rotation > -180)))){
car.rotation = (car.rotation + globalCarTurnSpeed);
} else {
car.rotation = -90;
backPos8 = false;
};
};
if (((backPos1) && (frtCar_Vertbar_hit_plus_0)) == true){
frtCar_Vertbar_hit_plus_0 = false;
};
}
public function initial(){
i = 1;
while (i <= 13) {
bgClip[("car" + i)].speed = 15;
bgClip[("car" + i)].id = 2;
i++;
};
}
public function playMoreGameFun(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.i6.com/free-games/835/cars?utm_source=games&utm_medium=taxipmg"), "_blank");
}
public function carMoves(){
var _local1:Point;
var _local2:uint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
point = new Point(0, 0);
_local1 = new Point(0, 0);
_local2 = 1;
while (_local2 <= 13) {
xdist = (this[("dummy" + _local2)].x - bgClip[("car" + _local2)].x);
ydist = (this[("dummy" + _local2)].y - bgClip[("car" + _local2)].y);
distance = Math.sqrt(((xdist * xdist) + (ydist * ydist)));
_local3 = bgClip[("car" + _local2)].localToGlobal(_local1).x;
_local4 = bgClip[("car" + _local2)].localToGlobal(_local1).y;
_local5 = (car.x - _local3);
_local6 = (car.y - _local4);
distance1 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
angle = Math.atan2(ydist, xdist);
if (distance1 < 50){
bgClip[("car" + _local2)].speed = 0;
} else {
if (bgClip[("car" + _local2)].col != 0){
bgClip[("car" + _local2)].speed = 15;
};
};
if (distance > 20){
Direction = true;
bgClip[("car" + _local2)].x = (bgClip[("car" + _local2)].x + (Math.cos(angle) * bgClip[("car" + _local2)].speed));
bgClip[("car" + _local2)].y = (bgClip[("car" + _local2)].y + (Math.sin(angle) * bgClip[("car" + _local2)].speed));
} else {
if ((((bgClip[("car" + _local2)].id < 4)) && ((Direction == true)))){
if (_local2 == 1){
bgClip.car1.id++;
dummy1 = bgClip[("p" + bgClip.car1.id)];
};
if (_local2 == 2){
bgClip.car2.id++;
dummy2 = bgClip[("q" + bgClip.car2.id)];
};
if (_local2 == 3){
bgClip.car3.id++;
dummy3 = bgClip[("r" + bgClip.car3.id)];
};
if (_local2 == 4){
bgClip.car4.id++;
dummy4 = bgClip[("s" + bgClip.car4.id)];
};
if (_local2 == 5){
bgClip.car5.id++;
dummy5 = bgClip[("t" + bgClip.car5.id)];
};
if (_local2 == 6){
bgClip.car6.id++;
dummy6 = bgClip[("a" + bgClip.car6.id)];
};
if (_local2 == 7){
bgClip.car7.id++;
dummy7 = bgClip[("b" + bgClip.car7.id)];
};
if (_local2 == 8){
bgClip.car8.id++;
dummy8 = bgClip[("c" + bgClip.car8.id)];
};
if (_local2 == 9){
bgClip.car9.id++;
dummy9 = bgClip[("d" + bgClip.car9.id)];
};
if (_local2 == 10){
bgClip.car10.id++;
dummy10 = bgClip[("e" + bgClip.car10.id)];
};
if (_local2 == 11){
bgClip.car11.id++;
dummy11 = bgClip[("f" + bgClip.car11.id)];
};
if (_local2 == 12){
bgClip.car12.id++;
dummy12 = bgClip[("g" + bgClip.car12.id)];
};
if (_local2 == 13){
bgClip.car13.id++;
dummy13 = bgClip[("hc" + bgClip.car13.id)];
};
Direction = false;
} else {
if (_local2 == 1){
bgClip.car1.id = 1;
dummy1 = bgClip[("p" + bgClip.car1.id)];
};
if (_local2 == 2){
bgClip.car2.id = 1;
dummy2 = bgClip[("q" + bgClip.car2.id)];
};
if (_local2 == 3){
bgClip.car3.id = 1;
dummy3 = bgClip[("r" + bgClip.car3.id)];
};
if (_local2 == 4){
bgClip.car4.id = 1;
dummy4 = bgClip[("s" + bgClip.car4.id)];
};
if (_local2 == 5){
bgClip.car5.id = 1;
dummy5 = bgClip[("t" + bgClip.car5.id)];
};
if (_local2 == 6){
bgClip.car6.id = 1;
dummy6 = bgClip[("a" + bgClip.car6.id)];
};
if (_local2 == 7){
bgClip.car7.id = 1;
dummy7 = bgClip[("b" + bgClip.car7.id)];
};
if (_local2 == 8){
bgClip.car8.id = 1;
dummy8 = bgClip[("c" + bgClip.car8.id)];
};
if (_local2 == 9){
bgClip.car9.id = 1;
dummy9 = bgClip[("d" + bgClip.car9.id)];
};
if (_local2 == 10){
bgClip.car10.id = 1;
dummy10 = bgClip[("e" + bgClip.car10.id)];
};
if (_local2 == 11){
bgClip.car11.id = 1;
dummy11 = bgClip[("f" + bgClip.car11.id)];
};
if (_local2 == 12){
bgClip.car12.id = 1;
dummy12 = bgClip[("g" + bgClip.car12.id)];
};
if (_local2 == 13){
bgClip.car13.id = 1;
dummy13 = bgClip[("hc" + bgClip.car13.id)];
};
};
};
if ((((bgClip[("car" + _local2)].id == 3)) && ((bgClip[("car" + _local2)].rotation < 90)))){
bgClip[("car" + _local2)].rotation = (bgClip[("car" + _local2)].rotation + 10);
};
if ((((bgClip[("car" + _local2)].id == 4)) && ((bgClip[("car" + _local2)].rotation < 180)))){
bgClip[("car" + _local2)].rotation = (bgClip[("car" + _local2)].rotation + 10);
};
if (bgClip[("car" + _local2)].id == 1){
bgClip[("car" + _local2)].rotation = -90;
};
if (bgClip[("car" + _local2)].id == 2){
bgClip[("car" + _local2)].rotation = 0;
};
if (checkCollision(car, bgClip[("car" + _local2)]) == false){
bgClip.setId = false;
};
if ((((((checkCollision(car, bgClip[("car" + _local2)]) == true)) && ((holder > 8)))) && ((bgClip.setId == false)))){
SoundFunction("carhitsound");
respondCar();
bgClip[("car" + _local2)].increment = 0;
if (bgClip[("car" + _local2)].id > 0){
bgClip[("car" + _local2)].carId = bgClip[("car" + _local2)].id;
bgClip[("car" + _local2)].ang = bgClip[("car" + _local2)].rotation;
bgClip[("car" + _local2)].speed = 0;
bgClip[("car" + _local2)].setX = bgClip[("car" + _local2)].x;
bgClip[("car" + _local2)].setY = bgClip[("car" + _local2)].y;
};
bgClip[("car" + _local2)].col = 0;
bgClip[("car" + _local2)].x = (bgClip[("car" + _local2)].x + 15);
bgClip[("car" + _local2)].y = (bgClip[("car" + _local2)].y - 15);
bgClip[("car" + _local2)].id = null;
bgClip.setId = true;
};
if (bgClip[("car" + _local2)].col == 0){
bgClip.setX = bgClip[("car" + _local2)].localToGlobal(point).x;
bgClip.setY = bgClip[("car" + _local2)].localToGlobal(point).y;
if ((((((((bgClip.setX > 800)) || ((bgClip.setY > 700)))) || ((bgClip.setX < -20)))) || ((bgClip.setY < -20)))){
bgClip[("car" + _local2)].x = bgClip[("car" + _local2)].setX;
bgClip[("car" + _local2)].y = bgClip[("car" + _local2)].setY;
bgClip[("car" + _local2)].rotation = bgClip[("car" + _local2)].ang;
bgClip[("car" + _local2)].id = bgClip[("car" + _local2)].carId;
bgClip[("car" + _local2)].col = 1;
bgClip[("car" + _local2)].speed = 15;
};
if (bgClip[("car" + _local2)].increment < 10){
bgClip[("car" + _local2)].increment++;
bgClip[("car" + _local2)].rotation = (bgClip[("car" + _local2)].rotation + bgClip[("car" + _local2)].increment);
};
};
_local2++;
};
}
public function verticalOpp(){
var _local1:uint;
var _local2:uint;
var _local3:oppChar;
_local1 = 1;
while (_local1 <= 12) {
_local2 = 1;
while (_local2 <= 3) {
_local3 = new oppChar();
_local3.gotoAndStop((Math.round((Math.random() * 5)) + 1));
bgClip.addChild(_local3);
_local3.x = bgClip[("vOpp" + _local1)].x;
_local3.y = (bgClip[("vOpp" + _local1)].y - oppPos[_local2]);
_local3.setX = bgClip[("voppEnd" + _local1)].x;
_local3.setY = bgClip[("voppEnd" + _local1)].y;
_local3.stX = bgClip[("vOpp" + _local1)].x;
_local3.stY = bgClip[("vOpp" + _local1)].y;
_local3.endX = bgClip[("voppEnd" + _local1)].x;
_local3.endY = bgClip[("voppEnd" + _local1)].y;
_local3.id = 0;
_local3.addEventListener(Event.ENTER_FRAME, oppMove);
_local2++;
};
_local1++;
};
}
public function customerPickup1(){
place_clips.txt_clip.txt.text = String(placearray[currentTargetNum]);
place_clips.gotoAndPlay(2);
handlePrice();
fixCustomer++;
currentTarget = placearray[currentTargetNum];
currentIndex = newintdexarray.indexOf(currentTarget);
newintdexarray.sort();
currentTargetX = targetXArray[currentIndex];
currentTargetY = targetYArray[currentIndex];
bgClip.targetclip_2.x = currentTargetX;
bgClip.targetclip_2.y = currentTargetY;
priceamount = farearray[currentIndex];
price_txt.text = String(priceamount);
place_name_clip.visible = true;
place_name_clip.place_txt.text = currentTarget;
hitapear = true;
startGame = false;
}
public function helpFnGame(_arg1:Event):void{
this.gotoAndStop("help");
}
public function KeyDown(_arg1:KeyboardEvent){
if (_arg1.keyCode == Keyboard.DOWN){
downKeyPressed = true;
};
if (_arg1.keyCode == Keyboard.LEFT){
leftKeyPressed = true;
};
if (_arg1.keyCode == Keyboard.UP){
upKeyPressed = true;
};
if (_arg1.keyCode == Keyboard.RIGHT){
rightKeyPressed = true;
};
if (_arg1.keyCode == Keyboard.SPACE){
spaceKeypressed = true;
};
}
public function gameOverFun(){
this.gotoAndStop("gameOver");
}
public function customerDrop(){
this["car"].characterId = 1;
this["car"].customerId = 1;
this["car"].vcharacterId = 1;
reachedtarget = true;
prizereduction = true;
clearInterval(intervalId);
price_txt.text = "0";
bgClip.targetclip_2.x = initTgtX;
bgClip.targetclip_2.y = initTgtY;
currentSpeed = 0;
place_clips.gotoAndPlay("thanksclp");
arrowClip.visible = false;
price_txt.text = " ";
place_name_clip.place_txt.text = " ";
totalamount = (totalamount + priceamount);
totalmoney_txt.text = String(priceamount);
if (totalmoney_txt.text != " "){
totalmoney_txt.text = String(totalamount);
};
place_name_clip.visible = false;
currentTargetNum++;
foundCustomer = false;
prizereducedcount = 0;
fixCustomer = 0;
characterId = false;
customerId = false;
vcharacterId = false;
}
}
}//package Game_fla
Section 26
//modeselector_16 (Game_fla.modeselector_16)
package Game_fla {
import flash.display.*;
public dynamic class modeselector_16 extends MovieClip {
public function modeselector_16(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 27
//movemnrs_196 (Game_fla.movemnrs_196)
package Game_fla {
import flash.display.*;
public dynamic class movemnrs_196 extends MovieClip {
public function movemnrs_196(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 28
//noramMc_17 (Game_fla.noramMc_17)
package Game_fla {
import flash.display.*;
public dynamic class noramMc_17 extends MovieClip {
public function noramMc_17(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 29
//oppMoe2_181 (Game_fla.oppMoe2_181)
package Game_fla {
import flash.display.*;
public dynamic class oppMoe2_181 extends MovieClip {
public function oppMoe2_181(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 30
//oppMove1_178 (Game_fla.oppMove1_178)
package Game_fla {
import flash.display.*;
public dynamic class oppMove1_178 extends MovieClip {
public function oppMove1_178(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 31
//oppmove3_184 (Game_fla.oppmove3_184)
package Game_fla {
import flash.display.*;
public dynamic class oppmove3_184 extends MovieClip {
public function oppmove3_184(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 32
//over_173 (Game_fla.over_173)
package Game_fla {
import flash.display.*;
public dynamic class over_173 extends MovieClip {
public function over_173(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 33
//placeclipthree_167 (Game_fla.placeclipthree_167)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class placeclipthree_167 extends MovieClip {
public var txt:TextField;
}
}//package Game_fla
Section 34
//placecliptwo_166 (Game_fla.placecliptwo_166)
package Game_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class placecliptwo_166 extends MovieClip {
public var txt_clip:MovieClip;
public function placecliptwo_166(){
addFrameScript(0, frame1, 1, frame2, 60, frame61, 61, frame62, 90, frame91);
}
function frame91(){
gotoAndStop(1);
}
function frame1(){
stop();
this.visible = false;
}
function frame2(){
this.visible = true;
}
function frame61(){
MovieClip(this.root).startGame = true;
gotoAndStop(1);
}
function frame62(){
this.visible = true;
trace("thanksclips");
}
}
}//package Game_fla
Section 35
//pound1_153 (Game_fla.pound1_153)
package Game_fla {
import flash.display.*;
public dynamic class pound1_153 extends MovieClip {
public function pound1_153(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 36
//RRpaths_75 (Game_fla.RRpaths_75)
package Game_fla {
import flash.display.*;
public dynamic class RRpaths_75 extends MovieClip {
public var Hz1:MovieClip;
public var Hz2:MovieClip;
public var Vz1:MovieClip;
public var Vz2:MovieClip;
}
}//package Game_fla
Section 37
//sadsadsa_116 (Game_fla.sadsadsa_116)
package Game_fla {
import flash.display.*;
public dynamic class sadsadsa_116 extends MovieClip {
public function sadsadsa_116(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Game_fla
Section 38
//sae_199 (Game_fla.sae_199)
package Game_fla {
import flash.display.*;
public dynamic class sae_199 extends MovieClip {
public function sae_199(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 39
//sdsadsacopy3_119 (Game_fla.sdsadsacopy3_119)
package Game_fla {
import flash.display.*;
public dynamic class sdsadsacopy3_119 extends MovieClip {
public function sdsadsacopy3_119(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 40
//swlksamallchar1_188 (Game_fla.swlksamallchar1_188)
package Game_fla {
import flash.display.*;
public dynamic class swlksamallchar1_188 extends MovieClip {
public var manMc:MovieClip;
public function swlksamallchar1_188(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 41
//swlksmallchar2_195 (Game_fla.swlksmallchar2_195)
package Game_fla {
import flash.display.*;
public dynamic class swlksmallchar2_195 extends MovieClip {
public var manMc:MovieClip;
public function swlksmallchar2_195(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 42
//swlksmallchar3_202 (Game_fla.swlksmallchar3_202)
package Game_fla {
import flash.display.*;
public dynamic class swlksmallchar3_202 extends MovieClip {
public var manMc:MovieClip;
public function swlksmallchar3_202(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 43
//Symbol10_137 (Game_fla.Symbol10_137)
package Game_fla {
import flash.display.*;
public dynamic class Symbol10_137 extends MovieClip {
public function Symbol10_137(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 44
//Symbol1fdfddf_163 (Game_fla.Symbol1fdfddf_163)
package Game_fla {
import flash.display.*;
public dynamic class Symbol1fdfddf_163 extends MovieClip {
public function Symbol1fdfddf_163(){
addFrameScript(0, frame1, 35, frame36);
}
function frame1(){
stop();
}
function frame36(){
this.gotoAndStop(1);
}
}
}//package Game_fla
Section 45
//Symbol1frontpageone_159 (Game_fla.Symbol1frontpageone_159)
package Game_fla {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Symbol1frontpageone_159 extends MovieClip {
public function Symbol1frontpageone_159(){
addFrameScript(66, frame67);
}
function frame67(){
stop();
MovieClip(this.root).startGame = true;
}
}
}//package Game_fla
Section 46
//Symbol25_134 (Game_fla.Symbol25_134)
package Game_fla {
import flash.display.*;
public dynamic class Symbol25_134 extends MovieClip {
public var stopClip:MovieClip;
public var playClip:MovieClip;
public function Symbol25_134(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Game_fla
Section 47
//Symbol27_132 (Game_fla.Symbol27_132)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Symbol27_132 extends MovieClip {
public var place_txt:TextField;
}
}//package Game_fla
Section 48
//Symbol5_10 (Game_fla.Symbol5_10)
package Game_fla {
import flash.display.*;
public dynamic class Symbol5_10 extends MovieClip {
public var fiveminMode:MovieClip;
public var normalMode:MovieClip;
public var helpBtn:SimpleButton;
public var playBtn:SimpleButton;
public var playMoreGames:SimpleButton;
public var playFreeGames:SimpleButton;
public function Symbol5_10(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package Game_fla
Section 49
//Symbol72_140 (Game_fla.Symbol72_140)
package Game_fla {
import flash.display.*;
public dynamic class Symbol72_140 extends MovieClip {
public function Symbol72_140(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 50
//taxionesdffas_26 (Game_fla.taxionesdffas_26)
package Game_fla {
import flash.display.*;
public dynamic class taxionesdffas_26 extends MovieClip {
public var place1:MovieClip;
public var b1:MovieClip;
public var b2:MovieClip;
public var b3:MovieClip;
public var b4:MovieClip;
public var customer9:MovieClip;
public var c1:MovieClip;
public var c3:MovieClip;
public var c4:MovieClip;
public var c2:MovieClip;
public var bg:MovieClip;
public var vEnd1:MovieClip;
public var d1:MovieClip;
public var d4:MovieClip;
public var vEnd6:MovieClip;
public var vEnd7:MovieClip;
public var d2:MovieClip;
public var vEnd5:MovieClip;
public var vEnd8:MovieClip;
public var vEnd9:MovieClip;
public var vEnd3:MovieClip;
public var d3:MovieClip;
public var e1:MovieClip;
public var e2:MovieClip;
public var e3:MovieClip;
public var e4:MovieClip;
public var vEnd4:MovieClip;
public var vEnd2:MovieClip;
public var f1:MovieClip;
public var f2:MovieClip;
public var f4:MovieClip;
public var f3:MovieClip;
public var pc2:MovieClip;
public var pc4:MovieClip;
public var pc3:MovieClip;
public var g1:MovieClip;
public var g2:MovieClip;
public var g3:MovieClip;
public var pc1:MovieClip;
public var g4:MovieClip;
public var h1:MovieClip;
public var h2:MovieClip;
public var h3:MovieClip;
public var h4:MovieClip;
public var voppEnd1:MovieClip;
public var voppEnd2:MovieClip;
public var voppEnd3:MovieClip;
public var voppEnd4:MovieClip;
public var voppEnd5:MovieClip;
public var voppEnd6:MovieClip;
public var voppEnd7:MovieClip;
public var voppEnd8:MovieClip;
public var voppEnd9:MovieClip;
public var car10:MovieClip;
public var car12:MovieClip;
public var car13:MovieClip;
public var vOpp1:MovieClip;
public var vOpp2:MovieClip;
public var vOpp3:MovieClip;
public var vOpp5:MovieClip;
public var vOpp6:MovieClip;
public var vOpp7:MovieClip;
public var vOpp8:MovieClip;
public var vOpp9:MovieClip;
public var londoneye:MovieClip;
public var policeCar1:MovieClip;
public var policeCar5:MovieClip;
public var policeCar3:MovieClip;
public var policeCar7:MovieClip;
public var policeCar2:MovieClip;
public var policeCar4:MovieClip;
public var londonmusium:MovieClip;
public var policeCar6:MovieClip;
public var policeCar8:MovieClip;
public var car11:MovieClip;
public var voppEnd10:MovieClip;
public var voppEnd11:MovieClip;
public var voppEnd12:MovieClip;
public var vOpp4:MovieClip;
public var pi4:MovieClip;
public var pi1:MovieClip;
public var pi3:MovieClip;
public var vEnd10:MovieClip;
public var vEnd11:MovieClip;
public var vEnd12:MovieClip;
public var vEnd13:MovieClip;
public var vEnd14:MovieClip;
public var pi2:MovieClip;
public var pj1:MovieClip;
public var pj2:MovieClip;
public var pj3:MovieClip;
public var pj4:MovieClip;
public var pk1:MovieClip;
public var pk2:MovieClip;
public var pk3:MovieClip;
public var pk4:MovieClip;
public var customerPnt1:MovieClip;
public var customerPnt2:MovieClip;
public var customerPnt3:MovieClip;
public var customerPnt5:MovieClip;
public var customerPnt8:MovieClip;
public var p1:MovieClip;
public var p2:MovieClip;
public var p3:MovieClip;
public var customerPnt6:MovieClip;
public var customerPnt7:MovieClip;
public var p4:MovieClip;
public var customerPnt4:MovieClip;
public var q1:MovieClip;
public var q2:MovieClip;
public var q3:MovieClip;
public var q4:MovieClip;
public var r1:MovieClip;
public var r3:MovieClip;
public var r4:MovieClip;
public var r2:MovieClip;
public var bankengland:MovieClip;
public var s1:MovieClip;
public var s3:MovieClip;
public var s4:MovieClip;
public var s2:MovieClip;
public var stpaul:MovieClip;
public var t2:MovieClip;
public var t3:MovieClip;
public var t1:MovieClip;
public var vOpp11:MovieClip;
public var t4:MovieClip;
public var vOpp10:MovieClip;
public var vOpp12:MovieClip;
public var hRef1:MovieClip;
public var hRef2:MovieClip;
public var hRef5:MovieClip;
public var hRef7:MovieClip;
public var ps2:MovieClip;
public var ps3:MovieClip;
public var ps4:MovieClip;
public var hRef8:MovieClip;
public var ps1:MovieClip;
public var burking:MovieClip;
public var hRef3:MovieClip;
public var hRef4:MovieClip;
public var hRef9:MovieClip;
public var hc2:MovieClip;
public var hc3:MovieClip;
public var hRef6:MovieClip;
public var hc1:MovieClip;
public var pt1:MovieClip;
public var pt2:MovieClip;
public var pt3:MovieClip;
public var hc4:MovieClip;
public var pt4:MovieClip;
public var pu2:MovieClip;
public var pu1:MovieClip;
public var pu3:MovieClip;
public var pu4:MovieClip;
public var car1:MovieClip;
public var car2:MovieClip;
public var car3:MovieClip;
public var millinium:MovieClip;
public var car5:MovieClip;
public var car6:MovieClip;
public var car8:MovieClip;
public var car9:MovieClip;
public var car7:MovieClip;
public var car4:MovieClip;
public var vRef10:MovieClip;
public var vRef12:MovieClip;
public var vRef14:MovieClip;
public var vRef11:MovieClip;
public var vRef13:MovieClip;
public var hEnd1:MovieClip;
public var hEnd2:MovieClip;
public var hEnd5:MovieClip;
public var hEnd6:MovieClip;
public var hEnd7:MovieClip;
public var hEnd8:MovieClip;
public var hEnd3:MovieClip;
public var hEnd4:MovieClip;
public var hEnd9:MovieClip;
public var bridge:MovieClip;
public var bigben:MovieClip;
public var vRef1:MovieClip;
public var vRef2:MovieClip;
public var vRef3:MovieClip;
public var vRef4:MovieClip;
public var vRef5:MovieClip;
public var vRef6:MovieClip;
public var vRef7:MovieClip;
public var vRef8:MovieClip;
public var vRef9:MovieClip;
public var fueltank:MovieClip;
public var customerEnd1:MovieClip;
public var customerEnd2:MovieClip;
public var customerEnd3:MovieClip;
public var customerEnd4:MovieClip;
public var customerEnd6:MovieClip;
public var customerEnd7:MovieClip;
public var customerEnd8:MovieClip;
public var customerEnd5:MovieClip;
public var targetclip_2:MovieClip;
public var a1:MovieClip;
public var a2:MovieClip;
public var a3:MovieClip;
public var a4:MovieClip;
}
}//package Game_fla
Section 51
//Timeline_103 (Game_fla.Timeline_103)
package Game_fla {
import flash.display.*;
public dynamic class Timeline_103 extends MovieClip {
public function Timeline_103(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 52
//Timeline_96 (Game_fla.Timeline_96)
package Game_fla {
import flash.display.*;
public dynamic class Timeline_96 extends MovieClip {
public function Timeline_96(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Game_fla
Section 53
//timerBtn_139 (Game_fla.timerBtn_139)
package Game_fla {
import flash.display.*;
import flash.text.*;
public dynamic class timerBtn_139 extends MovieClip {
public var timeText:TextField;
public function timerBtn_139(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Game_fla
Section 54
//MochiCoins (mochi.as3.MochiCoins)
package mochi.as3 {
public class MochiCoins {
public static const STORE_HIDE:String = "StoreHide";
public static const LOGGED_IN:String = "LoggedIn";
public static const STORE_ITEMS:String = "StoreItems";
public static const NO_USER:String = "NoUser";
public static const PROPERTIES_SIZE:String = "PropertiesSize";
public static const ITEM_NEW:String = "ItemNew";
public static const USER_INFO:String = "UserInfo";
public static const IO_ERROR:String = "IOError";
public static const ITEM_OWNED:String = "ItemOwned";
public static const PROPERTIES_SAVED:String = "PropertySaved";
public static const WIDGET_LOADED:String = "WidgetLoaded";
public static const ERROR:String = "Error";
public static const LOGGED_OUT:String = "LoggedOut";
public static const PROFILE_SHOW:String = "ProfileShow";
public static const LOGIN_HIDE:String = "LoginHide";
public static const LOGIN_SHOW:String = "LoginShow";
public static const STORE_SHOW:String = "StoreShow";
public static const PROFILE_HIDE:String = "ProfileHide";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
public static function showItem(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showItem call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showItem", {options:_arg1}, null, null);
}
public static function saveUserProperties(_arg1:Object):void{
MochiServices.send("coins_saveUserProperties", _arg1);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function showLoginWidget(_arg1:Object=null):void{
MochiServices.setContainer();
MochiServices.bringToTop();
MochiServices.send("coins_showLoginWidget", {options:_arg1});
}
public static function getStoreItems():void{
MochiServices.send("coins_getStoreItems");
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function showStore(_arg1:Object=null):void{
MochiServices.bringToTop();
MochiServices.send("coins_showStore", {options:_arg1}, null, null);
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function getUserInfo():void{
MochiServices.send("coins_getUserInfo");
}
public static function hideLoginWidget():void{
MochiServices.send("coins_hideLoginWidget");
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function showVideo(_arg1:Object=null):void{
if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){
trace("ERROR: showVideo call must pass an Object with an item key");
return;
};
MochiServices.bringToTop();
MochiServices.send("coins_showVideo", {options:_arg1}, null, null);
}
}
}//package mochi.as3
Section 55
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{
Encoder = 0;
setValue(_arg1, _arg2);
}
public function set value(_arg1:Number):void{
setValue(_arg1);
}
public function reencode():void{
var _local1:uint;
_local1 = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (_local1 ^ Encoder));
Encoder = _local1;
}
public function toString():String{
var _local1:String;
_local1 = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
_local1 = (_local1 + Sibling.toString());
};
return (_local1);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(_arg1:Number=0, _arg2:uint=0):void{
var _local3:String;
_local3 = _arg1.toString();
var _temp1 = _arg2;
_arg2 = (_arg2 + 1);
Fragment = (_local3.charCodeAt(_temp1) ^ Encoder);
if (_arg2 < _local3.length){
Sibling = new MochiDigits(_arg1, _arg2);
} else {
Sibling = null;
};
reencode();
}
public function addValue(_arg1:Number):void{
value = (value + _arg1);
}
}
}//package mochi.as3
Section 56
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher)
package mochi.as3 {
public class MochiEventDispatcher {
private var eventTable:Object;
public function MochiEventDispatcher():void{
eventTable = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
return;
};
for (_local3 in eventTable[_arg1]) {
var _local6 = eventTable[_arg1];
_local6[_local3](_arg2);
};
}
public function removeEventListener(_arg1:String, _arg2:Function):void{
var _local3:Object;
if (eventTable[_arg1] == undefined){
eventTable[_arg1] = [];
return;
};
for (_local3 in eventTable[_arg1]) {
if (eventTable[_arg1][_local3] != _arg2){
} else {
eventTable[_arg1].splice(Number(_local3), 1);
};
};
}
public function addEventListener(_arg1:String, _arg2:Function):void{
removeEventListener(_arg1, _arg2);
eventTable[_arg1].push(_arg2);
}
}
}//package mochi.as3
Section 57
//MochiEvents (mochi.as3.MochiEvents)
package mochi.as3 {
import flash.display.*;
public class MochiEvents {
public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL";
public static const FORMAT_LONG:String = "LongForm";
public static const ALIGN_BOTTOM:String = "ALIGN_B";
public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived";
public static const FORMAT_SHORT:String = "ShortForm";
public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR";
public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR";
public static const ALIGN_TOP:String = "ALIGN_T";
public static const ALIGN_LEFT:String = "ALIGN_L";
public static const ALIGN_RIGHT:String = "ALIGN_R";
public static const ALIGN_TOP_LEFT:String = "ALIGN_TL";
public static const ALIGN_CENTER:String = "ALIGN_C";
private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher();
private static var gameStart:Number;
private static var levelStart:Number;
public static function addEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.addEventListener(_arg1, _arg2);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
_dispatcher.removeEventListener(_arg1, _arg2);
}
public static function startSession(_arg1:String):void{
MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null);
}
public static function triggerEvent(_arg1:String, _arg2:Object):void{
_dispatcher.triggerEvent(_arg1, _arg2);
}
public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{
var _local3:Object;
var _local4:Object;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
_local3.clip = _arg1;
MochiServices.send("events_setNotifications", _local3, null, null);
}
public static function endGame():void{
var _local1:Number;
_local1 = (new Date().time - gameStart);
trigger("end_game", {time:_local1});
}
public static function startGame():void{
gameStart = new Date().time;
trigger("start_game");
}
public static function trigger(_arg1:String, _arg2:Object=null):void{
if (_arg2 == null){
_arg2 = {};
} else {
if (_arg2["kind"] != undefined){
trace("WARNING: optional arguements package contains key 'id', it will be overwritten");
_arg2["kind"] = _arg1;
};
};
MochiServices.send("events_triggerEvent", {eventObject:_arg2}, null, null);
}
public static function getVersion():String{
return (MochiServices.getVersion());
}
public static function startLevel():void{
levelStart = new Date().time;
trigger("start_level");
}
public static function endLevel():void{
var _local1:Number;
_local1 = (new Date().time - levelStart);
trigger("end_level", {time:_local1});
}
}
}//package mochi.as3
Section 58
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var n:Number;
var options = _arg1;
if (options != null){
delete options.clip;
MochiServices.setContainer();
MochiServices.bringToTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(n) != n){
trace((("WARNING: Submitted score '" + options.score) + "' will be truncated"));
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.warnID(options.boardID, true);
trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal");
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
_arg1 = Number(_arg1);
if (isNaN(_arg1)){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'"));
} else {
if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){
trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite"));
} else {
if (Math.floor(_arg1) != _arg1){
trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated"));
};
_arg1 = Number(_arg1);
};
};
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiServices.warnID(_arg1, true);
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi.as3
Section 59
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _preserved:Object;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
public static var servicesSync:MochiSync = new MochiSync();
private static var _clip:MovieClip;
private static var _id:String;
private static var _services:String = "services.swf";
private static var _servURL:String = "http://www.mochiads.com/static/lib/services/";
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _loader:Loader;
private static var _connecting:Boolean = false;
private static var _mochiLocalConnection:MovieClip;
private static var _listenChannelName:String = "__ms_";
public static var onError:Object;
public static var netup:Boolean = true;
private static var _mochiLC:String = "MochiLC.swf";
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function onReceive(_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = _clip._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString()));
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace(("Error invoking method on object: " + error.toString()));
};
};
};
delete _clip._callbacks[cb];
}
public static function get childClip():Object{
return (_clip);
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1));
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:MovieClip;
var _local8:LocalConnection;
var _local9:String;
var _local10:ByteArray;
var _local11:ByteArray;
var _local12:uint;
var _local13:uint;
var _local14:Loader;
_local3 = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
_local5 = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
_local6 = [0, 64, 0, 0, 0];
_local7 = new MovieClip();
_local8 = new LocalConnection();
_local9 = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time));
_local8 = new LocalConnection();
_local7.lc = _local8;
_local7.click = _arg2;
_local8.client = _local7;
_local8.connect(_local9);
_local10 = new ByteArray();
_local11 = new ByteArray();
_local11.endian = Endian.LITTLE_ENDIAN;
_local11.writeShort(1);
_local11.writeUTFBytes(((_arg1 + " ") + _local9));
_local11.writeByte(0);
_local12 = ((_local3.length + _local11.length) + 4);
_local13 = (_local12 + 35);
_local10.endian = Endian.LITTLE_ENDIAN;
_local10.writeUTFBytes("FWS");
_local10.writeByte(8);
_local10.writeUnsignedInt(_local13);
for each (_local4 in _local5) {
_local10.writeByte(_local4);
};
_local10.writeUnsignedInt(_local12);
_local10.writeByte(136);
_local10.writeShort(_local11.length);
_local10.writeBytes(_local11);
for each (_local4 in _local3) {
_local10.writeByte(_local4);
};
for each (_local4 in _local6) {
_local10.writeByte(_local4);
};
_local14 = new Loader();
_local14.loadBytes(_local10);
_local7.addChild(_local14);
return (_local7);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = _arg1;
var burl = _arg2;
var btn = _arg3;
var onClick = _arg4;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (_arg1:String):void{
var _local2:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(_arg1, onClick);
_local2 = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = _local2.x;
avm1Click.y = _local2.y;
avm1Click.scaleX = (0.01 * _local2.width);
avm1Click.scaleY = (0.01 * _local2.height);
};
err = function (_arg1:Object):void{
netup = false;
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
setURL(burl);
};
complete = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function warnID(_arg1:String, _arg2:Boolean):void{
var _local3:Number;
_arg1 = _arg1.toLowerCase();
if (_arg1.length != 16){
trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length"));
return;
} else {
if (_arg1 == "1e113c7239048b3f"){
if (_arg2){
trace("WARNING: Using testing board ID");
} else {
trace("WARNING: Using testing board ID as game ID");
};
return;
} else {
if (_arg1 == "84993a1de4031cd8"){
if (_arg2){
trace("WARNING: Using testing game ID as board ID");
} else {
trace("WARNING: Using testing game ID");
};
return;
};
};
};
_local3 = 0;
while (_local3 < _arg1.length) {
switch (_arg1.charAt(_local3)){
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
case "a":
case "b":
case "c":
case "d":
case "e":
case "f":
break;
default:
trace(("WARNING: Board ID contains illegal characters: " + _arg1));
return;
};
_local3++;
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_mochiLocalConnection.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
};
return (_local2);
}
public static function getVersion():String{
return ("3.3 as3");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (((_clip) && (_clip._queue))){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
}
public static function get id():String{
return (_id);
}
private static function onEvent(_arg1:Object):void{
var _local2:String;
var _local3:String;
_local2 = _arg1.target;
_local3 = _arg1.event;
switch (_local2){
case "events":
MochiEvents.triggerEvent(_arg1.event, _arg1.args);
break;
case "coins":
MochiCoins.triggerEvent(_arg1.event, _arg1.args);
break;
case "sync":
servicesSync.triggerEvent(_arg1.event, _arg1.args);
break;
};
}
private static function urlOptions(_arg1:Object):Object{
var _local2:Object;
var _local3:String;
var _local4:Array;
var _local5:Number;
var _local6:Array;
_local2 = {};
if (_arg1.stage){
_local3 = _arg1.stage.loaderInfo.parameters.mochiad_options;
} else {
_local3 = _arg1.loaderInfo.parameters.mochiad_options;
};
if (_local3){
_local4 = _local3.split("&");
_local5 = 0;
while (_local5 < _local4.length) {
_local6 = _local4[_local5].split("=");
_local2[unescape(_local6[0])] = unescape(_local6[1]);
_local5++;
};
};
return (_local2);
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
private static function loadError(_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
}
private static function initComChannels():void{
if (!_connected){
trace("[SERVICES_API] connected!");
_connecting = false;
_connected = true;
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_clip.onReceive = onReceive;
_clip.onEvent = onEvent;
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
while (_clip._queue.length > 0) {
_mochiLocalConnection.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function loadLCBridge(_arg1:Object):void{
var loader:Loader;
var mochiLCURL:String;
var req:URLRequest;
var complete:Function;
var clip = _arg1;
loader = new Loader();
mochiLCURL = (_servURL + _mochiLC);
req = new URLRequest(mochiLCURL);
complete = function (_arg1:Object):void{
_mochiLocalConnection = MovieClip(loader.content);
listen();
};
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
loader.load(req);
clip.addChild(loader);
}
private static function listen():void{
_mochiLocalConnection.connect(_listenChannelName);
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
trace("Waiting for MochiAds services to connect...");
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var _local3:String;
var _local4:String;
var _local5:URLRequest;
var _local6:URLVariables;
_local3 = ("_mochiservices_com_" + _arg1);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(_arg2).servURL){
_servURL = urlOptions(_arg2).servURL;
};
_local4 = (_servURL + _services);
if (urlOptions(_arg2).servicesURL){
_local4 = urlOptions(_arg2).servicesURL;
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999))));
MochiServices.allowDomains(_local4);
_clip = createEmptyMovieClip(_arg2, _local3, 10336, false);
loadLCBridge(_clip);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError);
_local5 = new URLRequest(_local4);
_local6 = new URLVariables();
_local6.listenLC = _listenChannelName;
_local6.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options;
_local6.api_version = getVersion();
if (widget){
_local6.widget = true;
};
_local5.data = _local6;
_loader.load(_local5);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
warnID(id, false);
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = _arg1;
var name = _arg2;
var depth = _arg3;
var doAdd = _arg4;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
try {
parent[name] = mc;
} catch(e:Error) {
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
mc["_name"] = name;
return (mc);
}
public static function bringToTop(_arg1:Event=null):void{
var e = _arg1;
if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connectWait(_arg1:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load. (timeout)");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 60
//MochiSync (mochi.as3.MochiSync)
package mochi.as3 {
import flash.utils.*;
public dynamic class MochiSync extends Proxy {
private var _syncContainer:Object;
public static var SYNC_PROPERTY:String = "UpdateProperty";
public static var SYNC_REQUEST:String = "SyncRequest";
public function MochiSync():void{
_syncContainer = {};
}
public function triggerEvent(_arg1:String, _arg2:Object):void{
switch (_arg1){
case SYNC_REQUEST:
MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY:
_syncContainer[_arg2.name] = _arg2.value;
break;
};
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){
return (_syncContainer[_arg1]);
}
override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{
var _local3:String;
if (_syncContainer[_arg1] == _arg2){
return;
};
_local3 = _arg1.toString();
_syncContainer[_local3] = _arg2;
MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2});
}
}
}//package mochi.as3
Section 61
//bgsound (bgsound)
package {
import flash.media.*;
public dynamic class bgsound extends Sound {
}
}//package
Section 62
//carhitsound (carhitsound)
package {
import flash.media.*;
public dynamic class carhitsound extends Sound {
}
}//package
Section 63
//char (char)
package {
import flash.display.*;
public dynamic class char extends MovieClip {
public var hwalkMc:MovieClip;
public function char(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 64
//customer (customer)
package {
import flash.display.*;
public dynamic class customer extends MovieClip {
public var man:MovieClip;
public function customer(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 65
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 66
//oppChar (oppChar)
package {
import flash.display.*;
public dynamic class oppChar extends MovieClip {
public var bwalkMc:MovieClip;
public function oppChar(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 67
//placehitsound (placehitsound)
package {
import flash.media.*;
public dynamic class placehitsound extends Sound {
}
}//package
Section 68
//policeCar (policeCar)
package {
import flash.display.*;
public dynamic class policeCar extends MovieClip {
}
}//package
Section 69
//policehitsound (policehitsound)
package {
import flash.media.*;
public dynamic class policehitsound extends Sound {
}
}//package
Section 70
//vchar (vchar)
package {
import flash.display.*;
public dynamic class vchar extends MovieClip {
public var vwalkMc:MovieClip;
public function vchar(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package