Section 1
//CScreen (com.eps.application.CScreen)
package com.eps.application {
import flash.display.*;
import flash.events.*;
public class CScreen extends MovieClip {
public var screenName:String;
public var nextScreenName:String;
public var modal:Boolean;
public static var EV_DESTROYSCREEN = "destroyscreen";
public static var EV_INITSCREEN = "initscreen";
public function destroy(){
dispatchEvent(new Event(EV_DESTROYSCREEN));
}
public function init(){
trace(("EV_INITSCREEN " + EV_INITSCREEN));
dispatchEvent(new Event(EV_INITSCREEN));
}
public function hideScreen(){
}
public function showScreen(){
}
}
}//package com.eps.application
Section 2
//CScreenManager (com.eps.application.CScreenManager)
package com.eps.application {
import flash.display.*;
import flash.events.*;
public class CScreenManager {
private var stageRoot:Stage;
private var screens:Array;
public function CScreenManager(_arg1:Stage){
stageRoot = _arg1;
init();
}
public function start(_arg1:String){
showScreen(_arg1);
}
public function fadeScreen(_arg1:int){
}
public function showScreen(_arg1:String){
var _local2:MovieClip;
_local2 = screens[_arg1];
stageRoot.addChild(_local2);
_local2.init();
}
public function addScreen(_arg1:String, _arg2:CScreen, _arg3:Boolean){
_arg2.modal = _arg3;
screens[_arg1] = _arg2;
_arg2.screenName = _arg1;
_arg2.addEventListener("endScreen", onEndScreen);
_arg2.addEventListener("callNextScreen", onCallNextScreen);
}
private function init(){
screens = new Array();
}
public function getScreen(_arg1:String){
return (screens[_arg1]);
}
public function removeScreen(_arg1:String){
var _local2:MovieClip;
_local2 = screens[_arg1];
stageRoot.removeChild(_local2);
_local2.destroy();
}
private function onEndScreen(_arg1:Event):void{
removeScreen(_arg1.target.screenName);
}
public function destroy(){
screens = null;
}
private function onCallNextScreen(_arg1:Event):void{
showScreen(_arg1.target.nextScreenName);
}
public function hideScreen(){
}
public function nextScreen(_arg1:String, _arg2:String){
screens[_arg1].nextScreenName = _arg2;
}
}
}//package com.eps.application
Section 3
//MochiBot (com.eps.application.MochiBot)
package com.eps.application {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package com.eps.application
Section 4
//CGame (com.eps.mango.game.CGame)
package com.eps.mango.game {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public class CGame extends EventDispatcher {
private var gameMC:MovieClip;
private var mangocount:int;
private var gametimer:Timer;
private var cnMango:MovieClip;
private var guard:MovieClip;
private var catcher:MovieClip;
private var combocounter:int;
private var stimer:int;
public var gamePaused:Boolean;
private var timeleft:int;
private var slinger:MovieClip;
private var istekan:Boolean;// = false
private var tutorialStep:int;// = 0
public static var GS_READY = 0;
public function CGame(_arg1:MovieClip){
istekan = false;
tutorialStep = 0;
super();
init(_arg1);
}
function lepas(_arg1:MouseEvent){
var _local2:CRock;
var _local3:int;
if (gamePaused){
return;
};
_local2 = new CRock();
_local3 = (getTimer() - stimer);
_local2.throwRock(gameMC.mouseX, gameMC.mouseY, _local3);
gameMC.addChild(_local2);
_local2.addEventListener(GameEvent.removeRock, removeRockHandler);
_local2.addEventListener(GameEvent.checkRockCollision, checkRockCollisionHandler);
istekan = false;
gameMC.mcPowerBar.gotoAndStop(1);
slinger.shoot();
}
private function endMusic(){
CSound.getInstance().stopSound(CSound.bg_game);
}
private function keyUpHandler(_arg1:KeyboardEvent){
if (catcher.isDead){
return;
};
if ((((_arg1.keyCode == Keyboard.LEFT)) && ((catcher.status == catcher.ST_LEFT)))){
catcher.stopAction();
};
if ((((_arg1.keyCode == Keyboard.RIGHT)) && ((catcher.status == catcher.ST_RIGHT)))){
catcher.stopAction();
};
if (_arg1.keyCode == Keyboard.SPACE){
if (gamePaused){
unpauseGame();
} else {
pauseGame();
};
};
}
function unpauseGame(){
var _local1:int;
var _local2:int;
trace("unpause");
gamePaused = false;
gameMC.mcPaused.visible = false;
catcher.unpause();
slinger.unpause();
guard.unpause();
gametimer.start();
_local1 = cnMango.numChildren;
_local2 = 0;
while (_local2 < _local1) {
CMango(cnMango.getChildAt(_local2)).unpause();
_local2++;
};
}
function removeRockHandler(_arg1:Event){
var _local2:CRock;
if (gamePaused){
return;
};
_local2 = CRock(_arg1.target);
gameMC.removeChild(_local2);
_local2 = null;
}
public function init(_arg1:MovieClip){
gameMC = _arg1;
playMusic();
if (CGameSession.getInstance().musicon == false){
stopMusic();
};
gameMC.mcSpeaker.addEventListener(MouseEvent.MOUSE_DOWN, speakerclicked);
gameMC.mcPaused.visible = false;
gameMC.mcTutorial.visible = false;
slinger = gameMC.mcKetapel;
catcher = gameMC.mcKeranjang;
guard = gameMC.mcPenjaga;
gameMC.sky.gotoAndStop(1);
gameMC.mcRiskBar.gotoAndStop(1);
gameMC.mcPowerBar.gotoAndStop(1);
updateHUD();
cnMango = new MovieClip();
gameMC.addChild(cnMango);
cnMango.x = 0;
cnMango.y = 0;
gameMC.mcGameMessage.showDay(CGameSession.getInstance().day);
gameMC.mcGameMessage.addEventListener(GameEvent.endGameMessage, startGame);
}
function pauseGame(){
var _local1:int;
var _local2:int;
gamePaused = true;
gameMC.mcPaused.visible = true;
catcher.setpause();
slinger.setpause();
guard.setpause();
gametimer.stop();
_local1 = cnMango.numChildren;
_local2 = 0;
while (_local2 < _local1) {
CMango(cnMango.getChildAt(_local2)).setpause();
_local2++;
};
}
private function addMango(){
var _local1:CMango;
if (gamePaused){
return;
};
_local1 = new CMango();
cnMango.addChild(_local1);
_local1.addEventListener(GameEvent.removeMango, removeMangoHandler);
_local1.addEventListener(GameEvent.checkMangoCollision, checkMangoCollisionHandler);
mangocount++;
updateHUD();
}
public function wakeGuardHandler(_arg1:Event){
if (gamePaused){
return;
};
if (!guard.isShooting){
guard.shoot();
};
}
private function removeMango(_arg1:CMango){
if (gamePaused){
return;
};
_arg1.removeEventListener(GameEvent.removeMango, removeMangoHandler);
_arg1.removeEventListener(GameEvent.checkMangoCollision, checkMangoCollisionHandler);
cnMango.removeChild(_arg1);
_arg1.destroy();
_arg1 = null;
mangocount--;
}
private function destroymangoes(){
var _local1:int;
var _local2:int;
_local1 = cnMango.numChildren;
_local2 = 0;
while (_local2 < _local1) {
removeMango(CMango(cnMango.getChildAt(0)));
_local2++;
};
}
private function levelUp(_arg1:GameEvent){
if (gamePaused){
return;
};
gameMC.mcGameMessage.removeEventListener(GameEvent.endGameMessage, levelUp);
CGameSession.getInstance().levelUp();
dispatchEvent(new GameEvent(GameEvent.levelUp, null));
}
public function doneAnim(){
gameMC.combo.visible = false;
}
private function stopMusic(){
gameMC.mcSpeaker.gotoAndStop(2);
CSound.getInstance().hideSound(CSound.bg_game);
}
private function speakerclicked(_arg1:MouseEvent){
if (CGameSession.getInstance().musicon){
CGameSession.getInstance().musicon = false;
stopMusic();
} else {
CGameSession.getInstance().musicon = true;
playMusic();
};
}
public function deadTimerHandler(_arg1:GameEvent){
var _local2:CGameSession;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
if (gamePaused){
return;
};
gameMC.mcGameMessage.removeEventListener(GameEvent.endGameMessage, deadTimerHandler);
CGameSession.getInstance().lives--;
updateHUD();
if (CGameSession.getInstance().lives < 0){
_local2 = CGameSession.getInstance();
_local3 = (_local2.currentmangocatched[0] * 0.25);
_local4 = (_local2.currentmangocatched[1] * 0.5);
_local5 = _local2.currentmangocatched[2];
_local6 = (_local2.currentmangocatched[3] * -0.5);
_local7 = (_local2.currentcombo3 * 2);
_local8 = (_local2.currentcombo4 * 3);
_local9 = (_local2.currentcombo5 * 5);
_local10 = (_local2.currentcombo6 * 10);
_local2.money = ((((((((_local2.money + _local3) + _local4) + _local5) + _local6) + _local7) + _local8) + _local9) + _local10);
_local2.score = ((((((((_local2.score + _local3) + _local4) + _local5) + _local6) + _local7) + _local8) + _local9) + _local10);
endGame();
dispatchEvent(new GameEvent(GameEvent.endGame, null));
} else {
catcher.restart();
slinger.restart();
guard.restart();
gametimer.start();
};
}
private function removeMangoHandler(_arg1:Event){
if (gamePaused){
return;
};
removeMango(CMango(_arg1.target));
}
function tekan(_arg1:MouseEvent){
if (gamePaused){
return;
};
istekan = true;
slinger.aim();
gameMC.mcPowerBar.gotoAndPlay(1);
stimer = getTimer();
}
public function gameTimerHandler(_arg1:TimerEvent):void{
var _local2:int;
if (gamePaused){
return;
};
if ((((Math.random() < 0.5)) && ((mangocount < CGameSession.getInstance().maxmango)))){
_local2 = 0;
while (_local2 < CGameSession.getInstance().numMangoAdd) {
addMango();
_local2++;
};
};
timeleft--;
gameMC.sky.gotoAndStop((gameMC.sky.currentFrame + 1));
gameMC.txTimeLimit.text = timeleft;
if (timeleft < 1){
endGame();
gameMC.mcGameMessage.showText("Good Work!", "Level Up");
gameMC.mcGameMessage.addEventListener(GameEvent.endGameMessage, levelUp);
};
}
private function playMusic(){
gameMC.mcSpeaker.gotoAndStop(1);
CSound.getInstance().playSound(CSound.bg_game);
}
public function catcherHideHandler(_arg1:Event){
if (gamePaused){
return;
};
if ((((((combocounter == 3)) || ((combocounter == 4)))) || ((combocounter == 5)))){
addCombo(combocounter);
};
combocounter = 0;
gameMC.mcRiskBar.gotoAndStop(1);
}
function checkRockCollisionHandler(_arg1:Event){
var _local2:CRock;
var _local3:*;
var _local4:CMango;
if (gamePaused){
return;
};
_local2 = CRock(_arg1.target);
_local3 = 0;
while (_local3 < cnMango.numChildren) {
_local4 = CMango(cnMango.getChildAt(_local3));
if (((_local4.hitTestPoint(_local2.x, _local2.y, true)) && (!(_local4.dropped)))){
_local4.drop();
CSound.getInstance().playSound(CSound.mangoshot);
_local2.hit = true;
};
_local3++;
};
}
private function keyDownHandler(_arg1:KeyboardEvent){
if (catcher.isDead){
return;
};
if (_arg1.keyCode == Keyboard.LEFT){
catcher.gotoLeft();
};
if (_arg1.keyCode == Keyboard.RIGHT){
catcher.gotoRight();
};
}
private function addCombo(_arg1:int){
if (gamePaused){
return;
};
CGameSession.getInstance().addCombo(_arg1);
combocounter = 0;
CSound.getInstance().playSound(CSound.supercombo2);
gameMC.combo.visible = true;
gameMC.combo.x = catcher.x;
gameMC.combo.y = catcher.y;
gameMC.combo.gotoAndPlay(("combo" + _arg1));
}
private function updateHUD(){
gameMC.txTimeLimit.text = (timeleft + " seconds");
gameMC.txLiveLeft.text = CGameSession.getInstance().lives;
gameMC.txMango.text = CGameSession.getInstance().totalmango;
gameMC.txMoney.text = ("$" + CGameSession.getInstance().money);
gameMC.txDay.text = ("Day " + CGameSession.getInstance().day);
}
public function shotHandler(_arg1:Event){
if (gamePaused){
return;
};
combocounter = 0;
if (catcher.isHiding()){
guard.cancelShot();
return;
};
CSound.getInstance().playSound(CSound.guardshoot);
catcher.dead();
CSound.getInstance().playSound(CSound.mati);
slinger.dead();
gametimer.stop();
if (gameMC.mcRiskBar.currentFrame == 120){
gameMC.mcGameMessage.showText("Youre dead!", "don't stay too long in open space ");
} else {
gameMC.mcGameMessage.showText("Youre dead!", "don't stay too close to the guard ");
};
gameMC.mcRiskBar.gotoAndStop(1);
gameMC.mcGameMessage.addEventListener(GameEvent.endGameMessage, deadTimerHandler);
}
function checkMangoCollisionHandler(_arg1:Event){
var _local2:CMango;
if (gamePaused){
return;
};
_local2 = CMango(_arg1.target);
if (catcher.mBucket.hitTestObject(_local2)){
_local2.hit = true;
CGameSession.getInstance().addMango(_local2.ripelevel());
if (_local2.ripelevel() < 4){
combocounter++;
switch (combocounter){
case 2:
CSound.getInstance().playSound(CSound.c1);
break;
case 3:
CSound.getInstance().playSound(CSound.c2);
break;
case 4:
CSound.getInstance().playSound(CSound.c3);
break;
case 5:
CSound.getInstance().playSound(CSound.c4);
break;
case 6:
addCombo(6);
break;
};
};
updateHUD();
};
}
public function startGame(_arg1:GameEvent){
gameMC.mcGameMessage.removeEventListener(GameEvent.endGameMessage, startGame);
catcher.init();
slinger.init();
guard.init();
gameMC.combo.visible = false;
gameMC.combo.addEventListener("endCombo", onEndCombo);
gamePaused = false;
gameMC.mcPaused.visible = false;
mangocount = 0;
timeleft = CGameSession.getInstance().levelTime;
gameMC.sky.gotoAndStop(1);
updateHUD();
gameMC.mcRiskBar.addEventListener(GameEvent.wakeGuard, wakeGuardHandler);
guard.addEventListener(GameEvent.guardShot, shotHandler);
catcher.addEventListener(GameEvent.wakeGuard, wakeGuardHandler);
catcher.addEventListener(GameEvent.catcherGetOut, catcherGetOutHandler);
catcher.addEventListener(GameEvent.catcherHide, catcherHideHandler);
gameMC.addEventListener(MouseEvent.MOUSE_DOWN, tekan);
gameMC.addEventListener(MouseEvent.MOUSE_UP, lepas);
gameMC.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
gameMC.stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
gametimer = new Timer(1000);
gametimer.addEventListener(TimerEvent.TIMER, gameTimerHandler);
gametimer.start();
addMango();
combocounter = 0;
}
public function catcherGetOutHandler(_arg1:Event){
if (gamePaused){
return;
};
gameMC.mcRiskBar.gotoAndPlay(1);
}
private function onEndCombo(_arg1:Event){
_arg1.target.gotoAndStop(1);
_arg1.target.visible = false;
}
public function destroy(){
}
public function endGame(){
if (gamePaused){
return;
};
if (CGameSession.getInstance().musicon){
endMusic();
};
gameMC.combo.stop();
gameMC.combo.visible = false;
gameMC.combo.removeEventListener("endCombo", onEndCombo);
gameMC.mcSpeaker.removeEventListener(MouseEvent.MOUSE_DOWN, speakerclicked);
gameMC.mcRiskBar.gotoAndStop(1);
destroymangoes();
catcher.destroy();
slinger.destroy();
guard.destroy();
gameMC.removeEventListener(MouseEvent.MOUSE_DOWN, tekan);
gameMC.removeEventListener(MouseEvent.MOUSE_UP, lepas);
gameMC.stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
gameMC.stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
gameMC.mcRiskBar.removeEventListener(GameEvent.wakeGuard, wakeGuardHandler);
guard.removeEventListener(GameEvent.guardShot, shotHandler);
catcher.removeEventListener(GameEvent.wakeGuard, wakeGuardHandler);
catcher.removeEventListener(GameEvent.catcherGetOut, catcherGetOutHandler);
catcher.removeEventListener(GameEvent.catcherHide, catcherHideHandler);
gametimer.stop();
gametimer.removeEventListener(TimerEvent.TIMER, gameTimerHandler);
gametimer = null;
}
}
}//package com.eps.mango.game
Section 5
//CGameMessage (com.eps.mango.game.CGameMessage)
package com.eps.mango.game {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class CGameMessage extends MovieClip {
private var quotes;
public var mcTextMessage:MovieClip;
public function CGameMessage(){
quotes = new Array("A man is not honest simply because he never had a chance to steal.", "A man should live if only to satisfy his curiosity.", "A table is not blessed if it has fed no scholars.", "A wise man hears one word and understands two.", "All things grow with time, except grief.", "An angry man is not fit to pray.", "As we live, so we learn.", "How many will listen to the truth when you tell them?", "If all pulled in one direction, the world would keel over.", "Look down if you would know how high you stand.", "A book is like a garden carried in the pocket.", "A bad cause requires many words. ", "A book is like a garden carried in the pocket.", "A bird in the hand is worth two in a bush.", "A broken hand works, but not a broken heart.", "A cat has nine lives.", "A clear conscience is a soft pillow.", "A close friend can become a close enemy. ", "A closed mouth catches no flies.", "A country can be judged by the quality of its proverbs.", "A courtyard common to all will be swept by none.", "A dimple on the chin, the devil within. ", "A dog is wiser than a woman; it does not bark at its master. ", "A drink precedes a story.", "A drowning man is not troubled by rain.", "A fool sees not the same tree that a wise man sees.", "A forest is in an acorn.", "A friend in need is a friend indeed", "A friend's eye is a good mirror.", "A good denial, the best point in law.", "A good husband is healthy and absent.", "A hard beginning maketh a good ending. ", "A healthy man is a successful man.", "A hedge between keeps friendship green.", "A hen is heavy when carried far.", "A hound's food is in its legs.", "A house without a dog or a cat is the house of a scoundrel.", "A hungry man is an angry man.", "A lie travels round the world while truth is putting her boots on.", "A little too late, is much too late.", "A loan though old is not gift.", "A lock is better than suspicion.", "A man does not seek his luck, luck seeks its man.", "A man should live if only to satisfy his curiosity.", "A monkey never thinks her baby's ugly.", "A new broom sweeps clean, but the old brush knows all the corners.", "A penny for your thoughts.", "A penny saved is a penny gained.", "A poor beauty finds more lovers than husbands.", "A prudent man does not make the goat his gardener.", "A rumor goes in one ear and out many mouths. ", "A silent mouth is melodious.", "A table is not blessed if it has fed no scholars.", "A teacher is better than two books.", "A thief believes everybody steals.", "A throne is only a bench covered with velvet.", "A trade not properly learned is an enemy.", "A tree falls the way it leans.", "A white Christmas fills the churchyard.", "A wise man hears one word and understands two.", "Advice should be viewed from behind.", "Advice when most needed is least heeded.", "Age is honorable and youth is noble.", "All is well that ends well.", "All things grow with time, except grief.", "An angry man is not fit to pray.", "An apple a day keeps the doctor away.", "An enemy will agree, but a friend will argue.", "And old rat is a brave rat.", "Anger can be an expensive luxury.", "Anger is as a stone cast into a wasp's nest.", "Anger without power is folly.", "Appetite comes with eating.", "As mad as a March hare.", "As proud as a peacock.", "As the big hound is, so will the pup be.", "As we live, so we learn.", "Be neither intimate nor distant with the clergy.", "Beggars shouldn't be choosers.", "Better give a penny then lend twenty.", "Better late than never.", "Better no doctor at all than three.", "Better the devil you know than the devil you don't know.", "Better to light a candle than to curse the darkness.", "Better wear out shoes than sheets.", "Between the devil and the deep blue sea.", "Beware of a silent dog and still water.", "Black as hell, strong as death, sweet as love. (About coffee.)", "Blood is thicker than water.", "Both your friend and your enemy think you will never die.", "Butter would not melt in her mouth.", "Call on God, but row away from the rocks. ", "Children are poor men's riches.", "Children should be seen and not heard.", "Choose neither a woman nor linen by candlelight.", "Climb mountains to see lowlands.", "Clogs to clogs in three generations.", "Clouds gather before a storm.", "Commit a sin twice and it will not seem a crime.", "Curiosity killed the cat.", "Darkness reigns at the foot of the lighthouse.", "Deal with the faults of others as gently as with your own.", "Death always comes too early or too late", "Death closes all doors.", "Death pays all debts.", "Do not be born good or handsome, but be born lucky.", "Do not look where you fell, but where you slipped.", "Do not speak of secrets in a field that is full of little hills.", "Do not talk Arabic in the house of a Moor.", "Do not use a hatchet to remove a fly from your friend's forehead.", "Don't imitate the fly before you have wings.", "Don't look a gift horse in the mouth.", "Epigrams succeed where epics fail.", "Even a small thorn causes festering.", "Every ass loves to hear himself bray.", "Every cloud has a silver lining.", "Every dog hath its day.", "Every garden may have some weeds.", "Everyone loves justice in the affairs of another.", "Everyone pushes a falling fence.", "Evil enters like a needle and spreads like an oak tree.", "Evil is sooner believed than good.", "Experience is a comb which nature gives to men when they are bald.", "Fame is a magnifying glass.", "Feather by feather the goose can be plucked.", "Fine feathers make fine birds.", "Flattery makes friends and truth makes enemies.", "Fortune is blind, but not invisible.", "Friends are like fiddle strings, they must not be screwed too tight.", "Friends are lost by calling often and calling seldom.", "Friendship is a furrow in the sand.", "Give neither counsel nor salt till you are asked for it.", "Give the devil his due.", "Glutton: one who digs his grave with his teeth.", "God could not be everywhere and therefore he made mothers.", "God gives the nuts, but he doesn't crack them.", "God heals, and the physician takes the fee.");
super();
this.addEventListener(MouseEvent.MOUSE_DOWN, mdown);
}
public function init(){
gotoAndStop("show");
}
public function showDay(_arg1:int){
var _local2:int;
var _local3:TextFormat;
_local2 = Math.floor((Math.random() * quotes.length));
if (_arg1 == 1){
_local2 = 0;
};
mcTextMessage.txMessage.text = ("Day " + _arg1);
_local3 = new TextFormat();
_local3.italic = true;
mcTextMessage.txMessage2.setTextFormat(_local3);
mcTextMessage.txMessage2.text = (("'" + quotes[_local2]) + "'");
gotoAndPlay("show");
}
private function mdown(_arg1:MouseEvent){
trace("CGameMessage:mdown");
endAnimation();
}
public function showText(_arg1:String, _arg2:String){
var _local3:TextFormat;
mcTextMessage.txMessage.text = _arg1;
_local3 = new TextFormat();
_local3.italic = false;
mcTextMessage.txMessage2.setTextFormat(_local3);
mcTextMessage.txMessage2.text = _arg2;
gotoAndPlay("show");
}
public function endAnimation(){
trace("endAnimation ");
mcTextMessage.txMessage.text = "";
dispatchEvent(new GameEvent(GameEvent.endGameMessage, null));
gotoAndStop("show");
}
}
}//package com.eps.mango.game
Section 6
//CGameSession (com.eps.mango.game.CGameSession)
package com.eps.mango.game {
public class CGameSession {
public var lives:int;
public var currentmangocatched:Array;
public var score:Number;
public var firsttimer:Boolean;// = true
public var mangocatched:Array;
public var day:int;
public var currentcombo3:int;
public var currentcombo4:int;
public var currentcombo5:int;
public var currentcombo6:int;
public var shoeslevel:int;
public var numMangoAdd:int;
public var newGame:Boolean;// = true
public var money:Number;
public var musicon:Boolean;// = true
public var currentmangoscores:Array;
public var bucketlevel:int;
public var maxmango:int;
public var levelTime:int;
public var submitscore:Boolean;// = false
public var totalmango:int;
private static var instance:CGameSession = new (CGameSession);
;
public function CGameSession(){
newGame = true;
musicon = true;
submitscore = false;
firsttimer = true;
super();
if (instance){
throw (new Error("It is a Singleton and can only be accessed through Singleton.getInstance()"));
};
}
public function startGameSession(){
newGame = false;
score = 0;
money = 0;
day = 1;
lives = 3;
levelTime = 60;
shoeslevel = 0;
bucketlevel = 1;
maxmango = 10;
numMangoAdd = 1;
submitscore = false;
mangocatched = new Array();
mangocatched.push(0);
mangocatched.push(0);
mangocatched.push(0);
mangocatched.push(0);
}
public function addCombo(_arg1:int){
switch (_arg1){
case 3:
currentcombo3++;
break;
case 4:
currentcombo4++;
break;
case 5:
currentcombo5++;
break;
case 6:
currentcombo6++;
break;
};
}
public function addMango(_arg1:int){
var _local2 = currentmangocatched;
var _local3 = _arg1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
totalmango++;
}
public function levelUp(){
day++;
maxmango = (maxmango + Math.floor((day / 10)));
numMangoAdd = (1 + Math.floor((day / 20)));
}
public function endGameSession(){
mangocatched = null;
}
public function endGame(){
mangocatched[0] = (mangocatched[0] + currentmangocatched[0]);
mangocatched[1] = (mangocatched[1] + currentmangocatched[1]);
mangocatched[2] = (mangocatched[2] + currentmangocatched[2]);
mangocatched[3] = (mangocatched[3] + currentmangocatched[3]);
currentmangocatched = null;
}
public function startGame(){
currentmangocatched = new Array();
currentmangocatched.push(0);
currentmangocatched.push(0);
currentmangocatched.push(0);
currentmangocatched.push(0);
currentmangoscores = new Array();
totalmango = 0;
currentcombo3 = 0;
currentcombo4 = 0;
currentcombo5 = 0;
currentcombo6 = 0;
}
public static function getInstance():CGameSession{
return (instance);
}
}
}//package com.eps.mango.game
Section 7
//CGameTutorial (com.eps.mango.game.CGameTutorial)
package com.eps.mango.game {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public class CGameTutorial extends EventDispatcher {
private var gameMC:MovieClip;
private var mangocount:int;
private var cnMango:MovieClip;
private var guard:MovieClip;
private var catcher:MovieClip;
private var combocounter:int;
private var stimer:int;
private var timeleft:int;
private var slinger:MovieClip;
private var istekan:Boolean;// = false
private var dmango:CMango;
private var tutStep:int;// = 0
public static var GS_READY = 0;
public function CGameTutorial(_arg1:MovieClip){
istekan = false;
tutStep = 0;
super();
init(_arg1);
}
function lepas(_arg1:MouseEvent){
var _local2:CRock;
var _local3:int;
_local2 = new CRock();
_local3 = (getTimer() - stimer);
_local2.throwRock(gameMC.mouseX, gameMC.mouseY, _local3);
gameMC.addChild(_local2);
_local2.addEventListener(GameEvent.removeRock, removeRockHandler);
_local2.addEventListener(GameEvent.checkRockCollision, checkRockCollisionHandler);
istekan = false;
gameMC.mcPowerBar.gotoAndStop(1);
slinger.shoot();
}
private function endMusic(){
CSound.getInstance().stopSound(CSound.bg_game);
}
private function keyUpHandler(_arg1:KeyboardEvent){
if (catcher.isDead){
return;
};
if ((((_arg1.keyCode == Keyboard.LEFT)) && ((catcher.status == catcher.ST_LEFT)))){
catcher.stopAction();
};
if ((((_arg1.keyCode == Keyboard.RIGHT)) && ((catcher.status == catcher.ST_RIGHT)))){
catcher.stopAction();
};
if ((((_arg1.keyCode == Keyboard.SPACE)) && ((tutStep == 6)))){
endGame();
};
}
function unpauseGame(){
var _local1:int;
var _local2:int;
trace("unpause");
gameMC.mcPaused.visible = false;
catcher.unpause();
slinger.unpause();
guard.unpause();
_local1 = cnMango.numChildren;
_local2 = 0;
while (_local2 < _local1) {
CMango(cnMango.getChildAt(_local2)).unpause();
_local2++;
};
}
function removeRockHandler(_arg1:Event){
var _local2:CRock;
_local2 = CRock(_arg1.target);
gameMC.removeChild(_local2);
_local2 = null;
}
public function init(_arg1:MovieClip){
gameMC = _arg1;
playMusic();
if (CGameSession.getInstance().musicon == false){
stopMusic();
};
gameMC.mcSpeaker.addEventListener(MouseEvent.MOUSE_DOWN, speakerclicked);
gameMC.mcTutorial.btSkip.addEventListener(MouseEvent.MOUSE_DOWN, skipHandler);
gameMC.mcPaused.visible = false;
gameMC.mcTutorial.visible = true;
slinger = gameMC.mcKetapel;
catcher = gameMC.mcKeranjang;
guard = gameMC.mcPenjaga;
gameMC.sky.gotoAndStop(1);
gameMC.mcRiskBar.gotoAndStop(1);
gameMC.mcPowerBar.gotoAndStop(1);
updateHUD();
cnMango = new MovieClip();
gameMC.addChild(cnMango);
cnMango.x = 0;
cnMango.y = 0;
startGame();
}
function pauseGame(){
var _local1:int;
var _local2:int;
gameMC.mcPaused.visible = true;
catcher.setpause();
slinger.setpause();
guard.setpause();
_local1 = cnMango.numChildren;
_local2 = 0;
while (_local2 < _local1) {
CMango(cnMango.getChildAt(_local2)).setpause();
_local2++;
};
}
private function addMango(){
var _local1:CMango;
_local1 = new CMango();
cnMango.addChild(_local1);
_local1.gotoAndStop(18);
_local1.addEventListener(GameEvent.removeMango, removeMangoHandler);
_local1.addEventListener(GameEvent.checkMangoCollision, checkMangoCollisionHandler);
updateHUD();
}
private function removeMango(_arg1:CMango){
_arg1.removeEventListener(GameEvent.removeMango, removeMangoHandler);
_arg1.removeEventListener(GameEvent.checkMangoCollision, checkMangoCollisionHandler);
cnMango.removeChild(_arg1);
_arg1.destroy();
_arg1 = null;
mangocount--;
}
private function destroymangoes(){
var _local1:int;
var _local2:int;
_local1 = cnMango.numChildren;
_local2 = 0;
while (_local2 < _local1) {
removeMango(CMango(cnMango.getChildAt(0)));
_local2++;
};
}
private function playTutorial(_arg1:int){
gameMC.mcTutorial.gotoAndStop(_arg1);
tutStep = _arg1;
}
private function stopMusic(){
gameMC.mcSpeaker.gotoAndStop(2);
CSound.getInstance().hideSound(CSound.bg_game);
}
private function speakerclicked(_arg1:MouseEvent){
if (CGameSession.getInstance().musicon){
CGameSession.getInstance().musicon = false;
stopMusic();
} else {
CGameSession.getInstance().musicon = true;
playMusic();
};
}
private function skipHandler(_arg1:MouseEvent){
endGame();
}
private function removeMangoHandler(_arg1:Event){
removeMango(CMango(_arg1.target));
if (dmango.hit){
playTutorial(5);
} else {
playTutorial(4);
};
}
function tekan(_arg1:MouseEvent){
istekan = true;
slinger.aim();
gameMC.mcPowerBar.gotoAndPlay(1);
stimer = getTimer();
}
private function playMusic(){
gameMC.mcSpeaker.gotoAndStop(1);
CSound.getInstance().playSound(CSound.bg_game);
}
public function catcherHideHandler(_arg1:Event){
combocounter = 0;
gameMC.mcRiskBar.gotoAndStop(1);
playTutorial(6);
}
public function catcherGetOutHandler(_arg1:Event){
gameMC.mcRiskBar.gotoAndPlay(1);
}
function checkRockCollisionHandler(_arg1:Event){
var _local2:CRock;
var _local3:*;
_local2 = CRock(_arg1.target);
_local3 = 0;
while (_local3 < cnMango.numChildren) {
dmango = CMango(cnMango.getChildAt(_local3));
if (((dmango.hitTestPoint(_local2.x, _local2.y, true)) && (!(dmango.dropped)))){
dmango.drop();
dmango.setpause();
playTutorial(2);
CSound.getInstance().playSound(CSound.mangoshot);
_local2.hit = true;
};
_local3++;
};
}
private function keyDownHandler(_arg1:KeyboardEvent){
if (tutStep == 2){
playTutorial(3);
dmango.unpause();
};
if (catcher.isDead){
return;
};
if (_arg1.keyCode == Keyboard.LEFT){
catcher.gotoLeft();
};
if (_arg1.keyCode == Keyboard.RIGHT){
catcher.gotoRight();
};
}
public function endGame(){
if (CGameSession.getInstance().musicon){
endMusic();
};
gameMC.combo.stop();
gameMC.combo.visible = false;
gameMC.mcSpeaker.removeEventListener(MouseEvent.MOUSE_DOWN, speakerclicked);
gameMC.mcTutorial.btSkip.removeEventListener(MouseEvent.MOUSE_DOWN, skipHandler);
destroymangoes();
catcher.destroy();
slinger.destroy();
guard.destroy();
gameMC.removeEventListener(MouseEvent.MOUSE_DOWN, tekan);
gameMC.removeEventListener(MouseEvent.MOUSE_UP, lepas);
gameMC.stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
gameMC.stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
catcher.removeEventListener(GameEvent.catcherGetOut, catcherGetOutHandler);
catcher.removeEventListener(GameEvent.catcherHide, catcherHideHandler);
dispatchEvent(new GameEvent(GameEvent.endTutorial, null));
}
private function updateHUD(){
gameMC.txTimeLimit.text = (timeleft + " seconds");
gameMC.txLiveLeft.text = CGameSession.getInstance().lives;
gameMC.txMango.text = CGameSession.getInstance().totalmango;
gameMC.txMoney.text = ("$" + CGameSession.getInstance().money);
gameMC.txDay.text = ("Day " + CGameSession.getInstance().day);
}
function checkMangoCollisionHandler(_arg1:Event){
var _local2:CMango;
_local2 = CMango(_arg1.target);
if (catcher.mBucket.hitTestObject(_local2)){
_local2.hit = true;
updateHUD();
};
}
public function startGame(){
catcher.init();
slinger.init();
guard.init();
gameMC.combo.visible = false;
gameMC.mcPaused.visible = false;
mangocount = 0;
timeleft = CGameSession.getInstance().levelTime;
gameMC.sky.gotoAndStop(1);
updateHUD();
catcher.addEventListener(GameEvent.catcherGetOut, catcherGetOutHandler);
catcher.addEventListener(GameEvent.catcherHide, catcherHideHandler);
gameMC.addEventListener(MouseEvent.MOUSE_DOWN, tekan);
gameMC.addEventListener(MouseEvent.MOUSE_UP, lepas);
gameMC.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
gameMC.stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
addMango();
combocounter = 0;
playTutorial(1);
}
public function destroy(){
}
}
}//package com.eps.mango.game
Section 8
//CKeranjang (com.eps.mango.game.CKeranjang)
package com.eps.mango.game {
import flash.display.*;
import flash.events.*;
public class CKeranjang extends MovieClip {
private var lShoes:int;
private var ACT_STAY;// = "stay"
private var ACT_RUN;// = "run"
public var ST_LEFT;// = 2
private var ACT_DEAD;// = "dead"
public var _pause:Boolean;// = false
private var lBucket:int;
public var ST_STAY;// = 1
private var mShoes:MovieClip;
private var mCatcher:MovieClip;
public var ST_HIDE;// = 0
public var ST_RIGHT;// = 3
private var xSpeed:int;
public var isDead:Boolean;
public var mBucket:MovieClip;
private var ACT_HIDE;// = "hide"
public var status:int;
public function CKeranjang(){
ST_HIDE = 0;
ST_STAY = 1;
ST_LEFT = 2;
ST_RIGHT = 3;
ACT_HIDE = "hide";
ACT_STAY = "stay";
ACT_RUN = "run";
ACT_DEAD = "dead";
_pause = false;
super();
}
public function destroy(){
removeChild(mShoes);
removeChild(mCatcher);
removeChild(mBucket);
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
public function init(){
var _local1:CGameSession;
_local1 = CGameSession.getInstance();
lShoes = _local1.shoeslevel;
lBucket = _local1.bucketlevel;
xSpeed = (10 + (lShoes * 5));
if (lBucket == 1){
mBucket = new Keranjang1();
};
if (lBucket == 2){
mBucket = new Keranjang2();
};
if (lBucket == 3){
mBucket = new Keranjang3();
};
addChild(mBucket);
mCatcher = new Catcher();
addChild(mCatcher);
if (lShoes == 0){
mShoes = new MovieClip();
};
if (lShoes == 1){
mShoes = new Sepatu1();
};
if (lShoes == 2){
mShoes = new Sepatu2();
};
if (lShoes == 3){
mShoes = new Sepatu3();
};
addChild(mShoes);
setCharAction(ACT_HIDE);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
isDead = false;
x = 32;
scaleX = 1;
scaleY = 1;
status = ST_HIDE;
}
private function enterFrameHandler(_arg1:Event){
if (_pause){
return;
};
if (isDead){
return;
};
if (status < ST_STAY){
setCharAction(ACT_HIDE);
} else {
if (status == ST_LEFT){
x = (x - xSpeed);
if (x < 80){
x = 32;
scaleX = 1;
status = ST_HIDE;
dispatchEvent(new GameEvent(GameEvent.catcherHide, null));
setCharAction(ACT_HIDE);
};
} else {
if (status == ST_RIGHT){
x = (x + xSpeed);
if (x > 492){
dispatchEvent(new GameEvent(GameEvent.wakeGuard, null));
x = 492;
};
};
};
};
}
public function gotoLeft(){
if (_pause){
return;
};
if (status == ST_LEFT){
return;
};
status = ST_LEFT;
setCharAction(ACT_RUN);
scaleX = -1;
}
private function setCharAction(_arg1:String){
if (_pause){
return;
};
if (_arg1 == ACT_HIDE){
gotoAndStop(ACT_HIDE);
mShoes.gotoAndStop(ACT_HIDE);
mCatcher.gotoAndStop(ACT_HIDE);
mBucket.gotoAndStop(ACT_HIDE);
};
if (_arg1 == ACT_STAY){
gotoAndStop(ACT_STAY);
mShoes.gotoAndStop(ACT_STAY);
mCatcher.gotoAndStop(ACT_STAY);
mBucket.gotoAndStop(ACT_STAY);
};
if (_arg1 == ACT_RUN){
gotoAndPlay(ACT_RUN);
mShoes.gotoAndPlay(ACT_RUN);
mCatcher.gotoAndPlay(ACT_RUN);
mBucket.gotoAndPlay(ACT_RUN);
};
if (_arg1 == ACT_DEAD){
gotoAndPlay(ACT_DEAD);
mShoes.gotoAndStop(ACT_DEAD);
mCatcher.gotoAndPlay(ACT_DEAD);
mBucket.gotoAndStop(ACT_DEAD);
dispatchEvent(new GameEvent(GameEvent.onCatcherDead, null));
};
}
public function restart(){
if (_pause){
return;
};
isDead = false;
x = 32;
scaleX = 1;
scaleY = 1;
status = ST_HIDE;
}
public function unpause(){
_pause = false;
}
public function stopAction(){
if (_pause){
return;
};
if (x < 80){
x = 32;
scaleX = 1;
status = ST_HIDE;
dispatchEvent(new GameEvent(GameEvent.catcherHide, null));
setCharAction(ACT_HIDE);
} else {
status = ST_STAY;
setCharAction(ACT_STAY);
};
}
public function isHiding():Boolean{
trace(("CKeranjang:isHiding()" + status));
if (status == ST_HIDE){
return (true);
};
return (false);
}
public function dead(){
if (_pause){
return;
};
setCharAction(ACT_DEAD);
isDead = true;
}
public function gotoRight(){
if (_pause){
return;
};
if (status == ST_RIGHT){
return;
};
if (status == ST_HIDE){
dispatchEvent(new GameEvent(GameEvent.catcherGetOut, null));
};
status = ST_RIGHT;
setCharAction(ACT_RUN);
scaleX = 1;
}
public function setpause(){
_pause = true;
}
}
}//package com.eps.mango.game
Section 9
//CKetapel (com.eps.mango.game.CKetapel)
package com.eps.mango.game {
import flash.display.*;
import flash.events.*;
public class CKetapel extends MovieClip {
private var ACT_AIM;// = "aim"
private var _pause:Boolean;
private var isAiming:Boolean;
private var currentframe:int;
private var isDead:Boolean;
private var ACT_HIDE;// = "hide"
private var ACT_SHOOT;// = "shoot"
public function CKetapel(){
ACT_HIDE = "hide";
ACT_AIM = "aim";
ACT_SHOOT = "shoot";
super();
visible = false;
}
public function destroy(){
trace("CKetapel : destroy");
visible = false;
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMoves);
}
public function init(){
trace("CKetapel : init");
visible = true;
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoves);
isDead = false;
gotoAndStop(1);
}
public function restart(){
visible = true;
isDead = false;
}
public function shoot(){
if (_pause){
return;
};
isAiming = false;
if (isDead){
return;
};
CSound.getInstance().playSound(CSound.slingshot);
trace(("CKetapel " + this.name));
gotoAndPlay((currentframe + 5));
}
public function aim(){
if (_pause){
return;
};
if (isDead){
return;
};
isAiming = true;
CSound.getInstance().playSound(CSound.powerup);
gotoAndStop((currentframe + 5));
}
public function dead(){
isDead = true;
}
public function onMouseMoves(_arg1:MouseEvent){
var _local2:int;
if (_pause){
return;
};
if (isDead){
return;
};
_local2 = (180 - ((Math.atan((mouseX / mouseY)) / (Math.PI / 180)) + 90));
currentframe = (Math.floor((_local2 / 36)) * 15);
if (isAiming){
currentframe = (currentframe + 5);
};
gotoAndStop(currentframe);
}
public function setpause(){
_pause = true;
}
public function unpause(){
_pause = false;
}
}
}//package com.eps.mango.game
Section 10
//CMango (com.eps.mango.game.CMango)
package com.eps.mango.game {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class CMango extends MovieClip {
private var _pause:Boolean;// = false
private var ripetimer;
public var hit:Boolean;
public var dropped:Boolean;
public function CMango(){
_pause = false;
super();
init();
}
public function destroy(){
}
public function init(){
gotoAndPlay(1);
hit = false;
dropped = false;
x = ((Math.random() * 450) + 100);
y = ((Math.random() * 30) + 120);
ripetimer = new Timer(1000, 3);
}
public function mangoLoop(_arg1:Event){
if (_pause){
return;
};
_arg1.target.y = (_arg1.target.y + 3);
if (_arg1.target.y > 200){
dispatchEvent(new GameEvent(GameEvent.checkMangoCollision, null));
};
if ((((_arg1.target.y > 370)) || (hit))){
if (hit){
switch (ripelevel()){
case 0:
CSound.getInstance().playSound(CSound.inbasket2);
break;
case 1:
CSound.getInstance().playSound(CSound.inbasket2);
break;
case 2:
CSound.getInstance().playSound(CSound.inbasket2);
break;
case 3:
CSound.getInstance().playSound(CSound.inbasket4);
break;
};
} else {
CSound.getInstance().playSound(CSound.mangodrop);
};
removeEventListener(Event.ENTER_FRAME, mangoLoop);
dispatchEvent(new GameEvent(GameEvent.removeMango, null));
};
}
public function ripelevel():int{
if (currentFrame < 100){
return (0);
};
if ((((currentFrame >= 100)) && ((currentFrame < 200)))){
return (1);
};
if ((((currentFrame >= 200)) && ((currentFrame < 270)))){
return (2);
};
if (currentFrame >= 270){
return (3);
};
return (-1);
}
public function manggoRot(){
drop();
}
public function setpause(){
_pause = true;
stop();
trace(("CMAngo:setpause " + currentFrame));
}
public function drop(){
if (_pause){
return;
};
dropped = true;
stop();
addEventListener(Event.ENTER_FRAME, mangoLoop);
}
public function unpause(){
_pause = false;
play();
}
}
}//package com.eps.mango.game
Section 11
//CPenjaga (com.eps.mango.game.CPenjaga)
package com.eps.mango.game {
import flash.display.*;
public class CPenjaga extends MovieClip {
private var _pause:Boolean;
public var isShooting:Boolean;
public function CPenjaga(){
visible = false;
}
public function destroy(){
gotoAndStop(1);
visible = false;
isShooting = false;
}
public function guardEndShot(){
if (_pause){
return;
};
stop();
dispatchEvent(new GameEvent(GameEvent.guardEndShot, null));
}
public function init(){
visible = true;
gotoAndPlay(1);
isShooting = false;
}
public function restart(){
init();
}
public function shoot(){
if (_pause){
return;
};
gotoAndPlay("bangun");
isShooting = true;
}
public function guardShot(){
if (_pause){
return;
};
dispatchEvent(new GameEvent(GameEvent.guardShot, null));
}
public function cancelShot(){
if (_pause){
return;
};
gotoAndPlay("sitagain");
isShooting = false;
}
public function setpause(){
_pause = true;
stop();
}
public function unpause(){
_pause = false;
play();
}
}
}//package com.eps.mango.game
Section 12
//CRock2 (com.eps.mango.game.CRock2)
package com.eps.mango.game {
import flash.display.*;
import flash.events.*;
public class CRock2 extends MovieClip {
private var ysling:int;// = 420
private var gravity:int;
private var xsling:int;// = 320
private var dirx:int;
private var hit:Boolean;
private var diry:int;
private var angle:int;
public function CRock2(){
xsling = 320;
ysling = 420;
super();
gravity = 10;
hit = false;
}
public function throwRock(_arg1:int, _arg2:int, _arg3:int){
var _local4:int;
_arg3 = ((_arg3 + 100) * 2);
trace(_arg3);
_arg1 = (_arg1 - xsling);
_arg2 = ((_arg2 - ysling) * -1);
angle = (Math.atan((_arg2 / _arg1)) / (Math.PI / 180));
if (_arg1 < 0){
angle = (angle + 180);
};
if ((((_arg1 >= 0)) && ((_arg2 < 0)))){
angle = (angle + 360);
};
if (angle > 160){
angle = 160;
};
if (angle < 20){
angle = 20;
};
_local4 = (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))) + _arg3);
if (_local4 > 2000){
_local4 = 2000;
};
angle = (angle * -1);
x = xsling;
y = ysling;
dirx = (Math.cos(((angle * Math.PI) / 180)) * _local4);
diry = (Math.sin(((angle * Math.PI) / 180)) * _local4);
addEventListener(Event.ENTER_FRAME, rockloop);
}
public function rockloop(_arg1:Event){
diry = (diry + gravity);
x = (x + (dirx * 0.01));
y = (y + (diry * 0.01));
if (y < 175){
if (y > 85){
dispatchEvent(new Event("checkRockCollision"));
};
};
if ((((((((((y < 0)) || ((y > 480)))) || ((x < 0)))) || ((x > 640)))) || (hit))){
removeEventListener(Event.ENTER_FRAME, rockloop);
dispatchEvent(new Event("removeRock"));
};
}
}
}//package com.eps.mango.game
Section 13
//CSound (com.eps.mango.game.CSound)
package com.eps.mango.game {
import flash.media.*;
public class CSound {
private var sdmangodrop:Cmangodrop;
private var sdmangoshot:Cmangoshot;
private var channel1:SoundChannel;
private var channel3:SoundChannel;
private var channel4:SoundChannel;
private var channel5:SoundChannel;
private var sdgameover:Cgameover;
private var channel2:SoundChannel;
private var sdbg_menu:Cbg_menu;
private var sdguardshoot:Cguardshoot;
private var sdslingshot:Cslingshot;
private var sdlangkah:Clangkah;
private var sdsupercombo2:CSupercombo2;
private var sdinbasket2:Cinbasket2;
private var sdinbasket3:Cinbasket3;
private var sdinbasket4:Cinbasket4;
private var sdsupercombo6:CSupercombo6;
private var sdbg_game:Cbg_game;
private var sdinbasket1:Cinbasket1;
private var sdc1:Cc1;
private var sdc2:Cc2;
private var sdc3:Cc3;
private var sdc4:Cc4;
private var sdbutton:Cbutton;
private var sdmati:Cmati;
private var sdbangun:Cbangun;
private var sdbuttonbuy:Cbuttonbuy;
private var sdpowerup:Cbutton;
private var sdbg_screen:Cbg_screen;
private var sdbuttonupgrade:Cbuttonupgrade;
public static const mati:String = "mati";
public static const buttonbuy:String = "buttonbuy";
public static const bg_menu:String = "bg_menu";
public static const guardshoot:String = "guardshoot";
public static const supercombo2:String = "Supercombo2";
public static const supercombo6:String = "Supercombo6";
public static const langkah:String = "langkah";
public static const bg_screen:String = "bg_screen";
public static const buttonupgrade:String = "buttonupgrade";
public static const bg_game:String = "bg_game";
public static const c1:String = "c1";
public static const c2:String = "c2";
public static const c3:String = "c3";
public static const c4:String = "c4";
public static const button:String = "button";
public static const mangodrop:String = "mangodrop";
public static const mangoshot:String = "mangoshot";
public static const gameover:String = "gameover";
public static const bangun:String = "bangun";
public static const slingshot:String = "slingshot";
public static const inbasket1:String = "inbasket1";
public static const powerup:String = "powerup";
public static const inbasket3:String = "inbasket3";
public static const inbasket4:String = "inbasket4";
public static const inbasket2:String = "inbasket2";
private static var instance:CSound = new (CSound);
;
public function CSound(){
sdbangun = new Cbangun();
sdbg_game = new Cbg_game();
sdbg_menu = new Cbg_menu();
sdbutton = new Cbutton();
sdguardshoot = new Cguardshoot();
sdlangkah = new Clangkah();
sdmangoshot = new Cmangoshot();
sdmati = new Cmati();
sdpowerup = new Cbutton();
sdslingshot = new Cslingshot();
sdinbasket1 = new Cinbasket1();
sdinbasket2 = new Cinbasket2();
sdinbasket3 = new Cinbasket3();
sdinbasket4 = new Cinbasket4();
sdbg_screen = new Cbg_screen();
sdgameover = new Cgameover();
sdmangodrop = new Cmangodrop();
sdbuttonbuy = new Cbuttonbuy();
sdbuttonupgrade = new Cbuttonupgrade();
sdc1 = new Cc1();
sdc2 = new Cc2();
sdc3 = new Cc3();
sdc4 = new Cc4();
sdsupercombo2 = new CSupercombo2();
sdsupercombo6 = new CSupercombo6();
channel1 = new SoundChannel();
channel2 = new SoundChannel();
channel3 = new SoundChannel();
channel4 = new SoundChannel();
channel5 = new SoundChannel();
super();
if (instance){
throw (new Error("It is a Singleton and can only be accessed through Singleton.getInstance()"));
};
}
public function stopSound(_arg1:String){
if (_arg1 == bangun){
channel1.stop();
};
if (_arg1 == bg_game){
channel2.stop();
};
if (_arg1 == bg_menu){
channel3.stop();
};
if (_arg1 == button){
channel1.stop();
};
if (_arg1 == guardshoot){
channel1.stop();
};
if (_arg1 == langkah){
channel1.stop();
};
if (_arg1 == mangoshot){
channel1.stop();
};
if (_arg1 == mati){
channel1.stop();
};
if (_arg1 == powerup){
channel1.stop();
};
if (_arg1 == slingshot){
channel1.stop();
};
if (_arg1 == inbasket1){
channel1.stop();
};
if (_arg1 == inbasket2){
channel1.stop();
};
if (_arg1 == inbasket3){
channel1.stop();
};
if (_arg1 == inbasket4){
channel1.stop();
};
if (_arg1 == bg_screen){
channel4.stop();
};
if (_arg1 == gameover){
channel1.stop();
};
if (_arg1 == mangodrop){
channel1.stop();
};
if (_arg1 == buttonbuy){
channel1.stop();
};
if (_arg1 == buttonupgrade){
channel1.stop();
};
if (_arg1 == c1){
channel1 = sdc1.stop();
};
if (_arg1 == c2){
channel1 = sdc2.stop();
};
if (_arg1 == c3){
channel1 = sdc3.stop();
};
if (_arg1 == c4){
channel1 = sdc4.stop();
};
if (_arg1 == supercombo2){
channel1 = sdsupercombo2.stop();
};
if (_arg1 == supercombo6){
channel1 = sdsupercombo6.stop();
};
}
public function playSound(_arg1:String){
if (_arg1 == bangun){
channel1 = sdbangun.play();
};
if (_arg1 == bg_game){
channel2.stop();
channel2 = sdbg_game.play(0, 100);
channel2.soundTransform.volume = 1;
};
if (_arg1 == bg_menu){
channel3 = sdbg_menu.play(0, 100);
};
if (_arg1 == button){
channel1 = sdbutton.play();
};
if (_arg1 == guardshoot){
channel1 = sdguardshoot.play();
};
if (_arg1 == langkah){
channel1 = sdlangkah.play();
};
if (_arg1 == mangoshot){
channel1 = sdmangoshot.play();
};
if (_arg1 == mati){
channel1 = sdmati.play();
};
if (_arg1 == powerup){
channel1 = sdpowerup.play();
};
if (_arg1 == slingshot){
channel1 = sdslingshot.play();
};
if (_arg1 == inbasket1){
channel1 = sdinbasket1.play();
};
if (_arg1 == inbasket2){
channel1 = sdinbasket2.play();
};
if (_arg1 == inbasket3){
channel1 = sdinbasket3.play();
};
if (_arg1 == inbasket4){
channel1 = sdinbasket4.play();
};
if (_arg1 == bg_screen){
channel4 = sdbg_screen.play(0, 100);
};
if (_arg1 == gameover){
channel1 = sdgameover.play();
};
if (_arg1 == mangodrop){
channel1 = sdmangodrop.play();
};
if (_arg1 == buttonbuy){
channel1 = sdbuttonbuy.play();
};
if (_arg1 == buttonupgrade){
channel1 = sdbuttonupgrade.play();
};
if (_arg1 == c1){
channel1 = sdc1.play();
};
if (_arg1 == c2){
channel1 = sdc2.play();
};
if (_arg1 == c3){
channel1 = sdc3.play();
};
if (_arg1 == c4){
channel1 = sdc4.play();
};
if (_arg1 == supercombo2){
channel1 = sdsupercombo2.play();
};
if (_arg1 == supercombo6){
channel1 = sdsupercombo6.play();
};
}
public function hideSound(_arg1:String){
var _local2:SoundTransform;
if (_arg1 == bg_game){
_local2 = channel2.soundTransform;
_local2.volume = 0.01;
channel2.soundTransform = _local2;
};
}
public static function getInstance():CSound{
return (instance);
}
}
}//package com.eps.mango.game
Section 14
//GameEvent (com.eps.mango.game.GameEvent)
package com.eps.mango.game {
import flash.events.*;
public class GameEvent extends Event {
public var params:Object;
public static const guardShot:String = "guardShot";
public static const endGameMessage:String = "endGameMessage";
public static const removeRock:String = "removeRock";
public static const catcherHide:String = "catcherHide";
public static const onCatcherDead:String = "onCatcherDead";
public static const guardEndShot:String = "guardEndShot";
public static const onNewGame:String = "onNewGame";
public static const removeMango:String = "removeMango";
public static const catcherGetOut:String = "catcherGetOut";
public static const wakeGuard:String = "wakeGuard";
public static const onGameOver:String = "onGameOver";
public static const endTutorial:String = "endTutorial";
public static const checkRockCollision:String = "checkRockCollision";
public static const onCombo:String = "onCombo";
public static const endGame:String = "endGame";
public static const checkMangoCollision:String = "checkMangoCollision";
public static const levelUp:String = "levelUp";
public function GameEvent(_arg1:String, _arg2:Object){
super(_arg1);
this.params = _arg2;
}
override public function toString():String{
return (formatToString("GameEvent", "type", "bubbles", "cancelable", "eventPhase", "params"));
}
override public function clone():Event{
return (new GameEvent(this.type, this.params));
}
}
}//package com.eps.mango.game
Section 15
//Application (com.eps.mango.Application)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import com.eps.mango.game.*;
import mochi.*;
public class Application extends MovieClip {
private var gsm:CGameSession;
private var SC_BUYSCREEN;// = "buyscreen"
private var scm:CScreenManager;
private var SC_GAMESCREEN;// = "gamescreen"
public var _mochiad:MovieClip;
private var SC_HELPSCREEN;// = "helpscreen"
public var _mochiad_loaded:Boolean;
public var clip:MovieClip;
private var SC_PRELOADERSCREEN;// = "preloaderscreen"
public var progressBar:MovieClip;
private var SC_HIGHSCORESCREEN;// = "highscorescreen"
private var SC_CREDITSSCREEN;// = "creditsscreen"
private var SC_SUMMARYSCREEN;// = "summaryscreen"
private var SC_ENDSCREEN;// = "endscreen"
private var SC_MAINMENUSCREEN;// = "mainmenuscreen"
public var momo:MovieClip;
private var SC_TITLINGSCREEN;// = "titlingscreen"
public static const ENTRY_FRAME:Number = 3;
public static const DocCTitlingScreen:String = "CTitlingScreen";
public static const DocCBuyScreen:String = "CBuyScreen";
public static const DocCGameScreen:String = "CGameScreen";
public static const DocCMainMenuScreen:String = "CMainMenuScreen";
public static const DocCHighScoreScreen:String = "CHighScoreScreen";
public static const DocCSummaryScreen:String = "CSummaryScreen";
public static const DocCHelpScreen:String = "CHelpScreen";
public static const DocCCreditsScreen:String = "CCreditsScreen";
public static const DocCEndScreen:String = "CEndScreen";
public function Application(){
SC_BUYSCREEN = "buyscreen";
SC_ENDSCREEN = "endscreen";
SC_GAMESCREEN = "gamescreen";
SC_HELPSCREEN = "helpscreen";
SC_HIGHSCORESCREEN = "highscorescreen";
SC_MAINMENUSCREEN = "mainmenuscreen";
SC_PRELOADERSCREEN = "preloaderscreen";
SC_SUMMARYSCREEN = "summaryscreen";
SC_CREDITSSCREEN = "creditsscreen";
SC_TITLINGSCREEN = "titlingscreen";
super();
MochiBot.track(this, "4dce066e");
progressBar.visible = true;
stop();
loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
loaderInfo.addEventListener(Event.COMPLETE, completeHandler);
scm = new CScreenManager(stage);
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function enterFrameHandler(_arg1:Event):void{
if (currentFrame >= _slot1.ENTRY_FRAME){
removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
stop();
RegisterScreens();
MochiServices.connect("8fd5582912e4199a", scm.getScreen(SC_HIGHSCORESCREEN));
MochiScores.setBoardID("80a28ba923ecb005");
StartApp();
};
}
private function RegisterScreens(){
var _local1:Class;
var _local2:CBuyScreen;
var _local3:Class;
var _local4:CTitlingScreen;
var _local5:Class;
var _local6:CGameScreen;
var _local7:Class;
var _local8:CMainMenuScreen;
var _local9:Class;
var _local10:CEndScreen;
var _local11:Class;
var _local12:CHelpScreen;
var _local13:Class;
var _local14:CHighScoreScreen;
var _local15:Class;
var _local16:CSummaryScreen;
var _local17:Class;
var _local18:CCreditsScreen;
_local1 = (loaderInfo.applicationDomain.getDefinition(_slot1.DocCBuyScreen) as Class);
_local2 = (new (_local1) as CBuyScreen);
scm.addScreen(SC_BUYSCREEN, (_local2 as CScreen), true);
_local3 = (loaderInfo.applicationDomain.getDefinition(_slot1.DocCTitlingScreen) as Class);
_local4 = (new (_local3) as CTitlingScreen);
scm.addScreen(SC_TITLINGSCREEN, (_local4 as CScreen), true);
_local5 = (loaderInfo.applicationDomain.getDefinition(_slot1.DocCGameScreen) as Class);
_local6 = (new (_local5) as CGameScreen);
scm.addScreen(SC_GAMESCREEN, (_local6 as CScreen), true);
_local7 = (loaderInfo.applicationDomain.getDefinition(_slot1.DocCMainMenuScreen) as Class);
_local8 = (new (_local7) as CMainMenuScreen);
scm.addScreen(SC_MAINMENUSCREEN, (_local8 as CScreen), true);
_local9 = (loaderInfo.applicationDomain.getDefinition(_slot1.DocCEndScreen) as Class);
_local10 = (new (_local9) as CEndScreen);
scm.addScreen(SC_ENDSCREEN, (_local10 as CScreen), true);
_local11 = (loaderInfo.applicationDomain.getDefinition(_slot1.DocCHelpScreen) as Class);
_local12 = (new (_local11) as CHelpScreen);
scm.addScreen(SC_HELPSCREEN, (_local12 as CScreen), true);
_local13 = (loaderInfo.applicationDomain.getDefinition(_slot1.DocCHighScoreScreen) as Class);
_local14 = (new (_local13) as CHighScoreScreen);
scm.addScreen(SC_HIGHSCORESCREEN, (_local14 as CScreen), true);
_local15 = (loaderInfo.applicationDomain.getDefinition(_slot1.DocCSummaryScreen) as Class);
_local16 = (new (_local15) as CSummaryScreen);
scm.addScreen(SC_SUMMARYSCREEN, (_local16 as CScreen), true);
_local17 = (loaderInfo.applicationDomain.getDefinition(_slot1.DocCCreditsScreen) as Class);
_local18 = (new (_local17) as CCreditsScreen);
scm.addScreen(SC_CREDITSSCREEN, (_local18 as CScreen), true);
}
private function progressHandler(_arg1:ProgressEvent):void{
var _local2:int;
_local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100);
progressBar.gotoAndStop(_local2);
progressBar.textProgressBar.text = (_local2 + " %");
}
private function StartApp(){
stage.showDefaultContextMenu = false;
scm.start(SC_TITLINGSCREEN);
}
private function completeHandler(_arg1:Event):void{
trace("Application:completeHandler");
play();
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package com.eps.mango
Section 16
//CBuyScreen (com.eps.mango.CBuyScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import com.eps.mango.game.*;
import flash.text.*;
public class CBuyScreen extends CScreen {
public var lv1_sepatu:MovieClip;
public var txMessage:TextField;
public var lv1_live:MovieClip;
public var btCancel:SimpleButton;
public var btNext:SimpleButton;
public var lv3_sepatu:MovieClip;
public var lv2_sepatu:MovieClip;
public var txTotalBalance:TextField;
public var lv2_keranjang:MovieClip;
public var btBuy:SimpleButton;
public var lv1_keranjang:MovieClip;
override public function init(){
trace("Creating CBuyScreen");
txMessage.visible = false;
updateHUD();
btNext.addEventListener(MouseEvent.CLICK, clickHandler);
btBuy.addEventListener(MouseEvent.CLICK, clickHandler);
btCancel.visible = false;
lv1_keranjang.addEventListener(MouseEvent.CLICK, btClickHandler);
lv2_keranjang.addEventListener(MouseEvent.CLICK, btClickHandler);
lv1_sepatu.addEventListener(MouseEvent.CLICK, btClickHandler);
lv2_sepatu.addEventListener(MouseEvent.CLICK, btClickHandler);
lv3_sepatu.addEventListener(MouseEvent.CLICK, btClickHandler);
lv1_live.addEventListener(MouseEvent.CLICK, btClickHandler);
}
private function btClickHandler(_arg1:MouseEvent){
var _local2:MovieClip;
CSound.getInstance().playSound(CSound.buttonbuy);
txMessage.visible = false;
_local2 = MovieClip(_arg1.target);
if (_local2.name == lv1_keranjang.name){
makeswitch(lv1_keranjang);
};
if (_local2.name == lv2_keranjang.name){
makeswitch(lv2_keranjang);
};
if (_local2.name == lv1_sepatu.name){
makeswitch(lv1_sepatu);
};
if (_local2.name == lv2_sepatu.name){
makeswitch(lv2_sepatu);
};
if (_local2.name == lv3_sepatu.name){
makeswitch(lv3_sepatu);
};
if (_local2.name == lv1_live.name){
makeswitch(lv1_live);
};
}
private function updateHUD(){
var _local1:CGameSession;
_local1 = CGameSession.getInstance();
txTotalBalance.text = String(_local1.money);
lv1_keranjang.gotoAndStop(1);
lv2_keranjang.gotoAndStop(1);
if (_local1.bucketlevel > 1){
lv1_keranjang.gotoAndStop(3);
};
if (_local1.bucketlevel > 2){
lv2_keranjang.gotoAndStop(3);
};
lv1_live.gotoAndStop(1);
lv1_sepatu.gotoAndStop(1);
lv2_sepatu.gotoAndStop(1);
lv3_sepatu.gotoAndStop(1);
if (_local1.shoeslevel > 0){
lv1_sepatu.gotoAndStop(3);
};
if (_local1.shoeslevel > 1){
lv2_sepatu.gotoAndStop(3);
};
if (_local1.shoeslevel > 2){
lv3_sepatu.gotoAndStop(3);
};
}
private function makeswitch(_arg1:MovieClip){
if (_arg1.currentFrame == 3){
return;
};
if (_arg1.currentFrame == 2){
_arg1.gotoAndStop(1);
return;
};
if (_arg1.currentFrame == 1){
_arg1.gotoAndStop(2);
return;
};
}
public function clickHandler(_arg1:MouseEvent){
var _local2:SimpleButton;
var _local3:CGameSession;
var _local4:Number;
_local2 = SimpleButton(_arg1.target);
if (_local2.name == btNext.name){
CSound.getInstance().playSound(CSound.button);
CSound.getInstance().stopSound(CSound.bg_screen);
this.nextScreenName = "gamescreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
};
if (_local2.name == btBuy.name){
CSound.getInstance().playSound(CSound.buttonupgrade);
_local3 = CGameSession.getInstance();
_local4 = 0;
if (lv1_keranjang.currentFrame == 2){
_local4 = (_local4 + 50);
};
if (lv2_keranjang.currentFrame == 2){
_local4 = (_local4 + 100);
};
if (lv1_sepatu.currentFrame == 2){
_local4 = (_local4 + 50);
};
if (lv2_sepatu.currentFrame == 2){
_local4 = (_local4 + 100);
};
if (lv3_sepatu.currentFrame == 2){
_local4 = (_local4 + 150);
};
if (lv1_live.currentFrame == 2){
_local4 = (_local4 + 200);
};
if (_local3.money >= _local4){
_local3.money = (_local3.money - _local4);
if (lv1_keranjang.currentFrame == 2){
_local3.bucketlevel = 2;
};
if (lv2_keranjang.currentFrame == 2){
_local3.bucketlevel = 3;
};
if (lv1_sepatu.currentFrame == 2){
_local3.shoeslevel = 1;
};
if (lv2_sepatu.currentFrame == 2){
_local3.shoeslevel = 2;
};
if (lv3_sepatu.currentFrame == 2){
_local3.shoeslevel = 3;
};
if (lv1_live.currentFrame == 2){
_local3.lives++;
};
} else {
txMessage.visible = true;
};
updateHUD();
};
if (_local2.name == btCancel.name){
CSound.getInstance().playSound(CSound.button);
};
}
}
}//package com.eps.mango
Section 17
//CCreditsScreen (com.eps.mango.CCreditsScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import com.eps.mango.game.*;
public class CCreditsScreen extends CScreen {
public var mcText:MovieClip;
public var btContinue:SimpleButton;
override public function init(){
mcText.gotoAndPlay(1);
btContinue.addEventListener(MouseEvent.CLICK, clickContinue);
CSound.getInstance().playSound(CSound.bg_screen);
}
private function clickContinue(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
CSound.getInstance().stopSound(CSound.bg_screen);
nextScreenName = "mainmenuscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
override public function destroy(){
mcText.gotoAndStop(1);
btContinue.removeEventListener(MouseEvent.CLICK, clickContinue);
}
}
}//package com.eps.mango
Section 18
//CEndScreen (com.eps.mango.CEndScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import com.eps.mango.game.*;
import mochi.*;
import flash.text.*;
import flash.net.*;
public class CEndScreen extends CScreen {
public var btSubmit:SimpleButton;
public var btPlayMoreGames:SimpleButton;
public var txScore:TextField;
public var btPlayAgain:SimpleButton;
override public function init(){
var _local1:CGameSession;
btPlayAgain.addEventListener(MouseEvent.CLICK, clickHandler);
btSubmit.addEventListener(MouseEvent.CLICK, submitHandler);
btPlayMoreGames.addEventListener(MouseEvent.CLICK, clickPlayMoreGames);
_local1 = CGameSession.getInstance();
txScore.text = ("$ " + _local1.score.toString());
}
public function submitHandler(_arg1:MouseEvent){
if (!MochiServices.isNetworkAvailable()){
return;
};
CGameSession.getInstance().submitscore = true;
btSubmit.removeEventListener(MouseEvent.CLICK, submitHandler);
this.nextScreenName = "highscorescreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
public function clickHandler(_arg1:MouseEvent){
btPlayAgain.removeEventListener(MouseEvent.CLICK, clickHandler);
CSound.getInstance().playSound(CSound.button);
this.nextScreenName = "mainmenuscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
override public function destroy(){
btPlayAgain.removeEventListener(MouseEvent.CLICK, clickHandler);
btSubmit.removeEventListener(MouseEvent.CLICK, submitHandler);
btPlayMoreGames.removeEventListener(MouseEvent.CLICK, clickPlayMoreGames);
}
private function clickPlayMoreGames(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
navigateToURL(new URLRequest("http://www.net-games.biz"), "_blank");
trace("clickPlayMoreGames");
}
}
}//package com.eps.mango
Section 19
//CGameScreen (com.eps.mango.CGameScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import com.eps.mango.game.*;
import flash.text.*;
public class CGameScreen extends CScreen {
public var mcKetapel:CKetapel;
private var lives:int;
public var mcTutorial:MovieClip;
public var mcGameMessage:CGameMessage;
public var sky:MovieClip;
public var mcKeranjang:CKeranjang;
public var mcRiskBar:MovieClip;
public var mcPaused:MovieClip;
public var mcPenjaga:CPenjaga;
public var txDay:TextField;
public var mcPowerBar:MovieClip;
public var mcSpeaker:Speaker;
public var combo:CCombo;
private var mangocatched:int;
public var tutgame:Object;
public var txMoney:TextField;
private var firsttimer:Boolean;// = true
public var txTimeLimit:TextField;
public var txLiveLeft:TextField;
public var txMango:TextField;
private var money:int;
public var game;
public function CGameScreen(){
firsttimer = true;
super();
}
public function levelUpHandler(_arg1:Event){
this.nextScreenName = "summaryscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
override public function init(){
super.init();
if (firsttimer){
firsttimer = false;
tutgame = new CGameTutorial(this);
tutgame.addEventListener(GameEvent.endTutorial, endTutorialHandler);
} else {
CGameSession.getInstance().startGame();
game = new CGame(this);
game.addEventListener(GameEvent.endGame, endGameHandler);
game.addEventListener(GameEvent.levelUp, levelUpHandler);
};
}
public function endGameHandler(_arg1:Event){
this.nextScreenName = "endscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
public function endTutorialHandler(_arg1:Event){
tutgame.destroy();
tutgame = null;
CGameSession.getInstance().startGame();
game = new CGame(this);
game.addEventListener(GameEvent.endGame, endGameHandler);
game.addEventListener(GameEvent.levelUp, levelUpHandler);
}
override public function destroy(){
trace("CGameScreen: destroy ");
game.destroy();
game = null;
}
}
}//package com.eps.mango
Section 20
//CHelpScreen (com.eps.mango.CHelpScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import com.eps.mango.game.*;
public class CHelpScreen extends CScreen {
public var btContinue:SimpleButton;
public var helpcontent:MovieClip;
public var btNext:SimpleButton;
public var btPrev:SimpleButton;
override public function init(){
helpcontent.gotoAndStop(1);
setButtonListeners();
CSound.getInstance().playSound(CSound.bg_screen);
}
private function setButtonListeners(){
btPrev.addEventListener(MouseEvent.CLICK, clickPrev);
btNext.addEventListener(MouseEvent.CLICK, clickNext);
btContinue.addEventListener(MouseEvent.CLICK, clickContinue);
}
private function clickContinue(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
CSound.getInstance().stopSound(CSound.bg_screen);
_arg1.target.parent.nextScreenName = "mainmenuscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
private function clickNext(_arg1:MouseEvent){
var _local2:MovieClip;
CSound.getInstance().playSound(CSound.button);
_local2 = MovieClip(_arg1.target.parent);
if (_local2.helpcontent.currentFrame < _local2.helpcontent.totalFrames){
_local2.helpcontent.gotoAndStop((_local2.helpcontent.currentFrame + 1));
};
}
private function clickPrev(_arg1:MouseEvent){
var _local2:MovieClip;
CSound.getInstance().playSound(CSound.button);
_local2 = MovieClip(_arg1.target.parent);
if (_local2.helpcontent.currentFrame > 1){
_local2.helpcontent.gotoAndStop((_local2.helpcontent.currentFrame - 1));
};
}
}
}//package com.eps.mango
Section 21
//CHighScoreScreen (com.eps.mango.CHighScoreScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import com.eps.mango.game.*;
import mochi.*;
import flash.text.*;
import flash.net.*;
public class CHighScoreScreen extends CScreen {
public var txError:TextField;
public var btContinue:SimpleButton;
public var btPlayMoreGames:SimpleButton;
public var submitbox:MovieClip;
public var issubmit:Boolean;// = false
public function CHighScoreScreen(){
issubmit = false;
super();
}
override public function init(){
btContinue.visible = false;
btPlayMoreGames.addEventListener(MouseEvent.CLICK, clickPlayMoreGames);
if (CGameSession.getInstance().submitscore){
submitbox.yourScore.text = CGameSession.getInstance().score.toString();
submitbox.visible = true;
this.stage.focus = submitbox.name_tf;
submitbox.name_tf.setSelection(0, submitbox.name_tf.text.length);
submitbox.btn_submit.addEventListener(MouseEvent.CLICK, submitscore);
CGameSession.getInstance().submitscore = false;
} else {
CSound.getInstance().playSound(CSound.bg_screen);
submitbox.visible = false;
MochiScores.showLeaderboard({onClose:function ():void{
clickContinue(null);
}, onError:function ():void{
setButtonListeners();
}, res:"640x480", numScores:20});
};
}
private function setButtonListeners(){
txError.text = "Error Loading Leaderboards";
btContinue.visible = true;
btContinue.addEventListener(MouseEvent.CLICK, clickContinue);
}
private function clickContinue(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
CSound.getInstance().stopSound(CSound.bg_screen);
nextScreenName = "mainmenuscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
private function submitscore(_arg1:MouseEvent){
var score:Number;
var e = _arg1;
if (submitbox.name_tf.text == ""){
return;
};
score = CGameSession.getInstance().score;
submitbox.visible = false;
MochiScores.showLeaderboard({onClose:function ():void{
clickContinue(null);
}, onError:function ():void{
setButtonListeners();
}, res:"640x480", numScores:20, score:score, name:submitbox.name_tf.text});
submitbox.btn_submit.removeEventListener(MouseEvent.CLICK, submitscore);
submitbox.btn_submit.visible = false;
}
override public function destroy(){
btPlayMoreGames.removeEventListener(MouseEvent.CLICK, clickPlayMoreGames);
}
private function clickPlayMoreGames(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
navigateToURL(new URLRequest("http://www.net-games.biz"), "_blank");
}
}
}//package com.eps.mango
Section 22
//CMainMenuScreen (com.eps.mango.CMainMenuScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import com.eps.mango.game.*;
import mochi.*;
import flash.net.*;
public class CMainMenuScreen extends CScreen {
public var btPlayMoreGames:SimpleButton;
public var btPlay:SimpleButton;
public var btHelp:SimpleButton;
public var btAddThisGame:SimpleButton;
public var toScreen:String;
public var btHighScore:SimpleButton;
public var btCredits:SimpleButton;
private function clickPlay(_arg1:MouseEvent){
var _local2:Object;
CSound.getInstance().playSound(CSound.button);
CGameSession.getInstance().startGameSession();
nextScreenName = "gamescreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
_local2 = new Object();
_local2.target = this;
dispatchEvent(new GameEvent(GameEvent.onNewGame, _local2));
}
override public function init(){
CSound.getInstance().playSound(CSound.bg_menu);
setButtonListeners();
}
private function setButtonListeners(){
btHelp.addEventListener(MouseEvent.CLICK, clickHelp);
btHighScore.addEventListener(MouseEvent.CLICK, clickHighScore);
btAddThisGame.addEventListener(MouseEvent.CLICK, clickAddThisGame);
btPlayMoreGames.addEventListener(MouseEvent.CLICK, clickPlayMoreGames);
btPlay.addEventListener(MouseEvent.CLICK, clickPlay);
btCredits.addEventListener(MouseEvent.CLICK, clickCredits);
}
private function clickHighScore(_arg1:MouseEvent){
if (!MochiServices.isNetworkAvailable()){
return;
};
CSound.getInstance().playSound(CSound.button);
nextScreenName = "highscorescreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
private function unsetButtonListeners(){
btHelp.removeEventListener(MouseEvent.CLICK, clickHelp);
btHighScore.removeEventListener(MouseEvent.CLICK, clickHighScore);
btAddThisGame.removeEventListener(MouseEvent.CLICK, clickAddThisGame);
btPlayMoreGames.removeEventListener(MouseEvent.CLICK, clickPlayMoreGames);
btPlay.removeEventListener(MouseEvent.CLICK, clickPlay);
btCredits.removeEventListener(MouseEvent.CLICK, clickCredits);
}
private function clickAddThisGame(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
navigateToURL(new URLRequest("http://www.net-games.biz/downloads.php"), "_blank");
trace("clickAddThisGame");
}
private function clickHelp(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
nextScreenName = "helpscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
private function clickCredits(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
nextScreenName = "creditsscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
override public function destroy(){
trace("destropy");
unsetButtonListeners();
CSound.getInstance().stopSound(CSound.bg_menu);
}
private function clickPlayMoreGames(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
navigateToURL(new URLRequest("http://www.net-games.biz"), "_blank");
trace("clickPlayMoreGames");
}
}
}//package com.eps.mango
Section 23
//CPreLoaderScreen (com.eps.mango.CPreLoaderScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
public class CPreLoaderScreen extends CScreen {
public var wadahProgressBar:MovieClip;
override public function init(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
startLoading();
}
private function startLoading(){
}
private function onEnterFrame(_arg1:Event){
var _local2:MovieClip;
_local2 = MovieClip(_arg1.target);
if (_local2.wadahProgressBar.currentFrame >= 100){
_local2.wadahProgressBar.gotoAndStop(1);
_local2.stopLoading();
_local2.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
public function stopLoading(){
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
override public function destroy(){
}
}
}//package com.eps.mango
Section 24
//CSummaryScreen (com.eps.mango.CSummaryScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import com.eps.mango.game.*;
import flash.text.*;
public class CSummaryScreen extends CScreen {
public var txPriceCombo5:TextField;
public var txPriceCombo4:TextField;
public var btContinue:SimpleButton;
public var txPriceCombo3:TextField;
public var txPriceMango2:TextField;
public var txPriceMango3:TextField;
public var txPriceMango1:TextField;
public var txPriceMango4:TextField;
public var txLastBalance:TextField;
public var txTotalCombo4:TextField;
public var txTotalCombo5:TextField;
public var txTotalCombo6:TextField;
public var txTotalCombo3:TextField;
public var txTotalBalance:TextField;
public var txPriceCombo6:TextField;
public var txTotalMango1:TextField;
public var txTotalMango3:TextField;
public var txTotalMango4:TextField;
public var txTotalMango2:TextField;
override public function init(){
var _local1:CGameSession;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
CSound.getInstance().playSound(CSound.bg_screen);
btContinue.addEventListener(MouseEvent.CLICK, clickHandler);
_local1 = CGameSession.getInstance();
txTotalMango1.text = _local1.currentmangocatched[0];
txTotalMango2.text = _local1.currentmangocatched[1];
txTotalMango3.text = _local1.currentmangocatched[2];
txTotalMango4.text = _local1.currentmangocatched[3];
txTotalCombo3.text = String(_local1.currentcombo3);
txTotalCombo4.text = String(_local1.currentcombo4);
txTotalCombo5.text = String(_local1.currentcombo5);
txTotalCombo6.text = String(_local1.currentcombo6);
_local2 = (_local1.currentmangocatched[0] * 0.25);
_local3 = (_local1.currentmangocatched[1] * 0.5);
_local4 = _local1.currentmangocatched[2];
_local5 = (_local1.currentmangocatched[3] * -0.5);
_local6 = (_local1.currentcombo3 * 2);
_local7 = (_local1.currentcombo4 * 3);
_local8 = (_local1.currentcombo5 * 5);
_local9 = (_local1.currentcombo6 * 10);
txPriceMango1.text = String(_local2);
txPriceMango2.text = String(_local3);
txPriceMango3.text = String(_local4);
txPriceMango4.text = String(_local5);
txPriceCombo3.text = String(_local6);
txPriceCombo4.text = String(_local7);
txPriceCombo5.text = String(_local8);
txPriceCombo6.text = String(_local9);
txLastBalance.text = String(_local1.money);
_local1.money = ((((((((_local1.money + _local2) + _local3) + _local4) + _local5) + _local6) + _local7) + _local8) + _local9);
_local1.score = ((((((((_local1.score + _local2) + _local3) + _local4) + _local5) + _local6) + _local7) + _local8) + _local9);
txTotalBalance.text = String(_local1.money);
}
public function clickHandler(_arg1:MouseEvent){
CSound.getInstance().playSound(CSound.button);
this.nextScreenName = "buyscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
}
}//package com.eps.mango
Section 25
//CTitlingScreen (com.eps.mango.CTitlingScreen)
package com.eps.mango {
import flash.display.*;
import com.eps.application.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
public class CTitlingScreen extends CScreen {
var mytimer:Timer;
public var mcTitling:MovieClip;
public function endAnimation(){
stop();
nextScreenName = "mainmenuscreen";
dispatchEvent(new Event("callNextScreen"));
dispatchEvent(new Event("endScreen"));
}
override public function init(){
gotoAndPlay(2);
}
public function daftarButtons(){
trace("CTitlingScreen:daftarButtons");
mcTitling.btPlayGames.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.net-games.biz"), "_blank");
}
override public function destroy(){
}
}
}//package com.eps.mango
Section 26
//MochiScores (mochi.MochiScores)
package mochi {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public static function showLeaderboard(_arg1:Object=null):void{
var options = _arg1;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onDisplay.");
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
} else {
trace("Warning: Container is not a MovieClip, cannot call default onClose.");
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2);
}
public static function requestList(_arg1:Object, _arg2:Object=null):void{
MochiServices.send("scores_requestList", null, _arg1, _arg2);
}
public static function scoresArrayToObjects(_arg1:Object):Object{
var _local2:Object;
var _local3:Number;
var _local4:Number;
var _local5:Object;
var _local6:Object;
var _local7:String;
var _local8:String;
_local2 = {};
for (_local7 in _arg1) {
if (typeof(_arg1[_local7]) == "object"){
if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){
_local2[_local7] = [];
_local5 = _arg1[_local7];
_local4 = 0;
while (_local4 < _local5.rows.length) {
_local6 = {};
_local3 = 0;
while (_local3 < _local5.cols.length) {
_local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3];
_local3++;
};
_local2[_local7].push(_local6);
_local4++;
};
} else {
_local2[_local7] = {};
for (_local8 in _arg1[_local7]) {
_local2[_local7][_local8] = _arg1[_local7][_local8];
};
};
} else {
_local2[_local7] = _arg1[_local7];
};
};
return (_local2);
}
public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{
MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4);
}
public static function onClose(_arg1:Object=null):void{
if (_arg1 != null){
if (_arg1.error != null){
if (_arg1.error == true){
if (onErrorHandler != null){
if (_arg1.errorCode == null){
_arg1.errorCode = "IOError";
};
onErrorHandler(_arg1.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(_arg1:String):void{
MochiScores.boardID = _arg1;
MochiServices.send("scores_setBoardID", {boardID:_arg1});
}
}
}//package mochi
Section 27
//MochiServices (mochi.MochiServices)
package mochi {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
private static var _sendChannel:LocalConnection;
private static var _rcvChannelName:String;
private static var _gatewayURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _startTime:Number;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__mochiservices";
private static var _rcvChannel:LocalConnection;
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(_arg2, _arg3, _arg4);
flush(true);
return;
};
_clip._queue.push({methodName:_arg1, args:_arg2, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:_arg3, callbackMethod:_arg4};
_clip._nextcallbackID++;
};
};
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(_arg1:Boolean):void{
var _local2:Object;
var _local3:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
_local2 = _clip._queue.shift();
_local3 = null;
if (_local2 != null){
if (_local2.callbackID != null){
_local3 = _clip._callbacks[_local2.callbackID];
};
delete _clip._callbacks[_local2.callbackID];
if (((_arg1) && (!((_local3 == null))))){
handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod);
};
};
};
};
};
}
private static function init(_arg1:String, _arg2:Object):void{
_id = _arg1;
if (_arg2 != null){
_container = _arg2;
loadCommunicator(_arg1, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
public static function get id():String{
return (_id);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function getVersion():String{
return ("1.2");
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
try {
_listenChannel.close();
_rcvChannel.close();
} catch(error:Error) {
};
};
if (_timer != null){
try {
_timer.stop();
} catch(error:Error) {
};
};
}
public static function allowDomains(_arg1:String):String{
var _local2:String;
Security.allowDomain("*");
Security.allowInsecureDomain("*");
if (_arg1.indexOf("http://") != -1){
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain(_local2);
Security.allowInsecureDomain(_local2);
};
return (_local2);
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{
if (_arg1 != null){
if ((_arg1 is Sprite)){
_container = _arg1;
};
};
if (_arg2){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function onStatus(_arg1:StatusEvent):void{
switch (_arg1.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion()});
_rcvChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (_arg1:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var obj:Object;
var pkg = _arg1;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
if (obj[method] != null){
method = obj[method];
} else {
trace((("Error: Method " + method) + " does not exist."));
};
};
if (method != undefined){
try {
method.apply(obj, pkg.args);
} catch(error:Error) {
trace("Unable to invoke callback method.");
};
} else {
if (obj != null){
try {
obj(pkg.args);
} catch(error:Error) {
trace("Unable to invoke callback method on object.");
};
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (_arg1:Object):void{
MochiServices.comChannelName = _arg1.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{
var args = _arg1;
var callbackObject = _arg2;
var callbackMethod = _arg3;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
try {
var _local5 = callbackObject;
_local5[callbackMethod](args);
} catch(error:Error) {
};
} else {
if (callbackMethod != null){
try {
callbackMethod.apply(args);
} catch(error:Error) {
};
};
};
};
}
public static function get clip():Object{
return (_container);
}
public static function set comChannelName(_arg1:String):void{
if (_arg1 != null){
if (_arg1.length > 3){
_sendChannelName = (_arg1 + "_fromgame");
_rcvChannelName = _arg1;
initComChannels();
};
};
}
private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var id = _arg1;
var clip = _arg2;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
MochiServices.allowDomains(_gatewayURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
_timer = new Timer(1000, 0);
_startTime = getTimer();
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
f = function (_arg1:Object):void{
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_gatewayURL);
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain("*", "localhost");
_rcvChannel.allowInsecureDomain("*", "localhost");
_rcvChannel.client = _clip;
_clip._nextcallbackID = 0;
_clip._callbacks = {};
listen();
return (_clip);
}
public static function bringToTop(_arg1:Event):void{
var e = _arg1;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
try {
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
} catch(errorObject:Error) {
trace("Warning: Depth sort error.");
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
};
}
public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{
var id = _arg1;
var clip = _arg2;
var onError = _arg3;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
};
} else {
trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage.");
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (_arg1:String):void{
trace(_arg1);
};
};
};
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Boolean=true):MovieClip{
var _local5:MovieClip;
_local5 = new MovieClip();
if (_arg4){
if (((false) && (_arg3))){
_arg1.addChildAt(_local5, _arg3);
} else {
_arg1.addChild(_local5);
};
};
_arg1[_arg2] = _local5;
_local5["_name"] = _arg2;
return (_local5);
}
public static function connectWait(_arg1:TimerEvent):void{
if ((getTimer() - _startTime) > 10000){
if (!_connected){
_clip._mochiad_ctr_failed = true;
trace("MochiServices could not load.");
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_timer.stop();
};
}
}
}//package mochi
Section 28
//bar_power_34 (StealingMango_fla.bar_power_34)
package StealingMango_fla {
import flash.display.*;
public dynamic class bar_power_34 extends MovieClip {
public function bar_power_34(){
addFrameScript(30, frame31);
}
function frame31(){
stop();
}
}
}//package StealingMango_fla
Section 29
//bar_risk_33 (StealingMango_fla.bar_risk_33)
package StealingMango_fla {
import flash.display.*;
import flash.events.*;
public dynamic class bar_risk_33 extends MovieClip {
public function bar_risk_33(){
addFrameScript(119, frame120);
}
function frame120(){
dispatchEvent(new Event("wakeGuard"));
stop();
}
}
}//package StealingMango_fla
Section 30
//gameMessageInside_41 (StealingMango_fla.gameMessageInside_41)
package StealingMango_fla {
import flash.display.*;
import flash.text.*;
public dynamic class gameMessageInside_41 extends MovieClip {
public var txMessage:TextField;
public var txMessage2:TextField;
}
}//package StealingMango_fla
Section 31
//MainTitling_68 (StealingMango_fla.MainTitling_68)
package StealingMango_fla {
import flash.display.*;
public dynamic class MainTitling_68 extends MovieClip {
public var btPlayGames:SimpleButton;
public var mcNetGames:MovieClip;
public function MainTitling_68(){
addFrameScript(269, frame270);
}
function frame270(){
stop();
}
}
}//package StealingMango_fla
Section 32
//progres_1 (StealingMango_fla.progres_1)
package StealingMango_fla {
import flash.display.*;
import flash.text.*;
public dynamic class progres_1 extends MovieClip {
public var textProgressBar:TextField;
}
}//package StealingMango_fla
Section 33
//sdassset_66 (StealingMango_fla.sdassset_66)
package StealingMango_fla {
import flash.display.*;
public dynamic class sdassset_66 extends MovieClip {
public function sdassset_66(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package StealingMango_fla
Section 34
//sky_30 (StealingMango_fla.sky_30)
package StealingMango_fla {
import flash.display.*;
public dynamic class sky_30 extends MovieClip {
public function sky_30(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package StealingMango_fla
Section 35
//submitbox_64 (StealingMango_fla.submitbox_64)
package StealingMango_fla {
import flash.display.*;
import flash.text.*;
public dynamic class submitbox_64 extends MovieClip {
public var yourScore:TextField;
public var btn_submit:SimpleButton;
public var name_tf:TextField;
}
}//package StealingMango_fla
Section 36
//tutorial_42 (StealingMango_fla.tutorial_42)
package StealingMango_fla {
import flash.display.*;
public dynamic class tutorial_42 extends MovieClip {
public var btSkip:SimpleButton;
}
}//package StealingMango_fla
Section 37
//txcredit_13 (StealingMango_fla.txcredit_13)
package StealingMango_fla {
import flash.display.*;
public dynamic class txcredit_13 extends MovieClip {
public function txcredit_13(){
addFrameScript(0, frame1, 118, frame119);
}
function frame1(){
stop();
}
function frame119(){
gotoAndPlay(2);
}
}
}//package StealingMango_fla
Section 38
//Catcher (Catcher)
package {
import flash.display.*;
public dynamic class Catcher extends MovieClip {
public function Catcher(){
addFrameScript(11, frame12, 20, frame21);
}
function frame12(){
gotoAndPlay("run");
}
function frame21(){
stop();
}
}
}//package
Section 39
//Cbangun (Cbangun)
package {
import flash.media.*;
public dynamic class Cbangun extends Sound {
}
}//package
Section 40
//Cbg_game (Cbg_game)
package {
import flash.media.*;
public dynamic class Cbg_game extends Sound {
}
}//package
Section 41
//Cbg_menu (Cbg_menu)
package {
import flash.media.*;
public dynamic class Cbg_menu extends Sound {
}
}//package
Section 42
//Cbg_screen (Cbg_screen)
package {
import flash.media.*;
public dynamic class Cbg_screen extends Sound {
}
}//package
Section 43
//Cbutton (Cbutton)
package {
import flash.media.*;
public dynamic class Cbutton extends Sound {
}
}//package
Section 44
//Cbuttonbuy (Cbuttonbuy)
package {
import flash.media.*;
public dynamic class Cbuttonbuy extends Sound {
}
}//package
Section 45
//Cbuttonupgrade (Cbuttonupgrade)
package {
import flash.media.*;
public dynamic class Cbuttonupgrade extends Sound {
}
}//package
Section 46
//CBuyScreen (CBuyScreen)
package {
import com.eps.mango.*;
public dynamic class CBuyScreen extends CBuyScreen {
}
}//package
Section 47
//Cc1 (Cc1)
package {
import flash.media.*;
public dynamic class Cc1 extends Sound {
}
}//package
Section 48
//Cc2 (Cc2)
package {
import flash.media.*;
public dynamic class Cc2 extends Sound {
}
}//package
Section 49
//Cc3 (Cc3)
package {
import flash.media.*;
public dynamic class Cc3 extends Sound {
}
}//package
Section 50
//Cc4 (Cc4)
package {
import flash.media.*;
public dynamic class Cc4 extends Sound {
}
}//package
Section 51
//CCombo (CCombo)
package {
import flash.display.*;
import flash.events.*;
public dynamic class CCombo extends MovieClip {
public function CCombo(){
addFrameScript(0, frame1, 45, frame46, 83, frame84, 120, frame121, 157, frame158);
}
function frame158(){
dispatchEvent(new Event("endCombo"));
}
function frame84(){
dispatchEvent(new Event("endCombo"));
}
function frame1(){
stop();
}
function frame46(){
dispatchEvent(new Event("endCombo"));
}
function frame121(){
dispatchEvent(new Event("endCombo"));
}
}
}//package
Section 52
//CCreditsScreen (CCreditsScreen)
package {
import com.eps.mango.*;
public dynamic class CCreditsScreen extends CCreditsScreen {
}
}//package
Section 53
//CEndScreen (CEndScreen)
package {
import com.eps.mango.*;
public dynamic class CEndScreen extends CEndScreen {
}
}//package
Section 54
//CGameMessage (CGameMessage)
package {
import com.eps.mango.game.*;
public dynamic class CGameMessage extends CGameMessage {
public function CGameMessage(){
addFrameScript(0, frame1, 136, frame137);
}
function frame1(){
stop();
}
function frame137(){
endAnimation();
}
}
}//package
Section 55
//Cgameover (Cgameover)
package {
import flash.media.*;
public dynamic class Cgameover extends Sound {
}
}//package
Section 56
//CGameScreen (CGameScreen)
package {
import com.eps.mango.*;
public dynamic class CGameScreen extends CGameScreen {
}
}//package
Section 57
//Cguardshoot (Cguardshoot)
package {
import flash.media.*;
public dynamic class Cguardshoot extends Sound {
}
}//package
Section 58
//CHelpScreen (CHelpScreen)
package {
import com.eps.mango.*;
public dynamic class CHelpScreen extends CHelpScreen {
}
}//package
Section 59
//CHighScoreScreen (CHighScoreScreen)
package {
import com.eps.mango.*;
public dynamic class CHighScoreScreen extends CHighScoreScreen {
}
}//package
Section 60
//Cinbasket1 (Cinbasket1)
package {
import flash.media.*;
public dynamic class Cinbasket1 extends Sound {
}
}//package
Section 61
//Cinbasket2 (Cinbasket2)
package {
import flash.media.*;
public dynamic class Cinbasket2 extends Sound {
}
}//package
Section 62
//Cinbasket3 (Cinbasket3)
package {
import flash.media.*;
public dynamic class Cinbasket3 extends Sound {
}
}//package
Section 63
//Cinbasket4 (Cinbasket4)
package {
import flash.media.*;
public dynamic class Cinbasket4 extends Sound {
}
}//package
Section 64
//CKeranjang (CKeranjang)
package {
import com.eps.mango.game.*;
public dynamic class CKeranjang extends CKeranjang {
public function CKeranjang(){
addFrameScript(3, frame4, 11, frame12);
}
function frame12(){
gotoAndPlay("run");
}
function frame4(){
gotoAndPlay("run");
}
}
}//package
Section 65
//CKetapel (CKetapel)
package {
import com.eps.mango.game.*;
public dynamic class CKetapel extends CKetapel {
public function CKetapel(){
addFrameScript(14, frame15, 29, frame30, 44, frame45, 59, frame60, 74, frame75);
}
function frame75(){
gotoAndStop("arah 5");
}
function frame15(){
gotoAndStop("arah 1");
}
function frame30(){
gotoAndStop("arah 2");
}
function frame45(){
gotoAndStop("arah 3");
}
function frame60(){
gotoAndStop("arah 4");
}
}
}//package
Section 66
//Clangkah (Clangkah)
package {
import flash.media.*;
public dynamic class Clangkah extends Sound {
}
}//package
Section 67
//CMainMenuScreen (CMainMenuScreen)
package {
import com.eps.mango.*;
public dynamic class CMainMenuScreen extends CMainMenuScreen {
}
}//package
Section 68
//CMango (CMango)
package {
import com.eps.mango.game.*;
public dynamic class CMango extends CMango {
public function CMango(){
addFrameScript(299, frame300);
}
function frame300(){
manggoRot();
stop();
}
}
}//package
Section 69
//Cmangodrop (Cmangodrop)
package {
import flash.media.*;
public dynamic class Cmangodrop extends Sound {
}
}//package
Section 70
//Cmangoshot (Cmangoshot)
package {
import flash.media.*;
public dynamic class Cmangoshot extends Sound {
}
}//package
Section 71
//Cmati (Cmati)
package {
import flash.media.*;
public dynamic class Cmati extends Sound {
}
}//package
Section 72
//CPenjaga (CPenjaga)
package {
import com.eps.mango.game.*;
public dynamic class CPenjaga extends CPenjaga {
public function CPenjaga(){
addFrameScript(0, frame1, 3, frame4, 19, frame20, 27, frame28, 35, frame36);
}
function frame1(){
stop();
}
function frame4(){
gotoAndPlay("tidur");
}
function frame20(){
guardShot();
}
function frame36(){
gotoAndPlay("tidur");
}
function frame28(){
guardEndShot();
}
}
}//package
Section 73
//Cpowerup (Cpowerup)
package {
import flash.media.*;
public dynamic class Cpowerup extends Sound {
}
}//package
Section 74
//CPreLoaderScreen (CPreLoaderScreen)
package {
import com.eps.mango.*;
public dynamic class CPreLoaderScreen extends CPreLoaderScreen {
public function CPreLoaderScreen(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 75
//CRock (CRock)
package {
import com.eps.mango.game.*;
public dynamic class CRock extends CRock2 {
}
}//package
Section 76
//Cslingshot (Cslingshot)
package {
import flash.media.*;
public dynamic class Cslingshot extends Sound {
}
}//package
Section 77
//CSummaryScreen (CSummaryScreen)
package {
import com.eps.mango.*;
public dynamic class CSummaryScreen extends CSummaryScreen {
}
}//package
Section 78
//CSupercombo2 (CSupercombo2)
package {
import flash.media.*;
public dynamic class CSupercombo2 extends Sound {
}
}//package
Section 79
//CSupercombo6 (CSupercombo6)
package {
import flash.media.*;
public dynamic class CSupercombo6 extends Sound {
}
}//package
Section 80
//CTitlingScreen (CTitlingScreen)
package {
import com.eps.mango.*;
public dynamic class CTitlingScreen extends CTitlingScreen {
public function CTitlingScreen(){
addFrameScript(0, frame1, 2, frame3, 271, frame272);
}
function frame272(){
stop();
endAnimation();
}
function frame3(){
daftarButtons();
}
function frame1(){
stop();
}
}
}//package
Section 81
//Keranjang1 (Keranjang1)
package {
import flash.display.*;
public dynamic class Keranjang1 extends MovieClip {
public function Keranjang1(){
addFrameScript(3, frame4, 11, frame12);
}
function frame12(){
gotoAndPlay("run");
}
function frame4(){
gotoAndPlay("run");
}
}
}//package
Section 82
//Keranjang2 (Keranjang2)
package {
import flash.display.*;
public dynamic class Keranjang2 extends MovieClip {
public function Keranjang2(){
addFrameScript(3, frame4, 11, frame12);
}
function frame12(){
gotoAndPlay("run");
}
function frame4(){
gotoAndPlay("run");
}
}
}//package
Section 83
//Keranjang3 (Keranjang3)
package {
import flash.display.*;
public dynamic class Keranjang3 extends MovieClip {
public function Keranjang3(){
addFrameScript(3, frame4, 11, frame12);
}
function frame12(){
gotoAndPlay("run");
}
function frame4(){
gotoAndPlay("run");
}
}
}//package
Section 84
//PopUp_Day (PopUp_Day)
package {
import flash.media.*;
public dynamic class PopUp_Day extends Sound {
}
}//package
Section 85
//Sepatu1 (Sepatu1)
package {
import flash.display.*;
public dynamic class Sepatu1 extends MovieClip {
public function Sepatu1(){
addFrameScript(3, frame4, 11, frame12);
}
function frame12(){
gotoAndPlay("run");
}
function frame4(){
gotoAndPlay("run");
}
}
}//package
Section 86
//Sepatu2 (Sepatu2)
package {
import flash.display.*;
public dynamic class Sepatu2 extends MovieClip {
public function Sepatu2(){
addFrameScript(3, frame4, 11, frame12);
}
function frame12(){
gotoAndPlay("run");
}
function frame4(){
gotoAndPlay("run");
}
}
}//package
Section 87
//Sepatu3 (Sepatu3)
package {
import flash.display.*;
public dynamic class Sepatu3 extends MovieClip {
public function Sepatu3(){
addFrameScript(3, frame4, 11, frame12);
}
function frame12(){
gotoAndPlay("run");
}
function frame4(){
gotoAndPlay("run");
}
}
}//package
Section 88
//Snoringman (Snoringman)
package {
import flash.media.*;
public dynamic class Snoringman extends Sound {
}
}//package
Section 89
//Speaker (Speaker)
package {
import flash.display.*;
public dynamic class Speaker extends MovieClip {
public function Speaker(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package