Section 1
//CreditsFrame (btn.CreditsFrame)
package btn {
import flash.events.*;
import flash.display.*;
import main.*;
public class CreditsFrame extends MovieClip {
public var menu:MovieClip;
private var imS:SimpleButton;
public function CreditsFrame(){
this.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.menu.addEventListener(MouseEvent.CLICK, menuEvent);
};
}
private function menuEvent(_arg1:MouseEvent):void{
Main.getInstance().hideCreditsFrame();
Main.getInstance().showFirstPage();
}
}
}//package btn
Section 2
//End (btn.End)
package btn {
import flash.events.*;
import flash.display.*;
import main.*;
import flash.text.*;
import flash.net.*;
public class End extends MovieClip {
public var submit:MovieClip;
public var submitFrame:SubmitFrame;
public var youWin:MovieClip;
public var menu:MovieClip;
public var score:TextField;
public var retry:MovieClip;
public var view:MovieClip;
private var imS:SimpleButton;
private var imT:TextField;
public var gameOver:MovieClip;
public function End(){
this.submitFrame.visible = false;
this.removeChild(this.gameOver);
this.removeChild(this.youWin);
this.score.text = (GameWorld.getInstance().getScore() + "");
this.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.retry.addEventListener(MouseEvent.CLICK, retryEvent);
this.menu.addEventListener(MouseEvent.CLICK, menuEvent);
this.submit.addEventListener(MouseEvent.CLICK, submitEvent);
this.view.addEventListener(MouseEvent.CLICK, viewEvent);
};
}
public function hideSubmit():void{
this.submit.visible = false;
}
private function viewEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.freeworldgroup.com/score/index.asp");
_local2.data = ("game=" + Main.GAMENAME);
navigateToURL(_local2, "_blank");
}
public function showGameOver():void{
this.addChildAt(this.gameOver, 0);
}
private function submitEvent(_arg1:MouseEvent):void{
this.submitFrame.visible = true;
}
private function menuEvent(_arg1:MouseEvent):void{
Main.getInstance().delGame();
Main.getInstance().showFirstPage();
}
public function showYouWin():void{
this.addChildAt(this.youWin, 0);
}
private function retryEvent(_arg1:MouseEvent):void{
Main.getInstance().delGame();
Main.getInstance().addGame();
}
}
}//package btn
Section 3
//FirstPage (btn.FirstPage)
package btn {
import flash.events.*;
import flash.display.*;
import main.*;
import flash.net.*;
public class FirstPage extends MovieClip {
public var version:MovieClip;
public var downloadGames:SimpleButton;
public var addGame:SimpleButton;
public var playGame:SimpleButton;
public var moreOnlineGames:SimpleButton;
public var credits:SimpleButton;
public var instruction:SimpleButton;
private var imS:SimpleButton;
public var copyright:SimpleButton;
public var viewHighScores:SimpleButton;
public function FirstPage(){
this.version.version.selectable = false;
this.version.version.text = Main.VERSION;
this.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.playGame.addEventListener(MouseEvent.CLICK, playGameEvent);
this.instruction.addEventListener(MouseEvent.CLICK, instructionEvent);
this.downloadGames.addEventListener(MouseEvent.CLICK, downloadEvent);
this.moreOnlineGames.addEventListener(MouseEvent.CLICK, moreOnlineEvent);
this.addGame.addEventListener(MouseEvent.CLICK, addGameEvent);
this.viewHighScores.addEventListener(MouseEvent.CLICK, viewEvent);
this.copyright.addEventListener(MouseEvent.CLICK, copyrightEvent);
this.credits.addEventListener(MouseEvent.CLICK, creditsEvent);
this.addEventListener(Event.REMOVED, removed);
};
}
private function viewEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.freeworldgroup.com/score/index.asp");
_local2.data = ("game=" + Main.GAMENAME);
navigateToURL(_local2, "_blank");
}
private function copyrightEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.freeworldgroup.com/");
navigateToURL(_local2, "_blank");
}
private function playGameEvent(_arg1:MouseEvent):void{
Main.getInstance().hideFirstPage();
if (Main.getInstance().getFirstPlay() == false){
Main.getInstance().addGame();
} else {
Main.getInstance().showInstructionFrame();
};
}
private function addGameEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.freeworldgroup.com/koalafiles.htm");
navigateToURL(_local2, "_blank");
}
private function creditsEvent(_arg1:MouseEvent):void{
Main.getInstance().hideFirstPage();
Main.getInstance().showCreditsFrame();
}
private function moreOnlineEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.freeworldgroup.com");
navigateToURL(_local2, "_blank");
}
private function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.removeEventListener(Event.REMOVED, removed);
trace("FirstPage实例被删除.");
};
}
private function instructionEvent(_arg1:MouseEvent):void{
Main.getInstance().hideFirstPage();
Main.getInstance().showInstructionFrame();
}
private function downloadEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.ifungames.com");
navigateToURL(_local2, "_blank");
}
}
}//package btn
Section 4
//InstructionFrame (btn.InstructionFrame)
package btn {
import flash.events.*;
import flash.display.*;
import main.*;
public class InstructionFrame extends MovieClip {
public var next:MovieClip;
public var menu:MovieClip;
public var skip:MovieClip;
private var imS:SimpleButton;
public var back:MovieClip;
public function InstructionFrame(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
this.addEventListener(Event.ADDED, added);
this.back.visible = false;
this.skip.gotoAndStop(1);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.menu.addEventListener(MouseEvent.CLICK, menuEvent);
this.back.addEventListener(MouseEvent.CLICK, backEvent);
this.next.addEventListener(MouseEvent.CLICK, nextEvent);
this.skip.addEventListener(MouseEvent.CLICK, skipEvent);
};
}
private function backEvent(_arg1:MouseEvent):void{
if (this.currentFrame > 1){
this.prevFrame();
this.next.visible = true;
this.skip.gotoAndStop(1);
if (this.currentFrame == 1){
this.back.visible = false;
};
};
}
private function skipEvent(_arg1:MouseEvent):void{
Main.getInstance().hideInstructionFrame();
Main.getInstance().addGame();
}
function frame3(){
stop();
}
function frame1(){
stop();
}
private function nextEvent(_arg1:MouseEvent):void{
if (this.currentFrame < this.totalFrames){
this.nextFrame();
this.back.visible = true;
if (this.currentFrame == this.totalFrames){
this.skip.gotoAndStop(2);
this.next.visible = false;
};
};
}
private function menuEvent(_arg1:MouseEvent):void{
Main.getInstance().hideInstructionFrame();
Main.getInstance().showFirstPage();
}
function frame2(){
stop();
}
}
}//package btn
Section 5
//Logo (btn.Logo)
package btn {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Logo extends SimpleButton {
public function Logo(_arg1:DisplayObject=null, _arg2:DisplayObject=null, _arg3:DisplayObject=null, _arg4:DisplayObject=null){
super(_arg1, _arg2, _arg3, _arg4);
this.addEventListener(Event.ADDED, added);
this.addEventListener(MouseEvent.CLICK, logoEvent);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
};
}
private function logoEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.freeworldgroup.com/");
navigateToURL(_local2, "_blank");
}
}
}//package btn
Section 6
//MenuBox (btn.MenuBox)
package btn {
import flash.events.*;
import flash.display.*;
import main.*;
public class MenuBox extends MovieClip {
private var imS:SimpleButton;
public var no:SimpleButton;
public var yes:SimpleButton;
public function MenuBox(){
this.visible = false;
this.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.yes.addEventListener(MouseEvent.CLICK, chooseEvent);
this.no.addEventListener(MouseEvent.CLICK, chooseEvent);
};
}
private function chooseEvent(_arg1:MouseEvent):void{
if (_arg1.target == yes){
this.visible = false;
Main.getInstance().delGame();
Main.getInstance().showFirstPage();
} else {
if (_arg1.target == no){
this.visible = false;
};
};
}
}
}//package btn
Section 7
//Pause (btn.Pause)
package btn {
import flash.display.*;
public class Pause extends SimpleButton {
private var state:String;
public static const RUN:String = "RUN";
public static const PAUSE:String = "PAUSE";
private static var pause:Pause;
public function Pause(){
trace("Pause为单例类.");
this.init();
}
public function init():void{
this.state = Pause.RUN;
}
public function getState():String{
return (this.state);
}
public function pauseControl():void{
if (this.state == Pause.PAUSE){
this.state = Pause.RUN;
} else {
if (this.state == Pause.RUN){
this.state = Pause.PAUSE;
};
};
}
public function setState(_arg1:String):void{
this.state = _arg1;
}
public static function getInstance():Pause{
if (Pause.pause == null){
Pause.pause = new (Pause);
};
return (Pause.pause);
}
}
}//package btn
Section 8
//PQSMM (btn.PQSMM)
package btn {
import flash.events.*;
import flash.display.*;
import sound.*;
public class PQSMM extends MovieClip {
public var menuBox:MenuBox;
public var sound:MovieClip;
public var music:MovieClip;
public var qualityBox:QualityBox;
public var menu:MovieClip;
private var imS:SimpleButton;
public var pause:MovieClip;
public var quality:MovieClip;
public function PQSMM(){
this.menuBox.visible = false;
this.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.setMusic();
this.setSound();
this.setPause();
this.pause.addEventListener(MouseEvent.CLICK, pauseEvent);
this.quality.addEventListener(MouseEvent.CLICK, qualityEvent);
this.sound.addEventListener(MouseEvent.CLICK, soundEvent);
this.music.addEventListener(MouseEvent.CLICK, musicEvent);
this.menu.addEventListener(MouseEvent.CLICK, menuEvent);
this.addEventListener(Event.REMOVED, removed);
};
}
private function setMusic():void{
if (MusicManager.getInstance().getState() == MusicManager.MUTE){
this.music.gotoAndStop(2);
} else {
this.music.gotoAndStop(1);
};
}
private function pauseEvent(_arg1:MouseEvent):void{
Pause.getInstance().pauseControl();
this.setPause();
}
private function musicEvent(_arg1:MouseEvent):void{
MusicManager.getInstance().muteControl();
this.setMusic();
}
private function menuEvent(_arg1:MouseEvent):void{
this.qualityBox.visible = false;
if (this.menuBox.visible == false){
this.menuBox.visible = true;
} else {
if (this.menuBox.visible == true){
this.menuBox.visible = false;
};
};
}
private function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.removeEventListener(Event.REMOVED, removed);
trace("PQSMM实例被删除.");
};
}
private function setPause():void{
if (Pause.getInstance().getState() == Pause.PAUSE){
this.pause.gotoAndStop(2);
} else {
this.pause.gotoAndStop(1);
};
}
private function setSound():void{
if (SoundManager.getInstance().getMute() == true){
this.sound.gotoAndStop(2);
} else {
this.sound.gotoAndStop(1);
};
}
private function soundEvent(_arg1:MouseEvent):void{
SoundManager.getInstance().muteControl();
this.setSound();
}
public function hidePause():void{
this.pause.visible = false;
}
private function qualityEvent(_arg1:MouseEvent):void{
this.menuBox.visible = false;
if (this.qualityBox.visible == true){
this.qualityBox.visible = false;
} else {
if (this.qualityBox.visible == false){
this.qualityBox.visible = true;
};
};
}
public function showPause():void{
this.pause.visible = true;
}
}
}//package btn
Section 9
//QualityBox (btn.QualityBox)
package btn {
import flash.events.*;
import flash.display.*;
public class QualityBox extends MovieClip {
public var best:SimpleButton;
public var low:SimpleButton;
public var medium:SimpleButton;
public var high:SimpleButton;
private var imS:SimpleButton;
public var currentChoose:MovieClip;
public function QualityBox(){
this.visible = false;
this.addEventListener(Event.ADDED, added);
this.addEventListener(Event.ADDED_TO_STAGE, addedToStage);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.low.addEventListener(MouseEvent.CLICK, qualityEvent);
this.medium.addEventListener(MouseEvent.CLICK, qualityEvent);
this.high.addEventListener(MouseEvent.CLICK, qualityEvent);
this.best.addEventListener(MouseEvent.CLICK, qualityEvent);
};
}
private function addedToStage(_arg1:Event):void{
var _local2:String;
if (_arg1.target == _arg1.currentTarget){
_local2 = this.stage.quality.toLowerCase();
this.currentChoose.y = this[_local2].y;
};
}
private function qualityEvent(_arg1:MouseEvent):void{
if (_arg1.target == this.low){
this.stage.quality = "LOW";
} else {
if (_arg1.target == this.medium){
this.stage.quality = "MEDIUM";
} else {
if (_arg1.target == this.high){
this.stage.quality = "HIGH";
} else {
if (_arg1.target == this.best){
this.stage.quality = "BEST";
};
};
};
};
this.currentChoose.y = _arg1.target.y;
this.visible = false;
}
}
}//package btn
Section 10
//SubmitFrame (btn.SubmitFrame)
package btn {
import flash.events.*;
import flash.display.*;
import main.*;
import flash.text.*;
import flash.net.*;
public class SubmitFrame extends MovieClip {
public var submit:SimpleButton;
public var enterName:MovieClip;
private var send:URLLoader;
public var score:TextField;
public var view:SimpleButton;
private var imS:SimpleButton;
private var imT:TextField;
public var userName:TextField;
public var close:MovieClip;
public function SubmitFrame(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
this.view.visible = false;
this.enterName.visible = false;
this.score.text = GameWorld.getInstance().getScore().toString();
this.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.submit.addEventListener(MouseEvent.CLICK, submitEvent);
this.close.addEventListener(MouseEvent.CLICK, closeEvent);
this.view.addEventListener(MouseEvent.CLICK, viewEvent);
};
}
private function viewEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
_local2 = new URLRequest("http://www.freeworldgroup.com/score/index.asp");
_local2.data = ("game=" + Main.GAMENAME);
navigateToURL(_local2, "_blank");
this.visible = false;
}
function frame3(){
stop();
}
private function submitEvent(_arg1:MouseEvent):void{
var _local2:URLRequest;
var _local3:URLVariables;
if (this.userName.text != ""){
_local2 = new URLRequest("http://www.freeworldgroup.com/score/score.asp");
_local3 = new URLVariables();
_local3.game = Main.GAMENAME;
_local3.score = this.score.text;
_local3.name = this.userName.text;
_local2.data = _local3;
_local2.method = URLRequestMethod.POST;
this.send = new URLLoader();
this.send.load(_local2);
this.send.addEventListener(Event.COMPLETE, sendEvent);
this.gotoAndStop(2);
} else {
this.enterName.visible = true;
};
}
function frame1(){
stop();
}
function frame2(){
stop();
}
private function closeEvent(_arg1:MouseEvent):void{
this.visible = false;
}
private function sendEvent(_arg1:Event):void{
GameWorld.getInstance().submited();
this.gotoAndStop(3);
this.view.visible = true;
this.submit.visible = false;
}
}
}//package btn
Section 11
//Car (cars.Car)
package cars {
import map.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import main.*;
import house.*;
import btn.*;
import flash.utils.*;
public class Car extends House {
private var movePoints:Array;
private var moveTimer:Timer;
private var position:Point;
private var maxSpeed:Point;
private var ro:int;
private var speed:Point;
private var stopTimer:Timer;
private var turnFlag:Boolean;
private var turnCount:int;
private var turnDir:int;
private var sCarMc:MovieClip;
public function Car(){
super.setBigTestArea(null);
this.turnCount = 1;
this.scaleX = 0.9;
this.scaleY = 0.9;
this.speed = new Point(0, 0);
this.maxSpeed = new Point(6, 6);
this.ro = 0;
this.turnDir = 1;
this.turnFlag = true;
this.rotation = this.ro;
this.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.init();
this.layout();
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
};
}
public function setSCar(_arg1:MovieClip):void{
this.sCarMc = _arg1;
this.sCarMc.scaleX = 1.8;
this.sCarMc.scaleY = 1.8;
}
private function init():void{
this.position = new Point(0, 0);
this.moveTimer = new Timer(30);
this.stopTimer = new Timer(3000, 1);
}
private function layout():void{
var _local1:Number;
var _local2:Number;
if (this.movePoints != null){
this.setPosition(this.movePoints[0].x, this.movePoints[0].y);
_local1 = (this.movePoints[1].x - this.movePoints[0].x);
_local2 = (this.movePoints[1].y - this.movePoints[0].y);
this.rotation = ((180 / Math.PI) * Math.atan2(_local2, _local1));
} else {
throw (new Error("Car的移动点未设置。"));
};
this.moveTimer.addEventListener(TimerEvent.TIMER, this.turnOver);
this.addEventListener(Event.ENTER_FRAME, this.moveEvent);
}
public function moveEvent(_arg1:Event):void{
if ((((Pause.getInstance().getState() == Pause.RUN)) && ((GameWorld.getInstance().getState() == GameWorld.PLAYING)))){
this.moving();
};
}
public function moving():void{
var _local1:Number;
var _local2:Number;
var _local3:Point;
var _local4:int;
if ((((this.movePoints[this.turnCount].x == 0)) && ((this.movePoints[this.turnCount].y == 0)))){
this.setPosition(this.movePoints[0].x, this.movePoints[0].y);
this.turnCount = 1;
};
_local1 = (this.movePoints[this.turnCount].x - this.getPosition().x);
_local2 = (this.movePoints[this.turnCount].y - this.getPosition().y);
_local3 = this.parent.localToGlobal(new Point(this.x, this.y));
if ((((((((_local3.x > -50)) && ((_local3.y > -50)))) && ((_local3.x < (Map.MapWidth + 50))))) && ((_local3.y < (Map.MapHeight + 50))))){
this.visible = true;
} else {
this.visible = false;
};
if ((((_local1 == 0)) && ((_local2 > 0)))){
this.ro = 90;
this.sCarMc.rotation = this.rotation;
this.speed.x = 0;
this.speed.y = this.maxSpeed.y;
} else {
if ((((_local1 == 0)) && ((_local2 < 0)))){
this.ro = -90;
this.sCarMc.rotation = this.rotation;
this.speed.x = 0;
this.speed.y = -(this.maxSpeed.y);
} else {
if ((((_local1 > 0)) && ((_local2 == 0)))){
this.ro = 0;
this.sCarMc.rotation = this.rotation;
this.speed.x = this.maxSpeed.x;
this.speed.y = 0;
} else {
if ((((_local1 < 0)) && ((_local2 == 0)))){
this.ro = 180;
this.sCarMc.rotation = this.rotation;
this.speed.x = -(this.maxSpeed.x);
this.speed.y = 0;
};
};
};
};
if ((((Math.abs(_local1) <= Math.abs(this.speed.x))) && ((Math.abs(_local2) <= Math.abs(this.speed.y))))){
this.setPosition(this.movePoints[this.turnCount].x, this.movePoints[this.turnCount].y);
_local4 = ((this.turnCount + 1) % this.movePoints.length);
if ((((this.movePoints[this.turnCount].x == this.movePoints[_local4].x)) && ((this.movePoints[this.turnCount].y == this.movePoints[_local4].y)))){
};
this.turnCount = ((this.turnCount + 1) % this.movePoints.length);
if (this.turnCount == 0){
this.turnCount++;
};
} else {
this.setPosition((this.getPosition().x + this.speed.x), (this.getPosition().y + this.speed.y));
this.sCarMc.x = (this.getPosition().x * SmallMap.scale);
this.sCarMc.y = (this.getPosition().y * SmallMap.scale);
};
}
public function addToStage(_arg1:Sprite){
_arg1.addChild(this);
}
public function startMove():void{
if (this.movePoints != null){
this.moveTimer.start();
} else {
throw (new Error("没有设置移动点."));
};
}
public function getSpeed():Point{
return (this.speed);
}
public function getPosition():Point{
this.position.x = this.x;
this.position.y = this.y;
return (this.position);
}
private function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.moveTimer.stop();
this.moveTimer.removeEventListener(TimerEvent.TIMER, this.turnOver);
this.removeEventListener(Event.ENTER_FRAME, this.moveEvent);
this.removeEventListener(Event.REMOVED, this.removed);
};
}
public function getGlobal():Point{
var _local1:Number;
var _local2:Number;
_local1 = (this.parent.x + this.x);
_local2 = (this.parent.y + this.y);
return (new Point(_local1, _local2));
}
public function setPosition(_arg1:Number, _arg2:Number):void{
this.position.x = _arg1;
this.position.y = _arg2;
this.x = this.position.x;
this.y = this.position.y;
}
public function setMaxSpeed(_arg1:Number, _arg2:Number):void{
this.maxSpeed.x = _arg1;
this.maxSpeed.y = _arg2;
}
public function stopEvent(_arg1:TimerEvent):void{
this.startMove();
}
public function setPoints(_arg1:Array):void{
this.movePoints = _arg1;
}
public function turnOver(_arg1:TimerEvent):void{
if ((((Pause.getInstance().getState() == Pause.RUN)) && ((GameWorld.getInstance().getState() == GameWorld.PLAYING)))){
if (this.rotation != this.ro){
if (this.turnFlag == true){
if ((((((((((this.rotation == 0)) && ((this.ro == -90)))) || ((((this.rotation == 90)) && ((this.ro == 0)))))) || ((((this.rotation == 180)) && ((this.ro == 90)))))) || ((((this.rotation == -90)) && ((this.ro == 180)))))){
this.turnFlag = false;
this.turnDir = -1;
} else {
this.turnFlag = false;
this.turnDir = 1;
};
};
this.rotation = (this.rotation + (5 * this.turnDir));
this.rotation = (this.rotation + 360);
} else {
this.turnFlag = true;
};
};
}
}
}//package cars
Section 12
//Car1 (cars.Car1)
package cars {
import flash.display.*;
import flash.geom.*;
public class Car1 extends Car {
public var bigArea:MovieClip;
public function Car1(){
var _local1:*;
var _local2:Array;
super();
super.setHitTestArea(this.bigArea);
_local1 = new SCar1();
super.setSHouseMc(_local1);
super.setSCar(_local1);
_local2 = new Array(new Point(0, 288), new Point(128, 288), new Point(816, 288), new Point(816, 920), new Point(695, 920), new Point(695, 410), new Point(128, 410));
super.setPoints(_local2);
}
}
}//package cars
Section 13
//Car2 (cars.Car2)
package cars {
import flash.display.*;
import flash.geom.*;
public class Car2 extends Car {
public var bigArea:MovieClip;
public function Car2(){
var _local1:*;
var _local2:Array;
super();
super.setHitTestArea(this.bigArea);
_local1 = new SCar2();
super.setSHouseMc(_local1);
super.setSCar(_local1);
_local2 = new Array(new Point(695, 1120), new Point(695, 920), new Point(695, 410), new Point(128, 410), new Point(128, 288), new Point(816, 288), new Point(816, 920));
super.setPoints(_local2);
}
}
}//package cars
Section 14
//Car3 (cars.Car3)
package cars {
import flash.display.*;
import flash.geom.*;
public class Car3 extends Car {
public var bigArea:MovieClip;
public function Car3(){
var _local1:*;
var _local2:Array;
super();
super.setHitTestArea(this.bigArea);
_local1 = new SCar2();
super.setSHouseMc(_local1);
super.setSCar(_local1);
_local2 = new Array(new Point(0, 1050), new Point(110, 1050), new Point(1005, 1050));
super.setPoints(_local2);
}
}
}//package cars
Section 15
//Car4 (cars.Car4)
package cars {
import flash.display.*;
import flash.geom.*;
public class Car4 extends Car {
public var bigArea:MovieClip;
public function Car4(){
var _local1:*;
var _local2:Array;
super();
super.setHitTestArea(this.bigArea);
_local1 = new SCar4();
super.setSHouseMc(_local1);
super.setSCar(_local1);
_local2 = new Array(new Point(455, 1175), new Point(555, 1175), new Point(555, 1730));
super.setPoints(_local2);
this.scaleX = 0.8;
this.scaleY = 0.8;
}
}
}//package cars
Section 16
//CarManager (cars.CarManager)
package cars {
import flash.events.*;
import flash.geom.*;
public class CarManager {
private var carAr:Array;
private var num:int;
private var carMoveTimers:Array;
private static var cManager:CarManager;
public function CarManager(){
trace("CarManager为单例类.");
this.init();
}
public function addCar(_arg1:Car):void{
this.carAr.push(_arg1);
}
public function init():void{
var _local1:Array;
var _local2:Car;
this.carMoveTimers = new Array();
this.num = 14;
this.carAr = new Array();
_local2 = new Car1();
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(-500, 288), new Point(128, 288), new Point(816, 288), new Point(816, 920), new Point(695, 920), new Point(695, 410), new Point(128, 410));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(-1000, 288), new Point(128, 288), new Point(816, 288), new Point(816, 920), new Point(695, 920), new Point(695, 410), new Point(128, 410));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car2();
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(695, 1420), new Point(695, 920), new Point(695, 410), new Point(128, 410), new Point(128, 288), new Point(816, 288), new Point(816, 920));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car3();
this.addCar(_local2);
_local2 = new Car4();
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(0, 1815), new Point(110, 1815), new Point(695, 1815));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(1230, 1815), new Point(1330, 1815), new Point(835, 1815));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(275, 1815), new Point(275, 1915), new Point(275, 2495));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(835, 2395), new Point(835, 2495), new Point(835, 1915));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(0, 2580), new Point(110, 2580), new Point(267, 2580), new Point(267, 2945), new Point(267, 2580));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(300, 2580), new Point(400, 2580), new Point(840, 2580), new Point(840, 2965), new Point(840, 2580));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(860, 2325), new Point(960, 2325), new Point(0x0505, 2325));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(1410, 2380), new Point(1410, 0x0A0A), new Point(1410, 1900));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(1410, 2845), new Point(1410, 2945), new Point(1410, 2710));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(1125, 1590), new Point(1125, 1690), new Point(1125, 1290), new Point(1600, 1290), new Point(1125, 1290));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(1125, 1070), new Point(1125, 1170), new Point(1125, 615));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(1480, 540), new Point(1580, 540), new Point(1125, 540), new Point(1125, 150), new Point(1125, 540));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(1710, 0), new Point(1710, 110), new Point(1710, 2970), new Point(1810, 2970), new Point(1810, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(1710, -390), new Point(1710, 110), new Point(1710, 2970), new Point(1810, 2970), new Point(1810, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(1710, -890), new Point(1710, 110), new Point(1710, 2970), new Point(1810, 2970), new Point(1810, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(1710, -1390), new Point(1710, 110), new Point(1710, 2970), new Point(1810, 2970), new Point(1810, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(1710, -1890), new Point(1710, 110), new Point(1710, 2970), new Point(1810, 2970), new Point(1810, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(1810, 3100), new Point(1810, 2970), new Point(1810, 110), new Point(1710, 110), new Point(1710, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(1810, 3470), new Point(1810, 2970), new Point(1810, 110), new Point(1710, 110), new Point(1710, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(1810, 3970), new Point(1810, 2970), new Point(1810, 110), new Point(1710, 110), new Point(1710, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(1810, 4470), new Point(1810, 2970), new Point(1810, 110), new Point(1710, 110), new Point(1710, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(1810, 4970), new Point(1810, 2970), new Point(1810, 110), new Point(1710, 110), new Point(1710, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(7, 7);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(1930, 0), new Point(1930, 110), new Point(1930, 2970), new Point(2030, 2970), new Point(2030, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(1930, -390), new Point(1930, 110), new Point(1930, 2970), new Point(2030, 2970), new Point(2030, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(1930, -890), new Point(1930, 110), new Point(1930, 2970), new Point(2030, 2970), new Point(2030, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(1930, -1390), new Point(1930, 110), new Point(1930, 2970), new Point(2030, 2970), new Point(2030, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(1930, -1890), new Point(1930, 110), new Point(1930, 2970), new Point(2030, 2970), new Point(2030, 110));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(2030, 3100), new Point(2030, 2970), new Point(2030, 110), new Point(1930, 110), new Point(1930, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(2030, 3470), new Point(2030, 2970), new Point(2030, 110), new Point(1930, 110), new Point(1930, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(2030, 3970), new Point(2030, 2970), new Point(2030, 110), new Point(1930, 110), new Point(1930, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(2030, 4470), new Point(2030, 2970), new Point(2030, 110), new Point(1930, 110), new Point(1930, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(2030, 4970), new Point(2030, 2970), new Point(2030, 110), new Point(1930, 110), new Point(1930, 2970));
_local2.setPoints(_local1);
_local2.setMaxSpeed(5, 5);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(2590, 0), new Point(2590, 175), new Point(2590, 430));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(3015, 655), new Point(3115, 655), new Point(2205, 655), new Point(2205, 550), new Point(3115, 550));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(3515, 655), new Point(3115, 655), new Point(2205, 655), new Point(2205, 550), new Point(3115, 550));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(4015, 655), new Point(3115, 655), new Point(2205, 655), new Point(2205, 550), new Point(3115, 550));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(4515, 655), new Point(3115, 655), new Point(2205, 655), new Point(2205, 550), new Point(3115, 550));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(2890, 675), new Point(2890, 775), new Point(2890, 1450));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(2055, 1300), new Point(2155, 1300), new Point(2600, 1300), new Point(2600, 1550), new Point(2600, 1300));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(3000, 1550), new Point(3100, 1550), new Point(2725, 1550));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(2885, 1550), new Point(2885, 1650), new Point(2885, 1970));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car3();
_local1 = new Array(new Point(3000, 2065), new Point(3100, 2065), new Point(2155, 2065));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car4();
_local1 = new Array(new Point(2600, 2075), new Point(2600, 2175), new Point(2600, 2470));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car2();
_local1 = new Array(new Point(3200, 2575), new Point(3100, 2575), new Point(2155, 2575));
_local2.setPoints(_local1);
this.addCar(_local2);
_local2 = new Car1();
_local1 = new Array(new Point(2600, 3080), new Point(2600, 2980), new Point(2600, 2690));
_local2.setPoints(_local1);
this.addCar(_local2);
}
public function getCarIndex(_arg1:int):Car{
return (this.carAr[_arg1]);
}
public function getNum():int{
return (this.carAr.length);
}
public function gc():void{
var _local1:int;
CarManager.cManager = null;
_local1 = 0;
while (_local1 < this.carMoveTimers.length) {
this.carMoveTimers[_local1].removeEventListener(TimerEvent.TIMER, this[("moveEvent" + _local1)]);
_local1++;
};
trace("CarManager实例被删除.");
}
public static function getInstance():CarManager{
if (CarManager.cManager == null){
CarManager.cManager = new (CarManager);
};
return (CarManager.cManager);
}
}
}//package cars
Section 17
//Logo (framework.Logo)
package framework {
import flash.display.*;
public dynamic class Logo extends MovieClip {
}
}//package framework
Section 18
//AllMc_12 (Froglivery_fla.AllMc_12)
package Froglivery_fla {
import flash.display.*;
public dynamic class AllMc_12 extends MovieClip {
public function AllMc_12(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Froglivery_fla
Section 19
//cfhfgjghkhjlk_138 (Froglivery_fla.cfhfgjghkhjlk_138)
package Froglivery_fla {
import flash.display.*;
public dynamic class cfhfgjghkhjlk_138 extends MovieClip {
public var mc:MovieClip;
}
}//package Froglivery_fla
Section 20
//DFHFGJ_104 (Froglivery_fla.DFHFGJ_104)
package Froglivery_fla {
import flash.display.*;
public dynamic class DFHFGJ_104 extends MovieClip {
public function DFHFGJ_104(){
addFrameScript(43, frame44);
}
function frame44(){
stop();
}
}
}//package Froglivery_fla
Section 21
//fghgkjhkljkl_139 (Froglivery_fla.fghgkjhkljkl_139)
package Froglivery_fla {
import flash.display.*;
public dynamic class fghgkjhkljkl_139 extends MovieClip {
public function fghgkjhkljkl_139(){
addFrameScript(0, frame1, 59, frame60);
}
function frame1(){
stop();
}
function frame60(){
stop();
}
}
}//package Froglivery_fla
Section 22
//fghjhljkljkl_141 (Froglivery_fla.fghjhljkljkl_141)
package Froglivery_fla {
import flash.display.*;
public dynamic class fghjhljkljkl_141 extends MovieClip {
public function fghjhljkljkl_141(){
addFrameScript(73, frame74);
}
function frame74(){
stop();
}
}
}//package Froglivery_fla
Section 23
//loading_10 (Froglivery_fla.loading_10)
package Froglivery_fla {
import flash.display.*;
public dynamic class loading_10 extends MovieClip {
public function loading_10(){
addFrameScript(134, frame135);
}
function frame135(){
stop();
(root as MovieClip).play();
}
}
}//package Froglivery_fla
Section 24
//loading_3 (Froglivery_fla.loading_3)
package Froglivery_fla {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import flash.media.*;
import loading.*;
import flash.text.*;
import flash.net.*;
import flash.system.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.printing.*;
import flash.xml.*;
public dynamic class loading_3 extends MovieClip {
public var txt:LoadingTxt;
public var loading_text_mc:MovieClip;
public function loading_3(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 38, frame39);
}
function frame3(){
this.visible = true;
}
function frame1(){
}
function frame2(){
(parent as MovieClip).checkGoNext();
}
function frame39(){
stop();
txt.onLoadComplete = (parent as MovieClip).goNext;
loading_text_mc.txt.text = "Loading...";
}
}
}//package Froglivery_fla
Section 25
//loading_8 (Froglivery_fla.loading_8)
package Froglivery_fla {
import flash.display.*;
import ui.*;
public dynamic class loading_8 extends MovieClip {
public var txt:Txt;
}
}//package Froglivery_fla
Section 26
//MainTimeline (Froglivery_fla.MainTimeline)
package Froglivery_fla {
import flash.display.*;
import main.*;
import flash.utils.*;
import loading.*;
public dynamic class MainTimeline extends MovieClip {
public var prevLoader:PrevLoader;
public var __setPropDict:Dictionary;
public var m;
public function MainTimeline(){
__setPropDict = new Dictionary(true);
super();
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
m = Main.getInstance();
addChild(m);
stop();
}
function frame1(){
if ((((__setPropDict[prevLoader] == undefined)) || (!((int(__setPropDict[prevLoader]) == 1))))){
__setPropDict[prevLoader] = currentFrame;
__setProp_prevLoader__1();
};
MochiAd.showPreGameAd({clip:this, ad_finished:PrevLoader.goNext2, id:"42681425d7139eb7", res:"600x400", background:6845841, color:788068, outline:12695210, no_bg:false});
}
function __setProp_prevLoader__1(){
try {
prevLoader["componentInspectorSetting"] = true;
} catch(e:Error) {
};
prevLoader.protection = false;
prevLoader.skip = false;
try {
prevLoader["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package Froglivery_fla
Section 27
//MusicBtnMc_97 (Froglivery_fla.MusicBtnMc_97)
package Froglivery_fla {
import flash.display.*;
public dynamic class MusicBtnMc_97 extends MovieClip {
public function MusicBtnMc_97(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Froglivery_fla
Section 28
//PauseBtnMc_92 (Froglivery_fla.PauseBtnMc_92)
package Froglivery_fla {
import flash.display.*;
public dynamic class PauseBtnMc_92 extends MovieClip {
public function PauseBtnMc_92(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Froglivery_fla
Section 29
//playBtn_63 (Froglivery_fla.playBtn_63)
package Froglivery_fla {
import flash.display.*;
public dynamic class playBtn_63 extends MovieClip {
public function playBtn_63(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Froglivery_fla
Section 30
//popup_225 (Froglivery_fla.popup_225)
package Froglivery_fla {
import flash.display.*;
public dynamic class popup_225 extends MovieClip {
public function popup_225(){
addFrameScript(0, frame1, 11, frame12, 17, frame18);
}
function frame18(){
stop();
}
function frame12(){
stop();
}
function frame1(){
stop();
}
}
}//package Froglivery_fla
Section 31
//SoundBtnMc_94 (Froglivery_fla.SoundBtnMc_94)
package Froglivery_fla {
import flash.display.*;
public dynamic class SoundBtnMc_94 extends MovieClip {
public function SoundBtnMc_94(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package Froglivery_fla
Section 32
//Version_48 (Froglivery_fla.Version_48)
package Froglivery_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Version_48 extends MovieClip {
public var version:TextField;
}
}//package Froglivery_fla
Section 33
//House (house.House)
package house {
import map.*;
import flash.events.*;
import flash.display.*;
public class House extends MovieClip {
private var sHouseMc:MovieClip;
private var notPassArea:Sprite;
private var bigTestArea:Sprite;
private var smallMap:SmallMap;
private var hitTestArea:Sprite;
public function House(){
this.notPassArea = null;
this.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
init();
this.showSmallMapMc();
this.addEventListener(Event.REMOVED, removed);
};
}
private function init():void{
this.smallMap = SmallMap.getInstance();
}
public function getBigTestArea():Sprite{
return (this.bigTestArea);
}
public function setHitTestArea(_arg1:Sprite):void{
this.hitTestArea = _arg1;
}
public function getSHouseMc():MovieClip{
return (this.sHouseMc);
}
public function setNotPassArea(_arg1:Sprite):void{
this.notPassArea = _arg1;
}
public function showSmallMapMc():void{
this.sHouseMc.scaleX = this.scaleX;
this.sHouseMc.scaleY = this.scaleY;
this.sHouseMc.x = this.x;
this.sHouseMc.y = this.y;
this.smallMap.addChild(this.sHouseMc);
}
public function getNotPassArea():Sprite{
return (this.notPassArea);
}
public function setSHouseMc(_arg1:MovieClip):void{
this.sHouseMc = _arg1;
this.sHouseMc.scaleX = this.scaleX;
this.sHouseMc.scaleY = this.scaleY;
}
private function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.removeEventListener(Event.REMOVED, this.removed);
trace("House实例被删除.");
};
}
public function setBigTestArea(_arg1:Sprite):void{
this.bigTestArea = _arg1;
}
public function getHitTestArea():Sprite{
return (this.hitTestArea);
}
public function showSmallMapDeliver():void{
this.sHouseMc.gotoAndStop(2);
}
public function hideSmallMapDeliver():void{
this.sHouseMc.gotoAndStop(1);
}
}
}//package house
Section 34
//House1 (house.House1)
package house {
import flash.display.*;
public class House1 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House1(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc1());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 35
//House10 (house.House10)
package house {
import flash.display.*;
public class House10 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House10(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc10());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 36
//House11 (house.House11)
package house {
import flash.display.*;
public class House11 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House11(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc11());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 37
//House12 (house.House12)
package house {
import flash.display.*;
public class House12 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House12(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc12());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 38
//House13 (house.House13)
package house {
import flash.display.*;
public class House13 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House13(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc13());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 39
//House14 (house.House14)
package house {
import flash.display.*;
public class House14 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House14(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc14());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 40
//House15 (house.House15)
package house {
import flash.display.*;
public class House15 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House15(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc15());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 41
//House16 (house.House16)
package house {
import flash.display.*;
public class House16 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House16(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc16());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 42
//House2 (house.House2)
package house {
import flash.display.*;
public class House2 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House2(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc2());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 43
//House3 (house.House3)
package house {
import flash.display.*;
public class House3 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House3(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc3());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 44
//House6 (house.House6)
package house {
import flash.display.*;
public class House6 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House6(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc6());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 45
//House7 (house.House7)
package house {
import flash.display.*;
public class House7 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House7(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc7());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 46
//House9 (house.House9)
package house {
import flash.display.*;
public class House9 extends House {
public var moreArea:MovieClip;
public var bigArea:MovieClip;
public function House9(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
super();
super.setHitTestArea(this.moreArea);
super.setBigTestArea(this.moreArea);
super.setSHouseMc(new SHouseMc9());
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package house
Section 47
//LoadingTxt (loading.LoadingTxt)
package loading {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class LoadingTxt extends Sprite {
private var txt;
public var onLoadComplete:Function;
public function LoadingTxt(){
onLoadComplete = function ():void{
};
super();
txt = this.getChildAt(0);
txt.autoSize = "center";
this.addEventListener(Event.ENTER_FRAME, run);
this.addEventListener(Event.ADDED_TO_STAGE, added);
}
private function added(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, added);
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
private function removed(_arg1:Event):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
onLoadComplete = null;
}
private function run(_arg1:Event):void{
var _local2:int;
_local2 = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
txt.text = (_local2 + "%");
if (_local2 == 100){
this.removeEventListener(Event.ENTER_FRAME, run);
onLoadComplete();
};
}
}
}//package loading
Section 48
//PrevLoader (loading.PrevLoader)
package loading {
import flash.display.*;
import ui.*;
public class PrevLoader extends MovieClip {
public var protection:Boolean;// = true
public var maskRect:MaskRect;
public static var prevLoader:PrevLoader;
public function PrevLoader(){
protection = true;
super();
prevLoader = this;
stage.showDefaultContextMenu = false;
stop();
(root as MovieClip).stop();
MaskRect.setPos(maskRect, setPos);
__setProp_maskRect_loading_1();
}
public function set skip(_arg1:Boolean):void{
if (_arg1){
Common.stopAll(this);
(root as MovieClip).play();
trace("skip");
this.visible = false;
};
}
private function isInUrlFront(_arg1:String):Boolean{
var _local2:String;
_local2 = this.loaderInfo.url;
_local2.toLowerCase();
_arg1.toLowerCase();
return ((_local2.indexOf(_arg1) == 0));
}
public function checkGoNext():void{
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
goNext();
};
}
public function goNext():void{
if (((root as MovieClip)._mochiad is MovieClip)){
} else {
goNext2();
};
}
public function goNext2():void{
if (protection){
if (((isIn("freeworldgroup.com")) || (isIn("ifungames.com")))){
this.gotoAndStop(3);
} else {
this.gotoAndStop(2);
};
} else {
this.gotoAndStop(3);
};
prevLoader = null;
}
private function setPos(_arg1:int, _arg2:int):void{
this.x = (_arg1 / 2);
this.y = (_arg2 / 2);
}
function __setProp_maskRect_loading_1(){
try {
maskRect["componentInspectorSetting"] = true;
} catch(e:Error) {
};
maskRect.align = "center-middle";
try {
maskRect["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
private function isIn(_arg1:String):Boolean{
return (((((((isInUrlFront(_arg1)) || (isInUrlFront(("http://" + _arg1))))) || (isInUrlFront(("http://www." + _arg1))))) || (isInUrlFront(("www." + _arg1)))));
}
public static function goNext():void{
if (prevLoader){
prevLoader.goNext();
};
}
public static function goNext2():void{
prevLoader.goNext2();
}
}
}//package loading
Section 49
//GameWorld (main.GameWorld)
package main {
import map.*;
import flash.events.*;
import flash.display.*;
import sound.*;
import role.*;
import btn.*;
import flash.utils.*;
public class GameWorld {
private var firstPop:FirstPop;
private var state:String;
private var score:int;
private var mc:Sprite;
private var deliverMc:DeliverMc;
private var light:LightMc;
private var soundManager:SoundManager;
private var lifeNumMc:LifeNumMc;
private var submitFlag:Boolean;
private var endTimer:Timer;
private var pqsmm:PQSMM;
private var timeCount:TimeCount;
private var smallMap:SmallMap;
private var person:Person;
private var end:End;
private var map:Map;
private var lifeNum:int;
private var stage:Stage;
public static const WIDTH:Number = 600;
public static const HEIGHT:Number = 400;
public static const PLAYING:String = "playing";
public static const FINISHED:String = "finished";
public static const OVER:String = "over";
private static var gameWorld:GameWorld;
private static var singleFlag:Boolean = true;
public function GameWorld():void{
if (GameWorld.singleFlag == true){
throw (new Error("GameWorld为单例类,不能用构造函数实例化."));
};
this.mc = new Sprite();
this.state = GameWorld.PLAYING;
this.mc.addEventListener(Event.ADDED, this.added);
if (Pause.getInstance().getState() == Pause.PAUSE){
Pause.getInstance().pauseControl();
};
this.score = 0;
GameWorld.singleFlag = true;
this.soundManager = SoundManager.getInstance();
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.init();
this.layout();
this.timeCount.setTime(12, 30);
this.timeCount.startCountTime();
this.mc.addEventListener(Event.REMOVED, removed);
};
}
private function goDelivery(_arg1:MouseEvent):void{
this.firstPop.visible = false;
Pause.getInstance().setState(Pause.RUN);
this.showPause();
}
public function showDeliverNum():void{
this.deliverMc.num.text = DeliverManager.getInstance().getNum().toString();
}
private function init():void{
this.light = new LightMc();
this.firstPop = new FirstPop();
this.map = Map.getInstance();
this.smallMap = SmallMap.getInstance();
this.person = Person.getInstance();
this.lifeNum = 10;
this.lifeNumMc = new LifeNumMc();
this.timeCount = TimeCount.getInstance();
this.pqsmm = new PQSMM();
this.submitFlag = false;
this.deliverMc = new DeliverMc();
this.endTimer = new Timer(2000, 1);
}
public function getSubmitFlag():Boolean{
return (this.submitFlag);
}
public function showEnd(_arg1:TimerEvent):void{
if (this.state == GameWorld.PLAYING){
this.person.gotoStartPoint();
this.lifeNum--;
this.lifeNumMc.lifeNum.text = (this.lifeNum + "");
Pause.getInstance().setState(Pause.RUN);
this.showPause();
} else {
this.person.playMc("stand");
this.end = new End();
if (this.getScore() == 0){
this.end.hideSubmit();
};
if (this.state == GameWorld.OVER){
this.end.showGameOver();
} else {
if (this.state == GameWorld.FINISHED){
this.end.showYouWin();
};
};
this.mc.addChild(this.end);
this.pqsmm.visible = false;
};
}
public function showPause():void{
this.pqsmm.showPause();
}
public function hideTimeCount():void{
this.timeCount.hide();
this.timeCount.pauseCountTime();
}
public function showDeliverMc():void{
this.deliverMc.visible = true;
}
private function layout():void{
this.map.addToStage(this.mc);
this.map.setPosition(0, 0);
this.person.addToStage(this.mc);
this.addLight();
this.smallMap.addToStage(this.mc);
this.mc.addChild(this.pqsmm);
this.timeCount.addToStage(this.mc);
this.mc.addChild(this.lifeNumMc);
this.lifeNumMc.x = 95;
this.lifeNumMc.y = 370;
this.lifeNumMc.lifeNum.text = (this.lifeNum + "");
this.pqsmm.x = GameWorld.WIDTH;
this.pqsmm.y = GameWorld.HEIGHT;
this.mc.addChild(this.deliverMc);
this.deliverMc.x = 250;
this.deliverMc.y = 5;
this.endTimer.addEventListener(TimerEvent.TIMER, showEnd);
this.mc.addChild(this.firstPop);
this.firstPop.go.addEventListener(MouseEvent.CLICK, goDelivery);
Pause.getInstance().setState(Pause.PAUSE);
this.hidePause();
}
public function submited():void{
this.submitFlag = true;
this.hideSubmit();
}
public function setStage(_arg1:Stage):void{
this.stage = _arg1;
}
public function getStage():Stage{
return (this.stage);
}
public function removeFromStage():void{
this.mc.parent.removeChild(this.mc);
}
public function lightPosition(_arg1:Number, _arg2:Number):void{
this.light.x = _arg1;
this.light.y = _arg2;
}
private function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.endTimer.removeEventListener(TimerEvent.TIMER, this.showEnd);
this.mc.removeEventListener(Event.REMOVED, this.removed);
trace("GameWorld实例被删除.");
};
}
public function gameOver():void{
this.state = GameWorld.OVER;
this.person.end(Person.LOSE);
TimeCount.getInstance().pauseCountTime();
this.endTimer.start();
}
public function addToStage(_arg1:Sprite):void{
_arg1.addChildAt(this.mc, 0);
}
public function gc():void{
this.person.gc();
this.soundManager.gc();
this.smallMap.gc();
this.map.gc();
this.timeCount.gc();
this.removeFromStage();
GameWorld.gameWorld = null;
}
public function hidePause():void{
this.pqsmm.hidePause();
}
public function losed():void{
if (this.lifeNum > 1){
this.endTimer.start();
} else {
this.lifeNum--;
this.lifeNumMc.lifeNum.text = (this.lifeNum + "");
this.gameOver();
};
}
public function addScore(_arg1:int):void{
var _local2:Score;
this.score = (this.score + _arg1);
_local2 = new Score(_arg1);
_local2.addToStage(this.mc);
_local2.setPosition(this.person.getPosition().x, this.person.getPosition().y);
}
public function finished():void{
this.state = GameWorld.FINISHED;
this.person.end(Person.FINISHED);
TimeCount.getInstance().pauseCountTime();
this.endTimer.start();
}
public function getState():String{
return (this.state);
}
public function getScore():int{
return (this.score);
}
public function addLight():void{
light.x = (this.map.getPosition().x + 1529.7);
light.y = (this.map.getPosition().y + 1815.1);
this.mc.addChild(light);
}
public function hideDeliverMc():void{
this.deliverMc.visible = false;
}
public function hideSubmit():void{
this.end.hideSubmit();
}
public function addChild(_arg1:MovieClip):void{
this.mc.addChild(_arg1);
}
public static function getInstance():GameWorld{
if (GameWorld.gameWorld == null){
GameWorld.singleFlag = false;
GameWorld.gameWorld = new (GameWorld);
};
return (GameWorld.gameWorld);
}
}
}//package main
Section 50
//Main (main.Main)
package main {
import flash.events.*;
import flash.display.*;
import sound.*;
import btn.*;
public class Main extends Sprite {
private var firstPlay:Boolean;
private var firstPage:FirstPage;
private var logo:Logo;
private var gameWorld:GameWorld;
private var bgMusic:MusicManager;
private var instrFrame:InstructionFrame;
private var creditsFrame:CreditsFrame;
public static const STAGEH:Number = 400;
public static const VERSION:String = "v 1.0";
public static const STAGEW:Number = 600;
public static const GAMENAME:String = "froglivery";
private static var game:Main;
private static var singleFlag:Boolean = true;
public function Main(){
if (Main.singleFlag == true){
throw (new Error("Main类为单例类,不能通过构造函数实例化."));
};
this.bgMusic = MusicManager.getInstance();
this.addEventListener(Event.ADDED, this.added);
this.firstPlay = true;
Main.singleFlag = true;
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.init();
this.layout();
this.addEventListener(Event.REMOVED, this.removed);
};
}
private function init():void{
this.logo = new Logo();
this.firstPage = new FirstPage();
}
public function setGameWorldStage():void{
this.gameWorld.setStage(this.stage);
}
private function layout():void{
this.bgMusic.play();
this.addChildAt(this.firstPage, 0);
this.addChild(this.logo);
this.logo.x = ((Main.STAGEW - this.logo.width) - 3);
this.logo.y = 3;
}
public function hideFirstPage():void{
this.firstPage.visible = false;
}
public function getFirstPlay():Boolean{
return (this.firstPlay);
}
private function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.removeEventListener(Event.REMOVED, this.removed);
trace("Main实例被删除.");
};
}
public function hideCreditsFrame():void{
this.removeChild(this.creditsFrame);
}
public function showCreditsFrame():void{
this.creditsFrame = new CreditsFrame();
this.addChildAt(creditsFrame, 0);
}
public function addGame():void{
this.gameWorld = GameWorld.getInstance();
this.setGameWorldStage();
this.gameWorld.addToStage(this);
this.setFirstPlay(false);
}
public function delGame():void{
if (this.gameWorld != null){
this.gameWorld.gc();
};
}
public function showInstructionFrame():void{
this.instrFrame = new InstructionFrame();
this.addChildAt(this.instrFrame, 0);
}
public function setFirstPlay(_arg1:Boolean):void{
this.firstPlay = _arg1;
}
public function hideInstructionFrame():void{
this.removeChild(this.instrFrame);
}
public function showFirstPage():void{
this.firstPage.visible = true;
}
public static function getInstance():Main{
if (Main.game == null){
Main.singleFlag = false;
Main.game = new (Main);
};
return (Main.game);
}
}
}//package main
Section 51
//TimeCount (main.TimeCount)
package main {
import flash.events.*;
import flash.display.*;
import btn.*;
import flash.utils.*;
public class TimeCount {
private var timer:Timer;
private var state:String;
private var minute:int;
private var timeCountMc:TimeCountMc;
private var second:int;
public static const PAUSE:String = "pause";
public static const RUN:String = "run";
private static var timeCount:TimeCount;
private static var singleFlag:Boolean = true;
public function TimeCount(){
if (TimeCount.singleFlag == true){
throw (new Error("TimeCount不能用构造函数实例化。"));
};
init();
TimeCount.singleFlag = true;
}
private function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
trace("TimeCount实例被删除!");
};
}
public function getScore():int{
return (((this.minute * 60) + this.second));
}
public function hide():void{
this.timeCountMc.visible = false;
}
public function pauseCountTime():void{
this.state = TimeCount.PAUSE;
this.timer.stop();
}
public function addToStage(_arg1:Sprite):void{
_arg1.addChild(this.timeCountMc);
this.timeCountMc.x = 0;
this.timeCountMc.y = (GameWorld.HEIGHT - this.timeCountMc.height);
this.timeCountMc.addEventListener(Event.REMOVED, removed);
}
public function gc():void{
this.timer.stop();
this.timer.removeEventListener(TimerEvent.TIMER, this.countTimeEvent);
this.timeCountMc.parent.removeChild(this.timeCountMc);
TimeCount.timeCount = null;
}
public function init():void{
this.timer = new Timer(1000);
this.timeCountMc = new TimeCountMc();
this.minute = 0;
this.second = 0;
this.state = TimeCount.RUN;
this.timer.addEventListener(TimerEvent.TIMER, countTimeEvent);
}
public function startCountTime():void{
this.state = TimeCount.RUN;
this.timer.start();
}
public function setTime(_arg1:int=0, _arg2:int=0){
this.minute = _arg1;
this.second = _arg2;
if (this.minute < 10){
this.timeCountMc.minute.text = ("0" + this.minute);
} else {
this.timeCountMc.minute.text = ("" + this.minute);
};
if (this.second < 10){
this.timeCountMc.second.text = ("0" + this.second);
} else {
this.timeCountMc.second.text = ("" + this.second);
};
}
public function getState():String{
return (this.state);
}
private function countTimeEvent(_arg1:TimerEvent):void{
if ((((Pause.getInstance().getState() == Pause.RUN)) && ((GameWorld.getInstance().getState() == GameWorld.PLAYING)))){
this.second = (this.second - 1);
if (this.second <= 0){
this.second = 0;
this.minute = (this.minute - 1);
if (this.minute < 0){
this.minute = 0;
GameWorld.getInstance().gameOver();
} else {
this.second = 60;
};
};
this.setTime(this.minute, this.second);
};
}
public static function getInstance():TimeCount{
if (TimeCount.timeCount == null){
TimeCount.singleFlag = false;
TimeCount.timeCount = new (TimeCount);
};
return (TimeCount.timeCount);
}
}
}//package main
Section 52
//DeliverManager (map.DeliverManager)
package map {
import main.*;
import house.*;
import role.*;
public class DeliverManager {
private var maxNum:int;
private var num:int;
private var nFlag:int;
private var currentNum:int;
private var flags:Array;
private var house:House;
private var worldMap:Map;
private var delivers:Array;
private var socre:Number;
private static var deliverManager:DeliverManager;
public function DeliverManager(){
trace("DeliverManager为单例类.");
this.init();
}
private function init():void{
var _local1:int;
this.worldMap = Map.getInstance();
this.maxNum = 10;
this.currentNum = 0;
this.socre = 100;
this.delivers = this.worldMap.gethouses();
this.num = this.delivers.length;
this.flags = new Array();
_local1 = 0;
while (_local1 < this.num) {
this.flags[_local1] = false;
_local1++;
};
}
public function makeDeliver():void{
var _local1:int;
if (this.currentNum < this.maxNum){
GameWorld.getInstance().showDeliverNum();
_local1 = int((Math.random() * this.num));
while ((((((this.flags[_local1] == true)) || ((Person.getInstance().getHouseIndex() == _local1)))) || ((FireManager.getInstance().getN() == _local1)))) {
_local1 = ((_local1 + 1) % this.num);
};
this.currentNum = (this.currentNum + 1);
this.flags[_local1] = true;
this.nFlag = _local1;
this.house = this.delivers[_local1];
this.house.showSmallMapDeliver();
this.house.gotoAndStop(2);
} else {
trace("Finish!");
GameWorld.getInstance().finished();
};
}
public function getNum():int{
return ((this.maxNum - this.currentNum));
}
public function getScore():Number{
return (this.socre);
}
public function gc():void{
DeliverManager.deliverManager = null;
trace("DeliverManager实例被删除.");
}
public function getHouse():House{
return (this.house);
}
public function finished():Boolean{
if (this.currentNum >= this.maxNum){
GameWorld.getInstance().finished();
return (true);
};
return (false);
}
public function getN():int{
return (this.nFlag);
}
public static function getInstance():DeliverManager{
if (DeliverManager.deliverManager == null){
DeliverManager.deliverManager = new (DeliverManager);
};
return (DeliverManager.deliverManager);
}
}
}//package map
Section 53
//FireManager (map.FireManager)
package map {
import flash.events.*;
import main.*;
import role.*;
import btn.*;
import flash.utils.*;
public class FireManager {
private var showTimer:Timer;
private var nFlag:int;
private var fireMc:FireMc;
private var houses:Array;
private static var singleFlag:Boolean = true;
private static var fireManager:FireManager;
public function FireManager(){
if (FireManager.singleFlag == true){
throw (new Error("FireManager类不能用构造函数实例化。"));
};
FireManager.singleFlag = true;
this.houses = Map.getInstance().gethouses();
this.showTimer = new Timer((10 * 1000));
this.fireMc = new FireMc();
this.fireMc.addEventListener(Event.ENTER_FRAME, hitTestPerson);
this.showTimer.addEventListener(TimerEvent.TIMER, makeFire);
this.showTimer.start();
this.addFireToMap();
}
public function makeFire(_arg1:TimerEvent):void{
if ((((Pause.getInstance().getState() == Pause.RUN)) && ((GameWorld.getInstance().getState() == GameWorld.PLAYING)))){
this.addFireToMap();
};
}
private function addFireToMap():void{
var _local1:int;
_local1 = int((Math.random() * this.houses.length));
while ((((Person.getInstance().getHouseIndex() == _local1)) || ((DeliverManager.getInstance().getN() == _local1)))) {
_local1 = ((_local1 + 1) % this.houses.length);
};
this.houses[_local1].addChild(this.fireMc);
this.nFlag = _local1;
this.fireMc.y = 30;
}
public function hitTestPerson(_arg1:Event):void{
if ((((((Pause.getInstance().getState() == Pause.RUN)) && ((GameWorld.getInstance().getState() == GameWorld.PLAYING)))) && ((Person.getInstance().getState() == Person.RUNNING)))){
if (this.fireMc.hitTestObject(Person.getInstance().getHitArea())){
Person.getInstance().died();
Person.getInstance().playMc("fireDeath");
};
};
}
public function gc():void{
FireManager.fireManager = null;
this.showTimer.removeEventListener(TimerEvent.TIMER, this.makeFire);
this.fireMc.removeEventListener(Event.ENTER_FRAME, hitTestPerson);
}
public function getN():int{
return (this.nFlag);
}
public static function getInstance():FireManager{
if (FireManager.fireManager == null){
FireManager.singleFlag = false;
FireManager.fireManager = new (FireManager);
};
return (FireManager.fireManager);
}
}
}//package map
Section 54
//JobManager (map.JobManager)
package map {
import flash.events.*;
import flash.display.*;
import main.*;
import role.*;
import btn.*;
import flash.utils.*;
public class JobManager {
private var currentJob:NewJob;
private var houseCountMc:HouseCountMc;
private var state:String;
private var score:int;
private var newJobs:Array;
private var jobTimer:Timer;
private var jobsFlag:Array;
private var jobMc:MovieClip;
public static const START:String = "start";
public static const END:String = "end";
private static var jobManager:JobManager;
private static var singleFlag:Boolean = true;
public function JobManager(){
if (JobManager.singleFlag == true){
throw (new Error("JobManager不能用构造函数实例化。"));
};
JobManager.singleFlag = true;
this.init();
}
public function getTimerMc():MovieClip{
return (this.currentJob.getJobTimer());
}
public function clear():void{
var _local1:int;
_local1 = 0;
while (_local1 < this.jobsFlag.length) {
this.jobsFlag[_local1] = false;
_local1++;
};
}
public function getMc():MovieClip{
return (this.jobMc);
}
public function hideJobMc(_arg1:TimerEvent):void{
this.jobMc.visible = false;
if (Person.getInstance().getState() == Person.FALLING){
Person.getInstance().gotoStartPoint();
};
this.jobTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, this.hideJobMc);
}
private function goEvent(_arg1:MouseEvent):void{
if (this.jobMc.currentLabel == "complete"){
this.jobMc.gotoAndStop("info");
this.jobMc.info.visible = true;
} else {
if (this.jobMc.currentLabel == "info"){
Pause.getInstance().setState(Pause.RUN);
this.jobMc.info.visible = false;
this.jobTimer.reset();
this.jobTimer.start();
this.jobMc.message.gotoAndPlay((this.jobMc.message.currentFrame + 1));
this.jobMc.go.visible = false;
this.jobTimer.addEventListener(TimerEvent.TIMER_COMPLETE, hideJobMc);
this.houseCountMc.visible = true;
GameWorld.getInstance().hideDeliverMc();
GameWorld.getInstance().addChild(this.getTimerMc());
this.currentJob.start();
} else {
if ((((this.jobMc.currentLabel == "success")) || ((this.jobMc.currentLabel == "fail")))){
this.jobMc.gotoAndStop("next");
this.jobMc.info.visible = false;
} else {
if (this.jobMc.currentLabel == "next"){
Pause.getInstance().setState(Pause.RUN);
GameWorld.getInstance().showPause();
this.jobMc.visible = false;
this.currentJob.hide();
TimeCount.getInstance().startCountTime();
DeliverManager.getInstance().makeDeliver();
this.jobMc.alpha = 0.1;
this.jobTimer.reset();
this.jobTimer.start();
this.jobMc.message.gotoAndPlay((this.jobMc.message.currentFrame + 1));
this.jobMc.go.visible = false;
this.jobTimer.addEventListener(TimerEvent.TIMER_COMPLETE, hideJobMc);
};
};
};
};
}
public function getState():String{
return (this.state);
}
public function gc():void{
this.jobTimer.removeEventListener(TimerEvent.TIMER, this.playMc);
JobManager.jobManager = null;
}
public function setState(_arg1:String):void{
this.state = _arg1;
}
private function init():void{
var _local1:int;
(this.state == JobManager.END);
this.score = 0;
this.houseCountMc = new HouseCountMc();
this.houseCountMc.x = 250;
this.houseCountMc.y = 5;
this.houseCountMc.visible = false;
this.houseCountMc.houseNum.text = "0";
this.jobTimer = new Timer(100, 10);
this.jobTimer.addEventListener(TimerEvent.TIMER, playMc);
this.newJobs = new Array();
this.jobsFlag = new Array();
this.newJobs[0] = new NewJob();
this.newJobs[0].setJob(NewJob.FIRST);
this.newJobs[0].setTime(0, 30);
this.newJobs[1] = new NewJob();
this.newJobs[1].setJob(NewJob.SECOND);
this.newJobs[1].setTime(0, 30);
this.newJobs[2] = new NewJob();
this.newJobs[2].setJob(NewJob.FIRST);
this.newJobs[2].setTime(0, 20);
this.newJobs[3] = new NewJob();
this.newJobs[3].setJob(NewJob.SECOND);
this.newJobs[3].setTime(0, 25);
this.newJobs[4] = new NewJob();
this.newJobs[4].setJob(NewJob.FIRST);
this.newJobs[4].setTime(0, 25);
this.newJobs[5] = new NewJob();
this.newJobs[5].setJob(NewJob.FIRST);
this.newJobs[5].setTime(0, 15);
this.newJobs[6] = new NewJob();
this.newJobs[6].setJob(NewJob.SECOND);
this.newJobs[6].setTime(0, 20);
this.newJobs[7] = new NewJob();
this.newJobs[7].setJob(NewJob.SECOND);
this.newJobs[7].setTime(0, 15);
this.newJobs[8] = new NewJob();
this.newJobs[8].setJob(NewJob.FIRST);
this.newJobs[8].setTime(0, 10);
this.newJobs[9] = new NewJob();
this.newJobs[9].setJob(NewJob.SECOND);
this.newJobs[9].setTime(0, 22);
this.newJobs[10] = new NewJob();
this.newJobs[10].setJob(NewJob.FIRST);
this.newJobs[10].setTime(0, 12);
_local1 = 0;
while (_local1 < this.newJobs.length) {
this.jobsFlag[_local1] = false;
_local1++;
};
this.jobMc = new JobMc();
this.jobMc.go.visible = false;
this.jobMc.info.visible = false;
this.jobMc.gotoAndStop("complete");
this.jobMc.x = (GameWorld.WIDTH / 2);
this.jobMc.y = (GameWorld.HEIGHT / 2);
this.jobMc.go.addEventListener(MouseEvent.CLICK, goEvent);
}
public function createJob():void{
var temp:int;
var errorBox:ErrorBox;
try {
Pause.getInstance().setState(Pause.PAUSE);
temp = int((Math.random() * this.newJobs.length));
while (this.jobsFlag[temp] == true) {
temp = ((temp + 1) % this.newJobs.length);
};
this.currentJob = this.newJobs[temp];
trace(temp, this.jobsFlag[temp]);
this.jobsFlag[temp] = true;
this.jobMc.info.text = ((this.currentJob.getJobInfo() + this.currentJob.getTime()) + " seconds.");
this.jobMc.visible = true;
this.jobMc.alpha = 0.1;
this.jobTimer.reset();
this.jobTimer.start();
this.jobMc.message.gotoAndPlay(2);
this.jobMc.info.visible = false;
this.state = JobManager.START;
TimeCount.getInstance().pauseCountTime();
this.jobMc.gotoAndStop("complete");
this.jobMc.go.visible = true;
GameWorld.getInstance().addChild(this.getMc());
GameWorld.getInstance().addChild(this.houseCountMc);
this.houseCountMc.houseNum.text = (this.currentJob.getHouseCount() + "");
} catch(error) {
errorBox = new ErrorBox();
errorBox.info.text = error.message;
GameWorld.getInstance().addChild(errorBox);
};
}
public function playMc(_arg1:TimerEvent):void{
this.jobMc.alpha = (this.jobMc.alpha + 0.1);
}
public function setCurrentJobState(_arg1:Boolean):void{
if (this.currentJob.getJobInfo() == NewJob.SECOND){
this.currentJob.setState(_arg1);
};
}
public function addCount(_arg1):void{
this.currentJob.countHouse(_arg1);
this.houseCountMc.houseNum.text = (this.currentJob.getHouseCount() + "");
}
public function finished():void{
this.jobMc.alpha = 0.1;
this.jobTimer.reset();
this.jobTimer.start();
this.jobMc.message.gotoAndPlay(2);
Pause.getInstance().setState(Pause.PAUSE);
this.state = JobManager.END;
this.jobMc.visible = true;
this.jobMc.info.visible = true;
this.jobMc.go.visible = true;
this.houseCountMc.visible = false;
GameWorld.getInstance().showDeliverMc();
this.currentJob.stop();
this.currentJob.finish();
if (this.currentJob.getJobInfo() == NewJob.FIRST){
if (this.currentJob.getState() == true){
this.jobMc.gotoAndStop("success");
this.jobMc.info.text = (("You get " + this.currentJob.getScore()) + " bonus points!");
} else {
if (this.currentJob.getState() == false){
this.jobMc.gotoAndStop("success");
this.jobMc.info.text = (("You get " + this.currentJob.getScore()) + " bonus points!");
};
};
this.score = (this.score + this.currentJob.getScore());
} else {
if (this.currentJob.getJobInfo() == NewJob.SECOND){
if (this.currentJob.getState() == true){
this.jobMc.gotoAndStop("success");
this.jobMc.info.text = (("You get " + this.currentJob.getScore()) + " bonus points!");
this.score = (this.score + this.currentJob.getScore());
} else {
if (this.currentJob.getState() == false){
this.jobMc.gotoAndStop("fail");
this.jobMc.info.text = "No bonus points!";
this.score = (this.score + 0);
};
};
};
};
GameWorld.getInstance().addScore(this.score);
this.score = 0;
}
public function getCurrentJobState():Boolean{
return (this.currentJob.getState());
}
public static function getInstance():JobManager{
if (JobManager.jobManager == null){
JobManager.singleFlag = false;
JobManager.jobManager = new (JobManager);
};
return (JobManager.jobManager);
}
}
}//package map
Section 55
//JobTimer (map.JobTimer)
package map {
import flash.events.*;
import flash.display.*;
import main.*;
import btn.*;
import flash.utils.*;
public class JobTimer {
private var timer:Timer;
private var state:String;
private var minute:int;
private var second:int;
private var timeCountMc:TimeCountMc;
public static const RUN:String = "run";
public static const PAUSE:String = "pause";
public function JobTimer(){
this.init();
}
public function getMc():MovieClip{
return (this.timeCountMc);
}
public function init():void{
this.timer = new Timer(1000);
this.timeCountMc = new TimeCountMc();
this.timeCountMc.x = 0;
this.timeCountMc.y = (GameWorld.HEIGHT - this.timeCountMc.height);
this.minute = 0;
this.second = 0;
this.state = JobTimer.RUN;
this.timer.addEventListener(TimerEvent.TIMER, countTimeEvent);
this.timeCountMc.addEventListener(Event.REMOVED_FROM_STAGE, removed);
}
public function setTime(_arg1:int=0, _arg2:int=0){
this.minute = _arg1;
this.second = _arg2;
if (this.minute < 10){
this.timeCountMc.minute.text = ("0" + this.minute);
} else {
this.timeCountMc.minute.text = ("" + this.minute);
};
if (this.second < 10){
this.timeCountMc.second.text = ("0" + this.second);
} else {
this.timeCountMc.second.text = ("" + this.second);
};
}
public function getState():String{
return (this.state);
}
public function getScore():int{
return (((this.minute * 60) + this.second));
}
private function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.gc();
};
}
public function gc():void{
this.timer.stop();
this.timer.removeEventListener(TimerEvent.TIMER, this.countTimeEvent);
}
public function pauseCountTime():void{
this.state = JobTimer.PAUSE;
this.timer.stop();
}
public function addToStage(_arg1:Sprite):void{
_arg1.addChild(this.timeCountMc);
}
public function getM():int{
return (this.minute);
}
public function startCountTime():void{
this.state = JobTimer.RUN;
this.timer.start();
}
public function getS():int{
return (this.second);
}
private function countTimeEvent(_arg1:TimerEvent):void{
if ((((Pause.getInstance().getState() == Pause.RUN)) && ((GameWorld.getInstance().getState() == GameWorld.PLAYING)))){
this.second = (this.second - 1);
if (this.second <= 0){
this.second = 0;
this.minute = (this.minute - 1);
if (this.minute < 0){
this.minute = 0;
JobManager.getInstance().finished();
JobManager.getInstance().setCurrentJobState(false);
this.timer.stop();
this.timer.removeEventListener(TimerEvent.TIMER, this.countTimeEvent);
} else {
this.second = 60;
};
};
this.setTime(this.minute, this.second);
};
}
public function hideMc():void{
this.timeCountMc.visible = false;
}
}
}//package map
Section 56
//Map (map.Map)
package map {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import main.*;
import sound.*;
import house.*;
import role.*;
import cars.*;
public class Map {
private var houseNum:int;
private var mapMc:MapMc;
private var houses:Array;
private var smallMap:SmallMap;
private var mc:Sprite;
private var person:Person;
private var cars:Array;
private var tManager:ThiefManager;
private var npc:Array;
private var position:Point;
private var addFlags:Array;
private var carManager:CarManager;
public static const MapHeight:int = 3200;
public static const MapWidth:int = 3400;
private static var world:Map;
public function Map(){
trace("Map类为单例类.");
this.mc = new Sprite();
this.mc.addEventListener(Event.ADDED, this.added);
}
public function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.init();
this.layout();
this.mc.addEventListener(Event.REMOVED, this.removed);
};
}
public function getHitPersonMc():House{
var hitMc:House;
var tempN:int;
var n:int;
var errorBox:ErrorBox;
hitMc = null;
try {
n = 0;
while (n < this.npc.length) {
if (this.npc[n].getHitTestArea().hitTestPoint(this.person.getPosition().x, this.person.getPosition().y, true)){
hitMc = this.npc[n];
tempN = n;
this.person.setHouseIndex(n);
};
n = (n + 1);
};
if ((((((hitMc == DeliverManager.getInstance().getHouse())) && (!((hitMc == null))))) && ((this.person.getState() == Person.RUNNING)))){
if (this.addFlags[tempN] == false){
GameWorld.getInstance().showDeliverNum();
DeliverManager.getInstance().getHouse().gotoAndStop(1);
DeliverManager.getInstance().getHouse().hideSmallMapDeliver();
GameWorld.getInstance().addScore(DeliverManager.getInstance().getScore());
SoundManager.getInstance().play(SoundManager.EAT);
this.addFlags[tempN] = true;
if (DeliverManager.getInstance().finished() == false){
JobManager.getInstance().createJob();
};
};
};
} catch(error:Error) {
errorBox = new ErrorBox();
errorBox.info.text = error.message;
GameWorld.getInstance().addChild(errorBox);
};
return (hitMc);
}
public function run(_arg1:Point):void{
this.setPosition((this.getPosition().x + _arg1.x), (this.getPosition().y + _arg1.y));
}
public function init():void{
var _local1:int;
this.smallMap = SmallMap.getInstance();
this.cars = new Array();
this.carManager = CarManager.getInstance();
this.person = Person.getInstance();
this.mapMc = new MapMc();
this.position = new Point(0, 0);
this.houses = new Array();
this.npc = new Array();
this.addFlags = new Array();
_local1 = 0;
while (_local1 < this.mapMc.numChildren) {
if ((this.mapMc.getChildAt(_local1) is House)){
this.addFlags.push(false);
this.houses.push(this.mapMc.getChildAt(_local1));
this.houses[(this.houses.length - 1)].gotoAndStop(1);
this.npc.push(this.houses[(this.houses.length - 1)]);
};
_local1++;
};
this.houseNum = this.houses.length;
this.tManager = ThiefManager.getInstance();
}
public function getHitNotPassArea(_arg1:Number, _arg2:Number):Boolean{
var _local3:int;
_local3 = 0;
while (_local3 < this.npc.length) {
if (this.npc[_local3].getNotPassArea() != null){
if (this.npc[_local3].getNotPassArea().hitTestPoint(_arg1, _arg2, true) == true){
return (true);
};
};
_local3++;
};
return (false);
}
public function layout():void{
var _local1:int;
this.mc.addChild(this.mapMc);
_local1 = 0;
while (_local1 < this.carManager.getNum()) {
this.cars[_local1] = this.carManager.getCarIndex(_local1);
this.cars[_local1].addToStage(this.mc);
this.cars[_local1].startMove();
this.npc.push(this.cars[_local1]);
_local1++;
};
}
public function getHeight():Number{
return (this.mc.height);
}
public function addToStage(_arg1:Sprite):void{
_arg1.addChild(this.mc);
}
public function gc():void{
this.carManager.gc();
this.tManager.gc();
this.mc.parent.removeChild(this.mc);
Map.world = null;
}
public function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.mc.removeEventListener(Event.REMOVED, this.removed);
trace("Map实例被删除.");
};
}
public function getWidth():Number{
return (this.mc.width);
}
public function setPosition(_arg1:Number, _arg2:Number):void{
this.position.x = _arg1;
this.position.y = _arg2;
if (_arg1 > 0){
this.position.x = 0;
};
if ((_arg1 + this.getWidth()) < GameWorld.WIDTH){
this.position.x = (GameWorld.WIDTH - this.getWidth());
};
if (_arg2 > 0){
this.position.y = 0;
};
if ((_arg2 + this.getHeight()) < GameWorld.HEIGHT){
this.position.y = (GameWorld.HEIGHT - this.getHeight());
};
this.mc.x = this.position.x;
this.mc.y = this.position.y;
GameWorld.getInstance().lightPosition((this.position.x + 1529.7), (this.position.y + 1815.1));
this.smallMap.setXY((this.position.x * SmallMap.scale), (this.position.y * SmallMap.scale));
}
public function getPosition():Point{
this.position = new Point(this.mc.x, this.mc.y);
return (this.position);
}
public function gethouses():Array{
return (this.houses);
}
public function getHouseNum():int{
return (this.houseNum);
}
public static function getInstance():Map{
if (Map.world == null){
Map.world = new (Map);
};
return (Map.world);
}
}
}//package map
Section 57
//NewJob (map.NewJob)
package map {
import flash.display.*;
public class NewJob {
private var num:int;
private var jobTimer:JobTimer;
private var count:int;
private var state:Boolean;
private var score:int;
private var houses:Array;
private var job:String;
public static const FIRST:String = "Jump on as many buildings as you can in ";
public static const SECOND:String = "Jump on at least 10 buildings in ";
public function NewJob(){
this.init();
}
public function stop():void{
this.jobTimer.pauseCountTime();
}
public function getTime():int{
return (this.jobTimer.getS());
}
public function setNum(_arg1:int):void{
this.num = _arg1;
}
public function getHouseCount():int{
return (this.count);
}
public function hide():void{
this.jobTimer.hideMc();
}
public function getJobInfo():String{
return (this.job);
}
private function init():void{
var _local1:int;
this.jobTimer = new JobTimer();
this.num = 0;
this.count = 0;
this.score = 0;
this.state = false;
this.houses = new Array();
_local1 = 0;
while (_local1 < Map.getInstance().getHouseNum()) {
this.houses[_local1] = false;
_local1++;
};
}
public function countHouse(_arg1:int):void{
if (this.houses[_arg1] == false){
this.count++;
this.houses[_arg1] = true;
Map.getInstance().gethouses()[_arg1].gotoAndStop(3);
if (this.count >= this.num){
this.state = true;
};
};
}
public function finish():void{
var _local1:int;
_local1 = 0;
while (_local1 < this.houses.length) {
if (this.houses[_local1] == true){
Map.getInstance().gethouses()[_local1].gotoAndStop(1);
};
_local1++;
};
this.score = (this.count * 10);
}
public function getState():Boolean{
return (this.state);
}
public function getScore():int{
return (this.score);
}
public function setTime(_arg1:int, _arg2:int):void{
this.jobTimer.setTime(_arg1, _arg2);
}
public function setScore(_arg1:int):void{
this.score = _arg1;
}
public function setState(_arg1:Boolean):void{
this.state = _arg1;
}
public function start():void{
this.jobTimer.startCountTime();
}
public function setJob(_arg1:String):void{
this.job = _arg1;
}
public function getJobTimer():MovieClip{
return (this.jobTimer.getMc());
}
}
}//package map
Section 58
//SmallMap (map.SmallMap)
package map {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import role.*;
import flash.utils.*;
public class SmallMap {
private var mapBg:SMapBg;
private var smallMapMc:Sprite;
private var world:Map;
private var person:Person;
private var mc:Sprite;
private var sPersonMc:SPersonMc;
private var speed:Point;
private var mapMask:SMapMask;
private var position:Point;
private var updateTimer:Timer;
public static const SMALLMAPWIDTH:Number = 150;
public static const scale:Number = 0.2;
public static const SMALLMAPHEIGHT:Number = 100;
private static var smallMap:SmallMap;
public function SmallMap(){
trace("SmallMap类为单例类.");
this.mc = new Sprite();
this.smallMapMc = new Sprite();
this.mc.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.init();
this.mc.addChildAt(this.smallMapMc, 0);
this.mc.addChildAt(this.mapBg, 0);
this.mc.addChild(this.sPersonMc);
this.sPersonMc.x = (this.person.getPosition().x * SmallMap.scale);
this.sPersonMc.y = (this.person.getPosition().y * SmallMap.scale);
this.smallMapMc.alpha = 0.8;
this.mc.addChildAt(this.mapMask, 1);
this.mapMask.x = 11;
this.mapMask.y = 8;
this.smallMapMc.mask = this.mapMask;
this.mc.addEventListener(Event.REMOVED, removed);
this.updateTimer.addEventListener(TimerEvent.TIMER, updateEvent);
this.updateTimer.start();
};
}
public function setSpeed(_arg1:Point):void{
this.speed.x = (_arg1.x * SmallMap.scale);
this.speed.y = (_arg1.y * SmallMap.scale);
}
public function updateEvent(_arg1:TimerEvent):void{
}
private function init():void{
this.world = Map.getInstance();
this.person = Person.getInstance();
this.speed = new Point(0, 0);
this.mapMask = new SMapMask();
this.mapBg = new SMapBg();
this.sPersonMc = this.person.getSPersonMc();
this.position = new Point();
this.setPosition(0, 0);
this.updateTimer = new Timer(30);
}
public function setPersonXY(_arg1:Number, _arg2:Number):void{
this.sPersonMc.x = (_arg1 * SmallMap.scale);
this.sPersonMc.y = (_arg1 * SmallMap.scale);
}
public function run():void{
this.setXY((this.getXY().x + this.speed.x), (this.getXY().y + this.speed.y));
}
public function gc():void{
this.mc.parent.removeChild(this.mc);
SmallMap.smallMap = null;
}
private function removed(_arg1:Event):void{
if (_arg1.currentTarget == _arg1.target){
this.mc.removeEventListener(Event.REMOVED, this.removed);
trace("SmallMap实例被删除.");
};
}
public function addToStage(_arg1:Sprite):void{
_arg1.addChild(this.mc);
}
public function setXY(_arg1:Number, _arg2:Number):void{
this.smallMapMc.x = _arg1;
this.smallMapMc.y = _arg2;
}
public function getPosition():Point{
this.position = new Point(this.mc.x, this.mc.y);
return (this.position);
}
public function setPosition(_arg1:Number, _arg2:Number):void{
this.position.x = _arg1;
this.position.y = _arg2;
this.mc.x = this.position.x;
this.mc.y = this.position.y;
}
public function getPersonX():Number{
return (this.sPersonMc.x);
}
public function getPersonY():Number{
return (this.sPersonMc.y);
}
public function getXY():Point{
return (new Point(this.smallMapMc.x, this.smallMapMc.y));
}
public function getWidth():Number{
return (this.mc.width);
}
public function getHeight():Number{
return (this.mc.height);
}
public function personRun():void{
this.sPersonMc.x = (this.sPersonMc.x + this.speed.x);
this.sPersonMc.y = (this.sPersonMc.y + this.speed.y);
if (this.sPersonMc.x < 0){
this.sPersonMc.x = (this.sPersonMc.width / 2);
};
if (this.sPersonMc.x > SmallMap.SMALLMAPWIDTH){
this.sPersonMc.x = (SmallMap.SMALLMAPWIDTH - (this.sPersonMc.width / 2));
};
if (this.sPersonMc.y < 0){
this.sPersonMc.y = (this.sPersonMc.width / 2);
};
if (this.sPersonMc.y > SmallMap.SMALLMAPHEIGHT){
this.sPersonMc.y = (SmallMap.SMALLMAPHEIGHT - (this.sPersonMc.width / 2));
};
}
public function setDeliveryDir(_arg1:Number):void{
this.sPersonMc.rotation = _arg1;
}
public function addChild(_arg1:MovieClip):void{
this.smallMapMc.addChild(_arg1);
_arg1.width = (_arg1.width * SmallMap.scale);
_arg1.height = (_arg1.height * SmallMap.scale);
_arg1.x = (_arg1.x * SmallMap.scale);
_arg1.y = (_arg1.y * SmallMap.scale);
}
public function setPXY(_arg1:Number, _arg2:Number):void{
this.sPersonMc.x = _arg1;
this.sPersonMc.y = _arg2;
}
public static function getInstance():SmallMap{
if (SmallMap.smallMap == null){
SmallMap.smallMap = new (SmallMap);
};
return (SmallMap.smallMap);
}
}
}//package map
Section 59
//Thief (map.Thief)
package map {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import main.*;
import house.*;
import role.*;
import btn.*;
import flash.utils.*;
public class Thief {
private var thiefMc:ThiefMc;
private var dir:Point;
private var speed:Point;
private var person:Person;
private var mc:Sprite;
private var score:Number;
private var house:House;
private var position:Point;
private var s:Number;
private var moveTimer:Timer;
private var distance:Number;
public function Thief(){
this.person = Person.getInstance();
this.mc = new Sprite();
this.mc.addEventListener(Event.ADDED, added);
}
public function addToStage(_arg1:Sprite):void{
_arg1.addChild(this.mc);
}
public function moveEvent(_arg1:TimerEvent):void{
if ((((Pause.getInstance().getState() == Pause.RUN)) && ((GameWorld.getInstance().getState() == GameWorld.PLAYING)))){
this.moving();
};
}
private function init():void{
this.thiefMc = new ThiefMc();
this.distance = 100;
this.dir = new Point(1, 0);
this.s = 0;
this.speed = new Point(3, 0);
this.position = new Point();
this.score = 50;
}
public function hitTestPerson(_arg1:Event):void{
if (((this.thiefMc.area.hitTestObject(this.person.getHitArea())) && ((this.person.getState() == Person.RUNNING)))){
GameWorld.getInstance().addScore(this.score);
ThiefManager.getInstance().makeThief();
this.mc.parent.removeChild(this.mc);
};
}
public function getPosition():Point{
this.position.x = this.mc.x;
this.position.y = this.mc.y;
return (this.position);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.init();
this.layout();
this.mc.addEventListener(Event.ENTER_FRAME, hitTestPerson);
this.mc.addEventListener(Event.REMOVED, removed);
};
}
private function removed(_arg1:Event):void{
if (_arg1.currentTarget == _arg1.target){
this.mc.removeEventListener(Event.ENTER_FRAME, hitTestPerson);
this.mc.removeEventListener(Event.REMOVED, this.removed);
trace("Thief实例被删除.");
};
}
public function setPosition(_arg1:Number, _arg2:Number):void{
this.position.x = _arg1;
this.position.y = _arg2;
this.mc.x = this.position.x;
this.mc.y = this.position.y;
}
private function moving():void{
if (Math.random() < 0.2){
if (this.s < this.distance){
this.setPosition((this.getPosition().x + (this.speed.x * this.dir.x)), this.getPosition().y);
this.s = (this.s + this.speed.x);
if (this.dir.x == 1){
this.thiefMc.rotation = 0;
} else {
this.thiefMc.rotation = 180;
};
} else {
this.s = 0;
this.dir.x = (this.dir.x * -1);
};
};
}
private function layout():void{
this.mc.addChild(this.thiefMc);
}
}
}//package map
Section 60
//ThiefManager (map.ThiefManager)
package map {
import house.*;
import role.*;
import flash.utils.*;
public class ThiefManager {
private var num:int;
private var showTimer:Timer;
private var worldMap:Map;
private var currentNum:int;
private var houseFlags:Array;
private static var tManager:ThiefManager;
public function ThiefManager(){
trace("ThiefManager为单例类.");
this.init();
}
public function makeThief():void{
var _local1:int;
var _local2:Thief;
var _local3:House;
if (this.currentNum < this.worldMap.getHouseNum()){
this.currentNum++;
_local1 = int((Math.random() * this.worldMap.getHouseNum()));
while ((((((Person.getInstance().getHouseIndex() == _local1)) || (!((this.worldMap.gethouses()[_local1].getNotPassArea() == null))))) || ((this.houseFlags[_local1] == true)))) {
_local1 = ((_local1 + 1) % this.worldMap.getHouseNum());
};
_local2 = new Thief();
_local3 = this.worldMap.gethouses()[_local1];
this.houseFlags[_local1] = true;
_local2.addToStage(_local3);
_local2.setPosition(70, 40);
};
}
public function init():void{
var _local1:int;
this.worldMap = Map.getInstance();
this.num = 7;
this.currentNum = 0;
this.houseFlags = new Array();
_local1 = 0;
while (_local1 < this.worldMap.getHouseNum()) {
this.houseFlags[_local1] = false;
_local1++;
};
}
public function initMakeThief():void{
while (this.currentNum < this.num) {
this.makeThief();
};
}
public function gc():void{
ThiefManager.tManager = null;
trace("ThiefManager实例被删除.");
}
public static function getInstance():ThiefManager{
if (ThiefManager.tManager == null){
ThiefManager.tManager = new (ThiefManager);
};
return (ThiefManager.tManager);
}
}
}//package map
Section 61
//Person (role.Person)
package role {
import map.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import main.*;
import sound.*;
import house.*;
import cars.*;
import btn.*;
import flash.utils.*;
import flash.ui.*;
public class Person {
private var jumpCountFlag:Boolean;
private var houseSpeed:Point;
private var state:String;
private var houseIndex:int;
private var goal:Goal;
private var dir:Point;
private var mc:Sprite;
private var house:House;
private var position:Point;
private var dManager:DeliverManager;
private var jumpSpeed:Point;
private var jumpFlag:Boolean;
private var maxSpeed:Point;
private var speed:Point;
private var jumpDistance:Number;
private var personMc:PersonMc;
private var jumpStart:Point;
private var smallMap:SmallMap;
private var map:Map;
private var sPersonMc:SPersonMc;
private var keyChar:uint;
private var aSpeed:Number;
private var g:Number;
private var fManager:FireManager;
private var moveTimer:Timer;
public static const FALLING:String = "falling";
public static const FLYING:String = "flying";
public static const FINISHED:String = "finished";
public static const LOSE:String = "lose";
public static const RUNNING:String = "running";
private static var person:Person;
public function Person(){
trace("Person类为单例类.");
this.mc = new Sprite();
this.mc.addEventListener(Event.ADDED, added);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.init();
this.layout();
this.control();
this.mc.addEventListener(Event.ENTER_FRAME, moveEvent);
this.mc.addEventListener(Event.REMOVED, removed);
};
}
public function fall():void{
if (this.house != null){
} else {
this.died();
};
}
public function getHouseIndex():int{
return (this.houseIndex);
}
public function getHitArea():Sprite{
return (this.personMc);
}
public function playMc(_arg1:String):void{
this.personMc.removeChildAt(0);
if (this.personMc.contains(this.personMc[(_arg1 + "Mc")]) == false){
this.personMc.addChild(this.personMc[(_arg1 + "Mc")]);
if (_arg1 == "jump"){
this.personMc[(_arg1 + "Mc")].gotoAndPlay(1);
} else {
if (_arg1 == "death"){
this.personMc[(_arg1 + "Mc")].mc.gotoAndPlay(2);
};
};
};
}
private function init():void{
this.map = Map.getInstance();
this.smallMap = SmallMap.getInstance();
this.personMc = new PersonMc();
this.sPersonMc = new SPersonMc();
this.position = new Point(this.mc.x, this.mc.y);
this.moveTimer = new Timer(30);
this.aSpeed = 0.3;
this.houseSpeed = new Point(0, 0);
this.speed = new Point(0, 0);
this.maxSpeed = new Point(7, 7);
this.g = 0.1;
this.dir = new Point(1, 0);
this.jumpSpeed = new Point(6, 6);
this.jumpFlag = true;
this.jumpCountFlag = false;
this.state = Person.RUNNING;
this.keyChar = 0;
this.jumpDistance = 90;
this.jumpStart = new Point(0, 0);
this.goal = new Goal();
}
public function setRotation(_arg1:Number):void{
this.mc.rotation = _arg1;
}
public function getGlobal():Point{
return (this.mc.parent.localToGlobal(this.getPosition()));
}
public function setHouseIndex(_arg1:int):void{
this.houseIndex = _arg1;
}
public function getPosition():Point{
this.position = new Point(this.mc.x, this.mc.y);
return (this.position);
}
public function setPosition(_arg1:Number, _arg2:Number):void{
this.position.x = _arg1;
this.position.y = _arg2;
if (_arg1 <= (this.mc.width / 2)){
this.position.x = (this.personMc.width / 2);
};
if (_arg1 >= (GameWorld.WIDTH - (this.personMc.width / 2))){
this.position.x = (GameWorld.WIDTH - (this.personMc.width / 2));
};
if (_arg2 <= (this.personMc.height / 2)){
this.position.y = (this.personMc.height / 2);
};
if (_arg2 >= (GameWorld.HEIGHT - (this.personMc.height / 2))){
this.position.y = (GameWorld.HEIGHT - (this.personMc.height / 2));
};
this.mc.x = this.position.x;
this.mc.y = this.position.y;
}
public function jump(){
if (JobManager.getInstance().getState() == JobManager.START){
JobManager.getInstance().addCount(this.getHouseIndex());
};
this.playMc("jump");
this.goal.visible = false;
SoundManager.getInstance().play(SoundManager.JUMP);
this.jumpFlag = false;
this.jumpCountFlag = false;
this.state = Person.FLYING;
this.houseSpeed.x = ((this.jumpSpeed.x + this.maxSpeed.x) * this.dir.x);
this.houseSpeed.y = ((this.jumpSpeed.y + this.maxSpeed.y) * this.dir.y);
this.jumpStart = new Point(0, 0);
this.mc.addEventListener(Event.ENTER_FRAME, this.flyEvent);
}
public function getSPersonMc():SPersonMc{
return (this.sPersonMc);
}
public function gotoStartPoint():void{
this.setPosition((GameWorld.WIDTH / 2), (GameWorld.HEIGHT / 2));
PersonManager.getInstance().gotoStartPoint();
this.state = Person.RUNNING;
this.jumpCountFlag = false;
this.playMc("stand");
}
public function getPersonMc():PersonMc{
return (this.personMc);
}
private function layout():void{
this.personMc.x = 0;
this.personMc.y = 0;
this.personMc.removeChild(this.personMc.jumpMc);
this.personMc.removeChild(this.personMc.runMc);
this.personMc.removeChild(this.personMc.deathMc);
this.mc.addChild(this.personMc);
PersonManager.getInstance().createStartPoint();
this.gotoStartPoint();
this.house = this.map.getHitPersonMc();
this.dManager = DeliverManager.getInstance();
this.fManager = FireManager.getInstance();
ThiefManager.getInstance().initMakeThief();
this.dManager.makeDeliver();
this.mc.addChild(this.goal);
this.goal.x = 94;
this.goal.y = 0;
}
public function smallMapMove(_arg1:Number, _arg2:Number):void{
if (_arg1 > 0){
this.smallMap.setSpeed(new Point(_arg1, 0));
if (((this.smallMap.getXY().x + this.smallMap.getWidth()) - 40) <= SmallMap.SMALLMAPWIDTH){
this.smallMap.personRun();
} else {
if (this.smallMap.getPersonX() < ((SmallMap.SMALLMAPWIDTH / 2) - 4)){
this.smallMap.personRun();
} else {
this.smallMap.setSpeed(new Point(-(_arg1), 0));
this.smallMap.run();
};
};
} else {
if (_arg1 < 0){
this.smallMap.setSpeed(new Point(_arg1, 0));
if ((this.smallMap.getXY().x + 2) >= 0){
this.smallMap.personRun();
} else {
if (this.smallMap.getPersonX() > ((SmallMap.SMALLMAPWIDTH / 2) + 4)){
this.smallMap.personRun();
} else {
this.smallMap.setSpeed(new Point(-(_arg1), 0));
this.smallMap.run();
};
};
};
};
if (_arg2 > 0){
this.smallMap.setSpeed(new Point(0, _arg2));
if (((this.smallMap.getXY().y + this.smallMap.getHeight()) - 20) <= SmallMap.SMALLMAPHEIGHT){
this.smallMap.personRun();
} else {
if (this.smallMap.getPersonY() < ((SmallMap.SMALLMAPHEIGHT / 2) - 4)){
this.smallMap.personRun();
} else {
this.smallMap.setSpeed(new Point(0, -(_arg2)));
this.smallMap.run();
};
};
} else {
if (_arg2 < 0){
this.smallMap.setSpeed(new Point(0, _arg2));
if ((this.smallMap.getXY().y + 2) >= 0){
this.smallMap.personRun();
} else {
if (this.smallMap.getPersonY() > ((SmallMap.SMALLMAPHEIGHT / 2) + 4)){
this.smallMap.personRun();
} else {
this.smallMap.setSpeed(new Point(0, -(_arg2)));
this.smallMap.run();
};
};
};
};
}
public function moveEvent(_arg1:Event):void{
if ((((Pause.getInstance().getState() == Pause.RUN)) && ((GameWorld.getInstance().getState() == GameWorld.PLAYING)))){
if ((((this.state == Person.FLYING)) || ((this.state == Person.RUNNING)))){
this.mapMove();
};
};
}
public function mapMove():void{
var _local1:House;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Point;
this.house = this.map.getHitPersonMc();
_local1 = this.dManager.getHouse();
_local2 = ((_local1.x + this.map.getPosition().x) - this.getPosition().x);
_local3 = ((_local1.y + this.map.getPosition().y) - this.getPosition().y);
this.smallMap.setDeliveryDir(((Math.atan2(_local3, _local2) * 180) / Math.PI));
if (this.state == Person.RUNNING){
this.fall();
if ((this.house is Car)){
this.houseSpeed.x = Car(this.house).getSpeed().x;
this.houseSpeed.y = Car(this.house).getSpeed().y;
this.speed.x = 0;
this.speed.y = 0;
_local6 = this.house.parent.localToGlobal(new Point(this.house.x, this.house.y));
if (this.jumpCountFlag == false){
this.jumpCountFlag = true;
this.setPosition(_local6.x, _local6.y);
this.smallMap.setPXY((this.house.getSHouseMc().x + this.smallMap.getXY().x), (this.house.getSHouseMc().y + this.smallMap.getXY().y));
};
} else {
this.houseSpeed.x = 0;
this.houseSpeed.y = 0;
};
if ((((GameWorld.getInstance().getState() == GameWorld.PLAYING)) && ((this.state == Person.RUNNING)))){
if ((((this.speed.x == 0)) && ((this.speed.y == 0)))){
this.playMc("stand");
} else {
this.playMc("run");
};
};
};
if (this.state == Person.FLYING){
_local4 = this.houseSpeed.x;
_local5 = this.houseSpeed.y;
} else {
_local4 = (this.houseSpeed.x + this.speed.x);
_local5 = (this.houseSpeed.y + this.speed.y);
};
if (this.nextStep(_local4, _local5) == true){
if (_local4 > 0){
this.smallMap.setSpeed(new Point(_local4, 0));
if (((this.map.getPosition().x + Map.MapWidth) - 200) <= GameWorld.WIDTH){
this.setPosition((this.getPosition().x + _local4), this.getPosition().y);
this.smallMap.personRun();
} else {
if (this.getPosition().x < ((GameWorld.WIDTH / 2) + 20)){
this.setPosition((this.getPosition().x + _local4), this.getPosition().y);
this.smallMap.personRun();
} else {
this.map.run(new Point((_local4 * -1), 0));
this.smallMap.setSpeed(new Point(-(_local4), 0));
this.smallMap.run();
};
};
} else {
if (_local4 < 0){
this.smallMap.setSpeed(new Point(_local4, 0));
if ((this.map.getPosition().x + 10) >= 0){
this.setPosition((this.getPosition().x + _local4), this.getPosition().y);
this.smallMap.personRun();
} else {
if (this.getPosition().x > ((GameWorld.WIDTH / 2) + 20)){
this.setPosition((this.getPosition().x + _local4), this.getPosition().y);
this.smallMap.personRun();
} else {
this.map.run(new Point((_local4 * -1), 0));
this.smallMap.setSpeed(new Point(-(_local4), 0));
this.smallMap.run();
};
};
};
};
if (_local5 > 0){
this.smallMap.setSpeed(new Point(0, _local5));
if (((this.map.getPosition().y + Map.MapHeight) - 100) <= GameWorld.HEIGHT){
this.setPosition(this.getPosition().x, (this.getPosition().y + _local5));
this.smallMap.personRun();
} else {
if (this.getPosition().y < ((GameWorld.HEIGHT / 2) - 20)){
this.setPosition(this.getPosition().x, (this.getPosition().y + _local5));
this.smallMap.personRun();
} else {
this.map.run(new Point(0, (_local5 * -1)));
this.smallMap.setSpeed(new Point(0, -(_local5)));
this.smallMap.run();
};
};
} else {
if (_local5 < 0){
this.smallMap.setSpeed(new Point(0, _local5));
if ((this.map.getPosition().y + 10) >= 0){
this.setPosition(this.getPosition().x, (this.getPosition().y + _local5));
this.smallMap.personRun();
} else {
if (this.getPosition().y > ((GameWorld.HEIGHT / 2) + 20)){
this.setPosition(this.getPosition().x, (this.getPosition().y + _local5));
this.smallMap.personRun();
} else {
this.map.run(new Point(0, (_local5 * -1)));
this.smallMap.setSpeed(new Point(0, -(_local5)));
this.smallMap.run();
};
};
};
};
} else {
if ((((GameWorld.getInstance().getState() == GameWorld.PLAYING)) && ((this.state == Person.RUNNING)))){
this.playMc("stand");
};
};
}
public function setState(_arg1:String):void{
this.state = _arg1;
}
public function setDir(_arg1:int, _arg2:int){
if ((((((Math.abs(_arg1) == 1)) || ((Math.abs(_arg1) == 0)))) && ((((Math.abs(_arg2) == 1)) || ((Math.abs(_arg2) == 0)))))){
this.dir = new Point(_arg1, _arg2);
} else {
trace((((("人物方向设置不对." + "dirX:") + _arg1) + "dirY:") + _arg2));
};
}
public function end(_arg1:String):void{
this.state = _arg1;
}
public function nextStep(_arg1:Number, _arg2:Number):Boolean{
if (this.state == Person.FLYING){
return (true);
};
if (this.house != null){
if (this.house.getHitTestArea().hitTestPoint((this.getPosition().x + _arg1), (this.getPosition().y + _arg2), true)){
return (true);
};
};
return (false);
}
private function removed(_arg1:Event):void{
if (_arg1.currentTarget == _arg1.target){
this.mc.removeEventListener(Event.REMOVED, this.removed);
trace("Person实例被删除.");
};
}
public function addToStage(_arg1:Sprite):void{
_arg1.addChild(this.mc);
}
public function gc():void{
this.dManager.gc();
this.fManager.gc();
PersonManager.getInstance().gc();
JobManager.getInstance().gc();
GameWorld.getInstance().getStage().removeEventListener(KeyboardEvent.KEY_DOWN, this.keyDownEvent);
GameWorld.getInstance().getStage().removeEventListener(KeyboardEvent.KEY_UP, this.keyUpEvent);
this.mc.removeEventListener(Event.ENTER_FRAME, this.flyEvent);
this.mc.removeEventListener(Event.ENTER_FRAME, moveEvent);
this.mc.parent.removeChild(this.mc);
Person.person = null;
}
public function getState():String{
return (this.state);
}
public function died():void{
if (JobManager.getInstance().getState() == JobManager.START){
JobManager.getInstance().setState(JobManager.START);
JobManager.getInstance().setCurrentJobState(false);
JobManager.getInstance().finished();
} else {
GameWorld.getInstance().losed();
};
Pause.getInstance().setState(Pause.PAUSE);
GameWorld.getInstance().hidePause();
this.playMc("death");
SoundManager.getInstance().play(SoundManager.DEATH);
this.state = Person.FALLING;
this.houseSpeed.x = 0;
this.houseSpeed.y = 0;
this.speed.x = 0;
this.speed.y = 0;
}
public function control():void{
GameWorld.getInstance().getStage().addEventListener(KeyboardEvent.KEY_DOWN, keyDownEvent);
GameWorld.getInstance().getStage().addEventListener(KeyboardEvent.KEY_UP, keyUpEvent);
GameWorld.getInstance().getStage().focus = GameWorld.getInstance().getStage();
}
private function keyUpEvent(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 32){
this.jumpFlag = true;
} else {
if ((((_arg1.keyCode == 65)) || ((_arg1.keyCode == Keyboard.LEFT)))){
this.speed.x = 0;
} else {
if ((((_arg1.keyCode == 68)) || ((_arg1.keyCode == Keyboard.RIGHT)))){
this.speed.x = 0;
} else {
if ((((this.keyChar == 87)) || ((_arg1.keyCode == Keyboard.UP)))){
this.speed.y = 0;
} else {
if ((((_arg1.keyCode == 83)) || ((_arg1.keyCode == Keyboard.DOWN)))){
this.speed.y = 0;
};
};
};
};
};
}
public function getHouse():House{
return (this.house);
}
private function flyEvent(_arg1:Event):void{
var _local2:int;
if (Math.abs((this.jumpStart.x + this.jumpStart.y)) < this.jumpDistance){
_local2 = 1;
this.jumpStart.offset((this.jumpSpeed.x + this.maxSpeed.x), 0);
if (Math.abs((this.jumpStart.x + this.jumpStart.y)) >= (this.jumpDistance / 2)){
_local2 = -1;
};
this.personMc.scaleX = (this.personMc.scaleX + (0.1 * _local2));
this.personMc.scaleY = (this.personMc.scaleY + (0.1 * _local2));
if ((((this.personMc.scaleX < 1)) || ((this.personMc.scaleY < 1)))){
this.personMc.scaleX = 1;
this.personMc.scaleY = 1;
};
} else {
if (this.state == Person.FLYING){
this.state = Person.RUNNING;
this.goal.visible = true;
};
this.houseSpeed.x = 0;
this.houseSpeed.y = 0;
this.mc.removeEventListener(Event.ENTER_FRAME, this.flyEvent);
};
}
private function keyDownEvent(_arg1:KeyboardEvent):void{
if ((((Pause.getInstance().getState() == Pause.RUN)) && ((GameWorld.getInstance().getState() == GameWorld.PLAYING)))){
if (this.state == Person.RUNNING){
if (_arg1.keyCode == 32){
if (this.jumpFlag == true){
this.jump();
};
} else {
if ((((_arg1.keyCode == 65)) || ((_arg1.keyCode == Keyboard.LEFT)))){
this.setDir(-1, 0);
this.setRotation(-180);
this.speed.y = 0;
this.speed.x = -(this.maxSpeed.x);
} else {
if ((((_arg1.keyCode == 68)) || ((_arg1.keyCode == Keyboard.RIGHT)))){
this.setDir(1, 0);
this.setRotation(0);
this.speed.x = this.maxSpeed.x;
this.speed.y = 0;
} else {
if ((((_arg1.keyCode == 87)) || ((_arg1.keyCode == Keyboard.UP)))){
this.setDir(0, -1);
this.setRotation(-90);
this.speed.x = 0;
this.speed.y = -(this.maxSpeed.y);
} else {
if ((((_arg1.keyCode == 83)) || ((_arg1.keyCode == Keyboard.DOWN)))){
this.setDir(0, 1);
this.setRotation(90);
this.speed.x = 0;
this.speed.y = this.maxSpeed.y;
};
};
};
};
};
};
};
}
public static function getInstance():Person{
if (Person.person == null){
Person.person = new (Person);
};
return (Person.person);
}
}
}//package role
Section 62
//PersonManager (role.PersonManager)
package role {
import map.*;
import flash.geom.*;
import main.*;
public class PersonManager {
private var flags:Array;
private var startPoint:Point;
private var count:int;
private var houses:Array;
private var map:Map;
private static var singleFlag:Boolean = true;
private static var pManager:PersonManager;
public function PersonManager(){
if (PersonManager.singleFlag == true){
throw (Error("PersonManager不能用构造函数实例化。"));
};
PersonManager.singleFlag = true;
this.init();
}
public function gotoStartPoint():void{
this.map.setPosition((-(this.startPoint.x) + (GameWorld.WIDTH / 2)), (-(this.startPoint.y) + (GameWorld.HEIGHT / 2)));
}
public function createStartPoint():void{
var _local1:int;
var _local2:int;
_local1 = int((Math.random() * this.houses.length));
while (this.flags[_local1] == true) {
_local1 = ((_local1 + 1) % this.houses.length);
};
this.flags[_local1] = true;
this.count++;
this.startPoint = this.houses[_local1];
if (this.count == this.houses.length){
_local2 = 0;
while (_local2 < this.houses.length) {
this.flags[_local2] = false;
_local2++;
};
this.count = 0;
};
}
public function gc():void{
PersonManager.pManager = null;
}
private function init():void{
var _local1:int;
this.houses = new Array(new Point(1565, 895), new Point(1290, 200), new Point(2460, 1415), new Point(2305, 2305), new Point(1155, 2050), new Point(525, 2830), new Point(560, 2200), new Point(2405, 835), new Point(480, 525), new Point(1150, 2050));
this.map = Map.getInstance();
this.flags = new Array();
_local1 = 0;
while (_local1 < this.houses.length) {
this.flags[_local1] = false;
_local1++;
};
this.count = 0;
}
public static function getInstance():PersonManager{
if (PersonManager.pManager == null){
PersonManager.singleFlag = false;
PersonManager.pManager = new (PersonManager);
};
return (PersonManager.pManager);
}
}
}//package role
Section 63
//Score (role.Score)
package role {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class Score {
private var speed:Point;
private var scoreMc:ScoreMc;
private var position:Point;
private var moveTimer:Timer;
public function Score(_arg1:int){
this.scoreMc = new ScoreMc();
this.scoreMc.score.text = ("+ " + _arg1);
this.scoreMc.addEventListener(Event.ADDED, added);
this.moveTimer = new Timer(100, 50);
this.speed = new Point(1, 1);
this.position = new Point(0, 0);
}
private function added(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.moveTimer.addEventListener(TimerEvent.TIMER, moveEvent);
this.moveTimer.addEventListener(TimerEvent.TIMER_COMPLETE, delEvent);
this.moveTimer.start();
this.scoreMc.addEventListener(Event.REMOVED, removed);
};
}
public function addToStage(_arg1:Sprite):void{
_arg1.addChild(this.scoreMc);
}
public function setPosition(_arg1:Number, _arg2:Number):void{
this.position.x = _arg1;
this.position.y = _arg2;
this.scoreMc.x = this.position.x;
this.scoreMc.y = this.position.y;
}
public function delEvent(_arg1:TimerEvent):void{
this.scoreMc.parent.removeChild(this.scoreMc);
}
private function removed(_arg1:Event):void{
if (_arg1.target == _arg1.currentTarget){
this.scoreMc.removeEventListener(Event.REMOVED, removed);
this.moveTimer.removeEventListener(TimerEvent.TIMER, moveEvent);
trace("Score实例被删除.");
};
}
private function moveEvent(_arg1:TimerEvent):void{
this.scoreMc.y = (this.scoreMc.y - this.speed.y);
this.scoreMc.alpha = (this.scoreMc.alpha - 0.1);
}
}
}//package role
Section 64
//MusicManager (sound.MusicManager)
package sound {
import flash.events.*;
import flash.media.*;
public class MusicManager {
private var music:Sound;
private var state:int;
private var soundChannel:SoundChannel;
private var soundTransform:SoundTransform;
public static const PLAY:int = 0;
public static const MUTE:int = 1;
private static var singleFlag:Boolean = true;
private static var musicManager:MusicManager;
public function MusicManager(){
if (MusicManager.singleFlag == true){
throw (new Error("MusicManager不能用构造函数实例化。"));
};
this.music = new Music();
this.state = MusicManager.PLAY;
this.soundTransform = new SoundTransform(1);
MusicManager.singleFlag = true;
}
public function returnPlay(_arg1:Event):void{
this.play();
}
public function muteControl():void{
if (this.state == MusicManager.MUTE){
this.state = MusicManager.PLAY;
this.soundTransform = new SoundTransform(1);
} else {
if (this.state == MusicManager.PLAY){
this.state = MusicManager.MUTE;
this.soundTransform = new SoundTransform(0);
};
};
this.soundChannel.soundTransform = this.soundTransform;
}
public function play():void{
this.soundChannel = this.music.play();
this.soundChannel.soundTransform = this.soundTransform;
this.soundChannel.addEventListener(Event.SOUND_COMPLETE, returnPlay);
}
public function getState():int{
return (this.state);
}
public static function getInstance():MusicManager{
if (MusicManager.musicManager == null){
MusicManager.singleFlag = false;
MusicManager.musicManager = new (MusicManager);
};
return (MusicManager.musicManager);
}
}
}//package sound
Section 65
//SoundManager (sound.SoundManager)
package sound {
import flash.media.*;
public class SoundManager {
private var muteState:Boolean;
public static const DEATH:String = "Death";
public static const JUMP:String = "Jump";
public static const EAT:String = "Eat";
private static var soundManager:SoundManager;
private static var singleFlag:Boolean = true;
public function SoundManager(){
if (SoundManager.singleFlag == true){
throw (new Error("SoundManager不能用构造函数实例化。"));
};
init();
SoundManager.singleFlag = true;
}
private function init():void{
this.muteState = false;
}
public function play(_arg1:String):void{
var _local2:Sound;
var _local3:SoundTransform;
_local3 = new SoundTransform(0.5);
if (this.muteState == false){
if (_arg1 == SoundManager.DEATH){
_local2 = new Death();
_local2.play(0);
} else {
if (_arg1 == SoundManager.JUMP){
_local2 = new Jump();
_local2.play(0);
} else {
if (_arg1 == SoundManager.EAT){
_local2 = new Eat();
_local2.play(0);
};
};
};
};
}
public function getMute():Boolean{
return (this.muteState);
}
public function muteControl():void{
if (this.muteState == false){
this.muteState = true;
} else {
if (this.muteState == true){
this.muteState = false;
};
};
}
public function gc():void{
SoundManager.soundManager = null;
}
public static function getInstance():SoundManager{
if (soundManager == null){
SoundManager.singleFlag = false;
soundManager = new (SoundManager);
};
return (soundManager);
}
}
}//package sound
Section 66
//MaskRect (ui.MaskRect)
package ui {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class MaskRect extends Sprite {
public var onSetWH:Function;
private var __align:String;// = "left-top"
public static var wid:int = 0;
public static var hei0:int;
public static var hei:int = 0;
public static var wid0:int;
public function MaskRect(){
onSetWH = function ():void{
};
__align = "left-top";
super();
if ((((wid > 0)) && ((hei > 0)))){
setWH();
} else {
this.addEventListener(Event.ADDED_TO_STAGE, added);
};
}
private function added(_arg1:Event):void{
var event = _arg1;
this.removeEventListener(Event.ADDED_TO_STAGE, added);
this.addEventListener(Event.REMOVED_FROM_STAGE, removed);
try {
getStageWH();
} catch(e:Error) {
this.loaderInfo.addEventListener(Event.INIT, loadInit);
};
}
private function getStageWH():void{
var _local1:*;
_local1 = this.getChildAt(0);
wid0 = _local1.width;
hei0 = _local1.height;
wid = this.loaderInfo.width;
hei = this.loaderInfo.height;
setWH();
}
public function set align(_arg1:String):void{
var _local2:*;
var _local3:Rectangle;
__align = _arg1;
if ((((wid > 0)) && ((hei > 0)))){
_local2 = this.getChildAt(0);
_local3 = _local2.getBounds(this);
switch (__align.charAt(0).toLowerCase()){
case "c":
case "m":
_local2.x = (_local2.x + (((wid0 - wid) / 2) - _local3.x));
_local2.y = (_local2.y + (((hei0 - hei) / 2) - _local3.y));
break;
case "r":
case "b":
_local2.x = (_local2.x + ((wid0 - wid) - _local3.x));
_local2.y = (_local2.y + ((hei0 - hei) - _local3.y));
break;
default:
_local2.x = (_local2.x + -(_local3.x));
_local2.y = (_local2.y + -(_local3.y));
break;
};
};
}
private function loadInit(_arg1:Event):void{
this.loaderInfo.removeEventListener(Event.INIT, loadInit);
getStageWH();
}
private function removed(_arg1:Event):void{
this.removeEventListener(Event.REMOVED_FROM_STAGE, removed);
onSetWH = null;
}
private function setWH():void{
var _local1:*;
_local1 = this.getChildAt(0);
_local1.width = wid;
_local1.height = hei;
onSetWH(wid, hei);
if (__align){
align = __align;
};
}
public static function setPos(_arg1:MaskRect, _arg2:Function):void{
if ((((wid > 0)) && ((hei > 0)))){
_arg2(wid, hei);
} else {
_arg1.onSetWH = _arg2;
};
}
}
}//package ui
Section 67
//Txt (ui.Txt)
package ui {
import flash.display.*;
import flash.text.*;
public class Txt extends Sprite {
private var __text:String;
public var txt:TextField;
public function Txt(){
__text = "";
autoSize = "left";
}
public function get text(){
if (txt.selectable){
__text = txt.text;
};
return (__text);
}
public function get type():String{
return (txt.type);
}
public function get autoSize():String{
return (txt.autoSize);
}
public function get selectable():Boolean{
return (txt.selectable);
}
public function set text(_arg1):void{
txt.text = (__text = _arg1);
}
public function set type(_arg1:String):void{
txt.type = _arg1;
}
public function set autoSize(_arg1:String):void{
txt.autoSize = _arg1;
}
public function set selectable(_arg1:Boolean):void{
txt.selectable = _arg1;
}
public function set maxChars(_arg1:int):void{
txt.maxChars = _arg1;
}
public function get maxChars():int{
return (txt.maxChars);
}
}
}//package ui
Section 68
//Common (Common)
package {
import flash.display.*;
import flash.utils.*;
public final class Common {
public static function deepCopy(_arg1:Object){
var _local2:ByteArray;
_local2 = new ByteArray();
_local2.writeObject(_arg1);
_local2.position = 0;
return (_local2.readObject());
}
public static function removeChildren(_arg1:DisplayObjectContainer):void{
while (_arg1.numChildren > 0) {
_arg1.removeChildAt(0);
};
}
public static function playAll(_arg1:DisplayObject, _arg2:Boolean=true){
var _local3:DisplayObjectContainer;
var _local4:int;
if ((_arg1 is DisplayObjectContainer)){
_local3 = (_arg1 as DisplayObjectContainer);
_local4 = _local3.numChildren;
while (--_local4 >= 0) {
playAll(_local3.getChildAt(_local4), true);
};
if (((_arg2) && ((_arg1 is MovieClip)))){
(_arg1 as MovieClip).play();
};
};
}
public static function stopAll(_arg1:DisplayObject, _arg2:Boolean=true){
var _local3:DisplayObjectContainer;
var _local4:int;
if ((_arg1 is DisplayObjectContainer)){
_local3 = (_arg1 as DisplayObjectContainer);
_local4 = _local3.numChildren;
while (--_local4 >= 0) {
stopAll(_local3.getChildAt(_local4), true);
};
if (((_arg2) && ((_arg1 is MovieClip)))){
(_arg1 as MovieClip).stop();
};
};
}
}
}//package
Section 69
//Death (Death)
package {
import flash.media.*;
public dynamic class Death extends Sound {
}
}//package
Section 70
//DeliverMc (DeliverMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class DeliverMc extends MovieClip {
public var num:TextField;
}
}//package
Section 71
//Eat (Eat)
package {
import flash.media.*;
public dynamic class Eat extends Sound {
}
}//package
Section 72
//ErrorBox (ErrorBox)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ErrorBox extends MovieClip {
public var info:TextField;
}
}//package
Section 73
//FireMc (FireMc)
package {
import flash.display.*;
public dynamic class FireMc extends MovieClip {
}
}//package
Section 74
//FirstPop (FirstPop)
package {
import flash.display.*;
public dynamic class FirstPop extends MovieClip {
public var go:SimpleButton;
}
}//package
Section 75
//Goal (Goal)
package {
import flash.display.*;
public dynamic class Goal extends MovieClip {
}
}//package
Section 76
//HouseCountMc (HouseCountMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class HouseCountMc extends MovieClip {
public var houseNum:TextField;
}
}//package
Section 77
//JobMc (JobMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class JobMc extends MovieClip {
public var message:MovieClip;
public var info:TextField;
public var go:SimpleButton;
public function JobMc(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6);
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 78
//Jump (Jump)
package {
import flash.media.*;
public dynamic class Jump extends Sound {
}
}//package
Section 79
//JumpFlagMc (JumpFlagMc)
package {
import flash.display.*;
public dynamic class JumpFlagMc extends MovieClip {
}
}//package
Section 80
//LifeNumMc (LifeNumMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LifeNumMc extends MovieClip {
public var lifeNum:TextField;
}
}//package
Section 81
//LightMc (LightMc)
package {
import flash.display.*;
public dynamic class LightMc extends MovieClip {
}
}//package
Section 82
//MapMc (MapMc)
package {
import flash.display.*;
public dynamic class MapMc extends MovieClip {
}
}//package
Section 83
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.6");
}
public static function showClickAwayAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 84
//Music (Music)
package {
import flash.media.*;
public dynamic class Music extends Sound {
}
}//package
Section 85
//PersonMc (PersonMc)
package {
import flash.display.*;
public dynamic class PersonMc extends MovieClip {
public var standMc:MovieClip;
public var fireDeathMc:MovieClip;
public var deathMc:MovieClip;
public var jumpMc:MovieClip;
public var runMc:MovieClip;
}
}//package
Section 86
//SCar1 (SCar1)
package {
import flash.display.*;
public dynamic class SCar1 extends MovieClip {
}
}//package
Section 87
//SCar2 (SCar2)
package {
import flash.display.*;
public dynamic class SCar2 extends MovieClip {
}
}//package
Section 88
//SCar3 (SCar3)
package {
import flash.display.*;
public dynamic class SCar3 extends MovieClip {
}
}//package
Section 89
//SCar4 (SCar4)
package {
import flash.display.*;
public dynamic class SCar4 extends MovieClip {
}
}//package
Section 90
//ScoreMc (ScoreMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class ScoreMc extends MovieClip {
public var score:TextField;
}
}//package
Section 91
//SHouseMc1 (SHouseMc1)
package {
import flash.display.*;
public dynamic class SHouseMc1 extends MovieClip {
public function SHouseMc1(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 92
//SHouseMc10 (SHouseMc10)
package {
import flash.display.*;
public dynamic class SHouseMc10 extends MovieClip {
public function SHouseMc10(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 93
//SHouseMc11 (SHouseMc11)
package {
import flash.display.*;
public dynamic class SHouseMc11 extends MovieClip {
public function SHouseMc11(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 94
//SHouseMc12 (SHouseMc12)
package {
import flash.display.*;
public dynamic class SHouseMc12 extends MovieClip {
public function SHouseMc12(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 95
//SHouseMc13 (SHouseMc13)
package {
import flash.display.*;
public dynamic class SHouseMc13 extends MovieClip {
public function SHouseMc13(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 96
//SHouseMc14 (SHouseMc14)
package {
import flash.display.*;
public dynamic class SHouseMc14 extends MovieClip {
public function SHouseMc14(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 97
//SHouseMc15 (SHouseMc15)
package {
import flash.display.*;
public dynamic class SHouseMc15 extends MovieClip {
public function SHouseMc15(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 98
//SHouseMc16 (SHouseMc16)
package {
import flash.display.*;
public dynamic class SHouseMc16 extends MovieClip {
public function SHouseMc16(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 99
//SHouseMc2 (SHouseMc2)
package {
import flash.display.*;
public dynamic class SHouseMc2 extends MovieClip {
public function SHouseMc2(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 100
//SHouseMc3 (SHouseMc3)
package {
import flash.display.*;
public dynamic class SHouseMc3 extends MovieClip {
public function SHouseMc3(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 101
//SHouseMc6 (SHouseMc6)
package {
import flash.display.*;
public dynamic class SHouseMc6 extends MovieClip {
public function SHouseMc6(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 102
//SHouseMc7 (SHouseMc7)
package {
import flash.display.*;
public dynamic class SHouseMc7 extends MovieClip {
public function SHouseMc7(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 103
//SHouseMc9 (SHouseMc9)
package {
import flash.display.*;
public dynamic class SHouseMc9 extends MovieClip {
public function SHouseMc9(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 104
//SMapBg (SMapBg)
package {
import flash.display.*;
public dynamic class SMapBg extends MovieClip {
}
}//package
Section 105
//SMapMask (SMapMask)
package {
import flash.display.*;
public dynamic class SMapMask extends MovieClip {
}
}//package
Section 106
//SPersonMc (SPersonMc)
package {
import flash.display.*;
public dynamic class SPersonMc extends MovieClip {
}
}//package
Section 107
//ThiefMc (ThiefMc)
package {
import flash.display.*;
public dynamic class ThiefMc extends MovieClip {
public var area:MovieClip;
}
}//package
Section 108
//TimeCountMc (TimeCountMc)
package {
import flash.display.*;
import flash.text.*;
public dynamic class TimeCountMc extends MovieClip {
public var minute:TextField;
public var second:TextField;
}
}//package