Section 1
//clear_pinkstar_intro_22 (amazing_adventures_fla.clear_pinkstar_intro_22)
package amazing_adventures_fla {
import flash.events.*;
import flash.media.*;
import amazingadventures.*;
import util.*;
import flash.display.*;
import amazingadventures.client.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.net.*;
import flash.external.*;
import flash.system.*;
import flash.filters.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.ui.*;
public dynamic class clear_pinkstar_intro_22 extends MovieClip {
public function clear_pinkstar_intro_22(){
addFrameScript(31, frame32);
}
function frame32(){
stop();
}
}
}//package amazing_adventures_fla
Section 2
//ButtonAnimation (amazingadventures.client.ButtonAnimation)
package amazingadventures.client {
import flash.events.*;
import util.*;
import flash.display.*;
public class ButtonAnimation extends MovieClip implements Renderable {
public var framePlayer:FramePlayer;// = null
public function ButtonAnimation(p__1:int, p__2:int, p__3:int){
super();
x = p__1;
y = p__2;
alpha = 0.6;
framePlayer = new FramePlayer(this, p__3, 10, 0);
mouseEnabled = false;
}
public function render(p__1:int, p__2:Number):int{
if (framePlayer != null){
framePlayer.update(p__1, p__2);
if (p__1 >= framePlayer.endTick){
framePlayer = null;
};
return (Renderer.CONTINUE);
};
return (Renderer.STOP_REMOVE);
}
}
}//package amazingadventures.client
Section 3
//ButtonHandler (amazingadventures.client.ButtonHandler)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import flash.display.*;
public class ButtonHandler {
public var active:Boolean;// = true
public var on:int;// = 1
public var over:int;// = 2
public var pressed:int;// = 3
public var off:int;// = 4
public var func:Function;// = null
public var directOver:Boolean;// = false
public var btn:MovieClip;// = null
public var mouseOver:Boolean;// = false
public var mouseOverFunc:Function;// = null
public var currentState:int;
public function ButtonHandler(p__1:MovieClip){
currentState = on;
super();
btn = p__1;
p__1.stop();
p__1.addEventListener(MouseEvent.ROLL_OVER, rollOver);
p__1.addEventListener(MouseEvent.ROLL_OUT, rollOut);
p__1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
p__1.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
}
public function rollOver(p__1:MouseEvent):void{
if (active){
if (btn.currentFrame != pressed){
btn.gotoAndStop(over);
};
mouseOver = true;
if (mouseOverFunc != null){
mouseOverFunc(mouseOver);
};
};
}
public function rollOut(p__1:MouseEvent):void{
if (active){
if (btn.currentFrame != pressed){
btn.gotoAndStop(currentState);
};
mouseOver = false;
if (mouseOverFunc != null){
mouseOverFunc(mouseOver);
};
};
}
public function mouseDown(p__1:MouseEvent):void{
if (active){
btn.gotoAndStop(pressed);
};
}
public function mouseUp(p__1:MouseEvent):void{
if (active){
Main.main.soundManager.startSound(new ButtonClickSnd(), SoundManager.VOLUME_CLICK);
if (func != null){
func();
};
if (!directOver){
if (currentState == on){
currentState = off;
} else {
currentState = on;
};
};
if (((((mouseOver) && (active))) && (directOver))){
btn.gotoAndStop(over);
} else {
btn.gotoAndStop(currentState);
};
};
}
public function setOnOff(p__1:Boolean):void{
if (p__1){
currentState = on;
} else {
currentState = off;
};
btn.gotoAndStop(currentState);
}
}
}//package amazingadventures.client
Section 4
//Clock (amazingadventures.client.Clock)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import util.*;
import flash.display.*;
import flash.text.*;
public class Clock extends Sprite implements Renderable {
public var game:Game;
public var second1:TextField;
public var second10:TextField;
public var colon:TextField;
public var minute1:TextField;
public var timeDisplay:TimeDisplay;
public var timeWarning:Boolean;// = false
private var color:int;
private var flashColor:int;// = 0xFF0000
private var flashTicks:int;// = 30
public function Clock(){
super();
color = second1.textColor;
timeDisplay = new TimeDisplay([second1, second10, minute1], Game.TICKS_PER_SECOND);
}
public function render(p__1:int, p__2:Number):int{
timeDisplay.update(game.countDownTicks);
if (timeWarning){
if ((int((p__1 / flashTicks)) % 2) == 0){
second1.textColor = flashColor;
second10.textColor = flashColor;
colon.textColor = flashColor;
minute1.textColor = flashColor;
} else {
second1.textColor = color;
second10.textColor = color;
colon.textColor = color;
minute1.textColor = color;
};
};
return (Renderer.CONTINUE);
}
}
}//package amazingadventures.client
Section 5
//FailAnimation (amazingadventures.client.FailAnimation)
package amazingadventures.client {
import flash.events.*;
import util.*;
import flash.display.*;
public class FailAnimation extends MovieClip implements Renderable {
public var framePlayer:FramePlayer;// = null
public function FailAnimation(p__1:int, p__2:int, p__3:int){
super();
x = p__1;
y = p__2;
framePlayer = new FramePlayer(this, p__3, 60, 0);
mouseEnabled = false;
}
public function render(p__1:int, p__2:Number):int{
if (framePlayer != null){
framePlayer.update(p__1, p__2);
if (p__1 >= framePlayer.endTick){
framePlayer = null;
};
return (Renderer.CONTINUE);
};
return (Renderer.STOP_REMOVE);
}
}
}//package amazingadventures.client
Section 6
//FoundAnimation (amazingadventures.client.FoundAnimation)
package amazingadventures.client {
import flash.events.*;
import util.*;
import flash.display.*;
public class FoundAnimation extends Sprite implements Renderable {
public var image:Image;// = null
public var animationLayer:Sprite;// = null
public var chainResize:ChainResize;// = null
public var imageMovement:Movement;// = null
public var successAnimation:MovieClip;// = null
public var successFramePlayer:FramePlayer;// = null
public var textItem:TextItem;// = null
public var textItemPlayer:FramePlayer;// = null
public var scorePop:ScorePop;// = null
public var scorePopMovement:Movement;// = null
public var scorePopFader:Fader;// = null
public function FoundAnimation(p__1:Sprite, p__2:Image, p__3:TextItem, p__4:int, p__5:int, p__6:int, p__7:int):void{
var l__8:int;
super();
animationLayer = p__1;
image = p__2;
textItem = p__3;
l__8 = Math.floor((p__2.width / 2));
var l__9:int = Math.floor((p__2.height / 2));
x = (p__2.x + l__8);
y = (p__2.y + l__9);
p__2.x = -(l__8);
p__2.y = -(l__9);
addChild(p__2);
successAnimation = new SuccessAnimation();
p__1.addChild(successAnimation);
successAnimation.x = x;
successAnimation.y = y;
p__1.addChild(this);
scorePop = new ScorePop();
scorePop.init(p__6, p__7);
var l__10:int = (stage.width - 250);
if (x > l__10){
scorePop.x = l__10;
} else {
scorePop.x = x;
};
scorePop.y = y;
p__1.addChild(scorePop);
mouseEnabled = false;
p__2.mouseEnabled = false;
p__2.mc.mouseEnabled = false;
successAnimation.mouseEnabled = false;
scorePop.mouseEnabled = false;
scorePop.textField.mouseEnabled = false;
successFramePlayer = new FramePlayer(successAnimation, p__6, 70, 0);
var l__11:int = p__6;
var l__12:* = 120;
scorePopMovement = new Movement(scorePop, l__11, (l__11 + l__12), scorePop.x, scorePop.y, scorePop.x, (scorePop.y - 100));
scorePopFader = new Fader(scorePop, l__11, (l__11 + l__12), 1, 0);
chainResize = new ChainResize(this);
var l__13:* = 15;
l__11 = p__6;
chainResize.addResize(l__11, 1, 1);
l__11 = (l__11 + l__13);
chainResize.addResize(l__11, 1.4, 1.4);
l__11 = (l__11 + l__13);
chainResize.addResize(l__11, 1, 1);
l__11 = (l__11 + l__13);
chainResize.addResize(l__11, 1.4, 1.4);
l__11 = (l__11 + l__13);
chainResize.addResize(l__11, 1, 1);
var l__14:* = 35;
imageMovement = new Movement(this, l__11, (l__11 + l__14), x, y, p__4, p__5);
l__11 = (l__11 + l__14);
textItemPlayer = new FramePlayer(p__3.line, l__11, 30, 0);
}
public function render(p__1:int, p__2:Number):int{
if (scorePop != null){
if (scorePop.y == scorePopMovement.endY){
animationLayer.removeChild(scorePop);
scorePop = null;
} else {
scorePopMovement.update(p__1, p__2);
scorePopFader.update(p__1, p__2);
};
};
if (image != null){
if ((((imageMovement.endX == x)) && ((imageMovement.endY == y)))){
removeChild(image);
image = null;
} else {
chainResize.update(p__1, p__2);
imageMovement.update(p__1, p__2);
};
};
if (successFramePlayer != null){
if (p__1 > successFramePlayer.endTick){
animationLayer.removeChild(successAnimation);
successFramePlayer = null;
} else {
successFramePlayer.update(p__1, p__2);
};
};
textItemPlayer.update(p__1, p__2);
if ((((((scorePop == null)) && ((image == null)))) && ((successFramePlayer == null)))){
return (Renderer.STOP_REMOVE);
};
return (Renderer.CONTINUE);
}
}
}//package amazingadventures.client
Section 7
//GameC (amazingadventures.client.GameC)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public class GameC extends Sprite {
public var game:Game;// = null
public var gameSprite:Sprite;// = null
public var animationLayer:Sprite;// = null
public var musicBh:ButtonHandler;// = null
public var soundBh:ButtonHandler;// = null
public var middleBorder:MiddleBorder;// = null
public var middleBorderLeft:MiddleBorder;// = null
public var middleBorderRight:MiddleBorder;// = null
public var middleBorderTop:MiddleBorder;// = null
public var newBar:NewBar;// = null
public var dialogLayer:Sprite;// = null
public var hintLayer:Sprite;// = null
public var exitBh:ButtonHandler;// = null
public var clock:Clock;// = null
public var extraGameDialog:MiddleGameDialog;// = null
public var seedTf:TextField;// = null
public var hintBh:ButtonHandler;// = null
public var shortMode:Boolean;// = false
public static var gameStartsInStr:String;
public static var secondsStr:String;
public function GameC(p__1:Game){
super();
game = p__1;
if (Main.gameDataXml.@mode == "short"){
shortMode = true;
};
gameSprite = new Sprite();
gameSprite.name = "game sprite";
addChild(gameSprite);
hintLayer = new Sprite();
addChild(hintLayer);
hintLayer.mouseEnabled = false;
middleBorder = new MiddleBorder();
middleBorder.x = 378;
middleBorder.y = 0;
middleBorder.mouseEnabled = false;
middleBorder.visible = false;
addChild(middleBorder);
middleBorderLeft = new MiddleBorder();
middleBorderLeft.x = 0;
middleBorderLeft.y = 0;
middleBorderLeft.mouseEnabled = false;
middleBorderLeft.visible = false;
addChild(middleBorderLeft);
middleBorderRight = new MiddleBorder();
middleBorderRight.x = 756;
middleBorderRight.y = 0;
middleBorderRight.mouseEnabled = false;
middleBorderRight.visible = false;
addChild(middleBorderRight);
middleBorderTop = new MiddleBorder();
middleBorderTop.x = -11;
middleBorderTop.y = 0;
middleBorderTop.rotation = 270;
middleBorderTop.mouseEnabled = false;
middleBorderTop.visible = false;
addChild(middleBorderTop);
newBar = new NewBar();
newBar.newSlideBar.mouseEnabled = false;
newBar.y = 479;
addChild(newBar);
hintBh = new ButtonHandler(newBar.hintBtn);
hintBh.directOver = true;
newBar.hintBtn.stop();
hintBh.mouseOverFunc = mouseOverHint;
newBar.hintMc.stop();
exitBh = new ButtonHandler(newBar.exitBtn);
exitBh.btn.addEventListener(MouseEvent.CLICK, gameEnd);
soundBh = new ButtonHandler(newBar.soundBtn);
soundBh.setOnOff(p__1.main.soundManager.getSoundOn());
soundBh.btn.addEventListener(MouseEvent.CLICK, toggleSound);
musicBh = new ButtonHandler(newBar.musicBtn);
musicBh.setOnOff(p__1.main.soundManager.getMusicOn());
musicBh.btn.addEventListener(MouseEvent.CLICK, toggleMusic);
newBar.itemsLeftBox.mouseEnabled = false;
newBar.itemsLeftBox.visible = false;
newBar.scoreMc.scoreTf.text = "0";
clock = newBar.clock;
clock.game = p__1;
p__1.main.renderer.start(clock);
animationLayer = new Sprite();
addChild(animationLayer);
animationLayer.mouseEnabled = false;
dialogLayer = new Sprite();
addChild(dialogLayer);
dialogLayer.mouseEnabled = false;
}
public function gameEnd(p__1:MouseEvent):void{
game.main.addPlayData([Game.INPUT_EXIT]);
var l__2:Point = p__1.target.localToGlobal(new Point((p__1.target.width / 2), (p__1.target.height / 2)));
var l__3:ButtonAnimation = new ButtonAnimation(l__2.x, l__2.y, game.main.gameTimer.currentTick);
game.main.addChild(l__3);
game.main.renderer.start(l__3);
}
public function toggleSound(p__1:MouseEvent):void{
p__1.stopPropagation();
game.main.soundManager.toggleSound();
var l__2:Point = p__1.target.localToGlobal(new Point((p__1.target.width / 2), (p__1.target.height / 2)));
var l__3:ButtonAnimation = new ButtonAnimation(l__2.x, l__2.y, game.main.gameTimer.currentTick);
game.main.addChild(l__3);
game.main.renderer.start(l__3);
}
public function toggleMusic(p__1:MouseEvent):void{
p__1.stopPropagation();
game.main.soundManager.toggleMusic();
var l__2:Point = p__1.target.localToGlobal(new Point((p__1.target.width / 2), (p__1.target.height / 2)));
var l__3:ButtonAnimation = new ButtonAnimation(l__2.x, l__2.y, game.main.gameTimer.currentTick);
game.main.addChild(l__3);
game.main.renderer.start(l__3);
}
public function showExtraGameDialog():void{
extraGameDialog = new MiddleGameDialog(game.startMiniGameTick, false, game.main);
dialogLayer.addChild(extraGameDialog);
extraGameDialog.addEventListener(MouseEvent.CLICK, dialogClicked);
game.main.renderer.start(extraGameDialog);
}
public function dialogClicked(p__1:MouseEvent):void{
game.main.addPlayData([Game.INPUT_START_NEXT, game.spyGame.score, game.penalties]);
extraGameDialog.removeEventListener(MouseEvent.CLICK, dialogClicked);
}
public function startNext(p__1:MouseEvent=null):void{
game.main.renderer.stop(extraGameDialog);
dialogLayer.removeChild(extraGameDialog);
soundBh.setOnOff(game.main.soundManager.getSoundOn());
musicBh.setOnOff(game.main.soundManager.getMusicOn());
}
public function updateScoreTf():void{
newBar.scoreMc.scoreTf.text = ("" + game.getCurrentScore());
}
public function updateItemsLeft(p__1:int):void{
if (p__1 > 0){
newBar.itemsLeftBox.itemsLeftTf.text = ("" + p__1);
} else {
newBar.itemsLeftBox.itemsLeftTf.text = "0";
};
}
public function updateRelaxHints():void{
}
public function hintAnimationEnded():void{
}
public function start():void{
game.main.addChild(this);
game.main.soundManager.gameStart();
soundBh.setOnOff(game.main.soundManager.getSoundOn());
musicBh.setOnOff(game.main.soundManager.getMusicOn());
var l__1:SlideBarAnimation = new SlideBarAnimation((1.5 * Game.TICKS_PER_SECOND), newBar.newSlideBar, (11 + 62));
game.main.renderer.start(l__1);
}
public function timeWarning(p__1:Boolean):void{
game.main.soundManager.startSound(new TimeWarningSnd(), SoundManager.VOLUME_TIME_WARNING);
if (p__1){
clock.timeWarning = true;
};
}
public function deActivate():void{
hintBh.active = false;
exitBh.btn.removeEventListener(MouseEvent.CLICK, gameEnd);
soundBh.btn.removeEventListener(MouseEvent.CLICK, toggleSound);
musicBh.btn.removeEventListener(MouseEvent.CLICK, toggleMusic);
}
public function mouseOverHint(p__1:Boolean):void{
if (p__1){
newBar.hintMc.hint1Tf.visible = false;
newBar.hintMc.hint2Tf.visible = true;
newBar.hintMc.hint1Arrow.visible = false;
newBar.hintMc.hint2Arrow.visible = true;
} else {
newBar.hintMc.hint1Tf.visible = true;
newBar.hintMc.hint2Tf.visible = false;
newBar.hintMc.hint1Arrow.visible = true;
newBar.hintMc.hint2Arrow.visible = false;
};
}
public static function addChildAtByFrame(p__1:Image, p__2:DisplayObjectContainer):void{
var l__4:int;
var l__5:Image;
var l__6:int;
var l__3:int = p__1.mc.currentFrame;
l__4 = 0;
while (l__4 < p__2.numChildren) {
l__5 = Image(p__2.getChildAt(l__4));
l__6 = l__5.mc.currentFrame;
if (l__3 < l__6){
break;
};
l__4++;
};
p__2.addChildAt(p__1, l__4);
}
public static function addChildAtByZ(p__1:Image, p__2:DisplayObjectContainer):int{
var l__6:Image;
var l__3:* = -1;
var l__4:* = 1;
var l__5:* = 1;
while (l__5 < p__2.numChildren) {
l__6 = Image(p__2.getChildAt(l__5));
if ((((p__1.z > l__6.z)) && ((l__3 <= l__6.z)))){
l__3 = l__6.z;
l__4 = l__5;
};
l__5++;
};
p__2.addChildAt(p__1, (l__4 + 1));
return ((l__4 + 1));
}
}
}//package amazingadventures.client
Section 8
//GameTimer (amazingadventures.client.GameTimer)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import util.*;
import flash.utils.*;
public class GameTimer {
private var lastTime:Number;// = -1
private var msPerTick:Number;
private var unprocessedTime:Number;// = 0
public var alpha:Number;// = 0
public var currentTick:int;// = -1
public var passedTime:Number;// = 0
public var game:Game;
public var renderer:Renderer;
public function GameTimer(p__1:Number, p__2:Game, p__3:Renderer){
super();
msPerTick = (1000 / p__1);
game = p__2;
renderer = p__3;
}
public function advanceTime(p__1:Event):void{
var l__4:int;
if (lastTime == -1){
lastTime = getTimer();
};
var l__2:int = getTimer();
passedTime = (l__2 - lastTime);
lastTime = l__2;
unprocessedTime = (unprocessedTime + passedTime);
var l__3:int = int((unprocessedTime / msPerTick));
unprocessedTime = (unprocessedTime - (l__3 * msPerTick));
while (l__4 < l__3) {
currentTick++;
if (game != null){
game.tick(currentTick);
};
l__4++;
};
alpha = (unprocessedTime / msPerTick);
renderer.update(currentTick, alpha);
}
}
}//package amazingadventures.client
Section 9
//GraphicsHalf (amazingadventures.client.GraphicsHalf)
package amazingadventures.client {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class GraphicsHalf extends Sprite {
public var background:Image;// = null
public function GraphicsHalf(p__1:Array, p__2:int){
var l__8:Image;
var l__7:int;
super();
var l__3:MovieClip = MovieClip(new Image.imageClass());
l__3.gotoAndStop(1);
var l__4:Matrix = new Matrix();
if (p__2 == 1){
l__4.translate(-378, 0);
};
var l__5:Rectangle = new Rectangle(0, 0, 377, 480);
var l__6:BitmapData = new BitmapData(377, 480, false, 0xFF00FF);
l__6.draw(l__3, l__4, null, null, l__5, false);
addChild(new Bitmap(l__6));
while (l__7 < p__1.length) {
l__8 = Image(p__1[l__7]);
if (p__2 == 1){
l__8.x = (l__8.x - 378);
};
addChild(l__8);
l__7++;
};
}
}
}//package amazingadventures.client
Section 10
//HintAnimation (amazingadventures.client.HintAnimation)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import util.*;
import flash.display.*;
public class HintAnimation extends MovieClip implements Renderable {
public var framePlayer:FramePlayer;// = null
public var gameC:GameC;
public function HintAnimation(p__1:GameC){
super();
gameC = p__1;
mouseEnabled = false;
}
public function spyInit(p__1:Obj, p__2:int):void{
var l__3:int = Math.floor((p__1.c.left.mc.width / 2));
var l__4:int = Math.floor((p__1.c.left.mc.height / 2));
x = (p__1.c.x + l__3);
y = (p__1.c.y + l__4);
var l__5:* = 140;
framePlayer = new FramePlayer(this, p__2, l__5, 0);
}
public function miniGameInit(p__1:int, p__2:Obj, p__3:int):void{
var l__4:int = Math.floor((p__2.c.left.mc.width / 2));
var l__5:int = Math.floor((p__2.c.left.mc.height / 2));
l__4 = (l__4 - ((p__2.c.x)>=378) ? 378 : 0);
x = (p__2.c.x + l__4);
y = (p__2.c.y + l__5);
if (p__1 == 1){
x = (x + 378);
};
var l__6:* = 140;
framePlayer = new FramePlayer(this, p__3, l__6, 0);
var l__7:Sprite = new Sprite();
l__7.graphics.beginFill(0xFF0000);
l__7.graphics.drawRect(0, 0, 377, 480);
l__7.x = ((x)>=378) ? 378 : 0;
mask = l__7;
}
public function render(p__1:int, p__2:Number):int{
if (framePlayer != null){
framePlayer.update(p__1, p__2);
if (p__1 >= framePlayer.endTick){
framePlayer = null;
};
return (Renderer.CONTINUE);
};
gameC.hintAnimationEnded();
return (Renderer.STOP_REMOVE);
}
}
}//package amazingadventures.client
Section 11
//Image (amazingadventures.client.Image)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import util.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class Image extends Sprite {
public var state:int;// = -1
public var z:int;
public var mc:MovieClip;
protected var data:XMLList;
public var bitmapData:BitmapData;
public var bitmap:Bitmap;
public var frame:int;
public static const NOT_SET:int = -1;
public static const FOUND_ANIMATION_1:int = 0;
public static const FOUND_ANIMATION_2:int = 1;
public static var main:Main;
public static var imageClass:Class;
public static var retryLoader:RetryLoader;
private static var loadTimer:Timer;
public function Image(p__1:String, p__2:int, p__3:int=0, p__4:Boolean=false){
super();
z = p__2;
mc = MovieClip(new Image.imageClass());
var l__5:String = p__1.replace("img_", "");
var l__6:int = (parseInt(l__5) + 1);
mc.gotoAndStop(l__6);
var l__7:int = mc.width;
var l__8:int = mc.height;
if ((((p__3 == 90)) || ((p__3 == 270)))){
l__7 = mc.height;
l__8 = mc.width;
p__3 = (360 - p__3);
};
var l__9:Matrix = new Matrix();
if (((p__4) && ((p__3 == 0)))){
l__9.scale(-1, 1);
l__9.translate(l__7, 0);
};
l__9.rotate((p__3 * (Math.PI / 180)));
if (p__3 == 90){
l__9.translate(l__7, 0);
} else {
if (p__3 == 180){
l__9.translate(l__7, l__8);
} else {
if (p__3 == 270){
l__9.translate(0, l__8);
};
};
};
var l__10:Rectangle = new Rectangle(0, 0, l__7, l__8);
bitmapData = new BitmapData(l__7, l__8, true, 0);
bitmapData.draw(mc, l__9, null, null, l__10, false);
frame = mc.currentFrame;
addChild(new Bitmap(bitmapData));
}
public function bitmapPixelHit(p__1:int, p__2:int):Boolean{
var l__3:* = ((bitmapData.getPixel32(p__1, p__2) >> 24) & 0xFF);
if (l__3 >= 50){
return (true);
};
return (false);
}
public function testHit(p__1:int, p__2:int):Boolean{
var l__10:int;
var l__3:Point = globalToLocal(new Point(p__1, p__2));
var l__4:int = int(l__3.x);
var l__5:int = int(l__3.y);
var l__6:* = 5;
var l__7:* = 2;
var l__8:Array = [0, -(l__6), 0, l__6, 0, l__7, l__7, -(l__7), -(l__7)];
var l__9:Array = [-(l__6), 0, 0, 0, l__6, l__7, -(l__7), l__7, -(l__7)];
while (l__10 < l__8.length) {
if (bitmapPixelHit((l__4 + int(l__8[l__10])), (l__5 + int(l__9[l__10])))){
return (true);
};
l__10++;
};
return (false);
}
public function mouseDisable():void{
mouseEnabled = false;
mc.mouseEnabled = false;
}
public static function LoadSwf(p__1:Main, p__2:String):void{
Image.main = p__1;
retryLoader = new RetryLoader(p__2);
retryLoader.load();
loadTimer = new Timer(200, 0);
loadTimer.start();
loadTimer.addEventListener("timer", loadHandler);
}
public static function loadSuccess(p__1:ReLoader):void{
imageClass = Class(p__1.loader.contentLoaderInfo.applicationDomain.getDefinition("Image"));
main.graphicsLoaded();
}
public static function loadFail(p__1:ReLoader):void{
main.loadFail();
}
public static function loadHandler(p__1:Event):void{
if (retryLoader.failed){
loadTimer.stop();
} else {
if (retryLoader.progress == 100){
loadTimer.stop();
imageClass = Class(retryLoader.loader.contentLoaderInfo.applicationDomain.getDefinition("Image"));
main.graphicsLoaded();
};
};
}
}
}//package amazingadventures.client
Section 12
//Intro (amazingadventures.client.Intro)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import util.*;
import flash.display.*;
import flash.text.*;
public class Intro extends MovieClip implements Renderable {
public var instructionsTf:TextField;
public var soundBtn:SoundBtn;
public var timeLeftTf:TextField;
public var musicBtn:MusicBtn;
public var instructions:String;
public var musicBh:ButtonHandler;// = null
public var soundBh:ButtonHandler;// = null
public var introflower:MovieClip;
public var instructions1Mc:MovieClip;
public var instructions3Mc:MovieClip;
public var instructions2Mc:MovieClip;
public var instructions4Mc:MovieClip;
private var main:Main;
private var startTick:int;// = -1
private var endTick:int;
private var firstPage:Boolean;// = true
public var instructions1:String;
public var instructions2:String;
public var instructions3:String;
public var instructions4:String;
public function Intro(p__1:Main){
super();
main = p__1;
addEventListener(MouseEvent.CLICK, showInstructions);
soundBh = new ButtonHandler(soundBtn);
musicBh = new ButtonHandler(musicBtn);
soundBh.btn.visible = false;
musicBh.btn.visible = false;
this.gotoAndStop(1);
}
public function gameDataReady():void{
timeLeftTf.text = Main.gameDataXml.text.(@id == "loading");
GameC.gameStartsInStr = Main.gameDataXml.text.(@id == "game_starts_in");
GameC.secondsStr = Main.gameDataXml.text.(@id == "seconds");
instructions = Main.gameDataXml.text.(@id == "instructions");
instructions1 = Main.gameDataXml.text.(@id == "instruction_1");
instructions2 = Main.gameDataXml.text.(@id == "instruction_2");
instructions3 = Main.gameDataXml.text.(@id == "instruction_3");
instructions4 = Main.gameDataXml.text.(@id == "instruction_4");
}
public function init():void{
stage.frameRate = 30;
this.gotoAndPlay(1);
timeLeftTf.text = ((GameC.gameStartsInStr + " 23 ") + GameC.secondsStr);
soundBh.setOnOff(main.soundManager.getSoundOn());
musicBh.setOnOff(main.soundManager.getMusicOn());
soundBh.btn.addEventListener(MouseEvent.CLICK, main.game.c.toggleSound);
musicBh.btn.addEventListener(MouseEvent.CLICK, main.game.c.toggleMusic);
soundBh.btn.visible = true;
musicBh.btn.visible = true;
main.renderer.start(this);
}
public function showInstructions(p__1:Event=null):void{
startTick = (main.gameTimer.currentTick - (3 * Game.TICKS_PER_SECOND));
endTick = (startTick + (23 * Game.TICKS_PER_SECOND));
}
protected function start(p__1:MouseEvent):void{
endTick = 0;
}
public function render(p__1:int, p__2:Number):int{
if (startTick == -1){
startTick = p__1;
endTick = (startTick + (23 * Game.TICKS_PER_SECOND));
};
if (instructionsTf){
instructionsTf.text = instructions;
};
if (((instructions1Mc) && (instructions1Mc.instructions1Tf))){
instructions1Mc.instructions1Tf.text = instructions1;
};
if (((instructions2Mc) && (instructions2Mc.instructions2Tf))){
instructions2Mc.instructions2Tf.text = instructions2;
};
if (((instructions3Mc) && (instructions3Mc.instructions3Tf))){
instructions3Mc.instructions3Tf.text = instructions3;
};
if (((instructions4Mc) && (instructions4Mc.instructions4Tf))){
instructions4Mc.instructions4Tf.text = instructions4;
};
var l__3:int = (((endTick - p__1) / Game.TICKS_PER_SECOND) + 1);
if (((firstPage) && ((p__1 > (startTick + (3 * Game.TICKS_PER_SECOND)))))){
firstPage = false;
gotoAndPlay(91);
removeEventListener(MouseEvent.CLICK, showInstructions);
addEventListener(MouseEvent.CLICK, start);
};
timeLeftTf.text = ((((GameC.gameStartsInStr + " ") + l__3) + " ") + GameC.secondsStr);
if (p__1 >= endTick){
soundBh.btn.removeEventListener(MouseEvent.CLICK, main.game.c.toggleSound);
musicBh.btn.removeEventListener(MouseEvent.CLICK, main.game.c.toggleMusic);
removeEventListener(MouseEvent.CLICK, start);
main.startGame();
return (Renderer.STOP_REMOVE);
};
return (Renderer.CONTINUE);
}
}
}//package amazingadventures.client
Section 13
//MiddleGameDialog (amazingadventures.client.MiddleGameDialog)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import util.*;
import flash.display.*;
import flash.text.*;
public class MiddleGameDialog extends Sprite implements Renderable {
public var game:String;
public var main:Main;// = null
public var endTick:int;
public var textMc:MovieClip;
public var instructionsTf:TextField;
public var soundBtn:SoundBtn;
public var gameTf:TextField;
public var timeLeftTf:TextField;
public var musicBtn:MusicBtn;
public var middle_dialog_title_:TextField;
public var you_found_all_:TextField;
public var mini_game_instruction:TextField;
public var countDownTf:TextField;
public var countDownSec:int;// = 600
public var instructions:String;
public var text:String;
public var musicBh:ButtonHandler;// = null
public var soundBh:ButtonHandler;// = null
public function MiddleGameDialog(endTick:int, loadingNewPlace:Boolean=false, main:Main=null){
var endTick = endTick;
var loadingNewPlace = loadingNewPlace;
var main = main;
super();
main = main;
endTick = endTick;
instructions = (("••• " + Main.gameDataXml.text.(@id == "instructions")) + " •••");
if (main.game.state == Game.PLACE_START_DIALOG){
game = Main.gameDataXml.text.(@id == "place_title");
text = Main.gameDataXml.text.(@id == "place_instruction");
} else {
game = Main.gameDataXml.text.(@id == "spot_title");
text = Main.gameDataXml.text.(@id == "spot_instruction");
};
soundBh = new ButtonHandler(soundBtn);
soundBh.setOnOff(main.soundManager.getSoundOn());
musicBh = new ButtonHandler(musicBtn);
musicBh.setOnOff(main.soundManager.getMusicOn());
soundBh.btn.addEventListener(MouseEvent.CLICK, main.game.c.toggleSound);
musicBh.btn.addEventListener(MouseEvent.CLICK, main.game.c.toggleMusic);
}
public function nextRelaxGameLodaded():void{
addEventListener(MouseEvent.CLICK, main.startGame);
main.renderer.start(this);
}
public function render(p__1:int, p__2:Number):int{
if (instructionsTf){
instructionsTf.text = instructions;
};
if (gameTf){
gameTf.text = game;
};
if (((textMc) && (textMc.textTf))){
textMc.textTf.text = text;
};
var l__3:int = (((endTick - p__1) / Game.TICKS_PER_SECOND) + 1);
if (l__3 != countDownSec){
countDownSec = l__3;
timeLeftTf.text = ((((GameC.gameStartsInStr + " ") + countDownSec) + " ") + GameC.secondsStr);
};
if ((((p__1 >= endTick)) && (false))){
main.startGame();
};
return (Renderer.CONTINUE);
}
public function destroy():void{
soundBh.btn.removeEventListener(MouseEvent.CLICK, main.game.c.toggleSound);
musicBh.btn.removeEventListener(MouseEvent.CLICK, main.game.c.toggleMusic);
removeEventListener(MouseEvent.CLICK, main.startGame);
}
}
}//package amazingadventures.client
Section 14
//Numbers (amazingadventures.client.Numbers)
package amazingadventures.client {
import flash.events.*;
public class Numbers {
public function Numbers(){
super();
}
public static function itoa(p__1:Number, p__2:Number):String{
var l__4:Number;
var l__3:String = ("" + p__1);
if (p__2){
l__4 = (p__2 - 1);
while (l__4 > 0) {
if (p__1 < Math.pow(10, l__4)){
l__3 = ("0" + l__3);
};
l__4--;
};
};
return (l__3);
}
}
}//package amazingadventures.client
Section 15
//ObjC (amazingadventures.client.ObjC)
package amazingadventures.client {
import amazingadventures.*;
import flash.display.*;
public class ObjC {
public var original_image:Image;
public var origWidth:Number;
public var origHeight:Number;
public var left:Image;// = null
public var right:Image;// = null
public var container:Sprite;// = null
public var obj:Obj;// = null
private var posx:Array;
private var posy:Array;
private var posz:Array;
private var offx:Array;
private var offy:Array;
private var rot:Array;
private var flp:Array;
private var wdt:Array;
private var hght:Array;
private var images:Array;
public function ObjC(p__1:Obj, p__2:XMLList){
var l__4:int;
posx = [];
posy = [];
posz = [];
offx = [];
offy = [];
rot = [];
flp = [];
wdt = [];
hght = [];
images = [];
super();
obj = p__1;
origWidth = p__2.@width;
origHeight = p__2.@height;
var l__3:XMLList = p__2.elements("pos");
while (l__4 < l__3.length()) {
posx.push(parseInt(l__3[l__4].@x));
posy.push(parseInt(l__3[l__4].@y));
posz.push(parseInt(l__3[l__4].@z));
offx.push(parseInt(l__3[l__4].@offsetx));
offy.push(parseInt(l__3[l__4].@offsety));
rot.push(parseInt(l__3[l__4].@rotate));
flp.push(parseInt(l__3[l__4].@flip));
wdt.push(parseInt(l__3[l__4].@width));
hght.push(parseInt(l__3[l__4].@height));
images.push(l__3[l__4].@substitute);
l__4++;
};
original_image = new Image(p__2.@original, z, rotation, flip);
}
public function spyInit(p__1:Sprite):void{
this.container = p__1;
left = new Image(image, z);
left.x = x;
left.y = y;
p__1.addChild(left);
}
public function spyCleanUp():void{
if (container.contains(left)){
container.removeChild(left);
};
left = null;
}
public function placeInit():void{
left = new Image(image, z);
left.x = x;
left.y = y;
right = new Image(image, z);
right.x = x;
right.y = y;
}
public function spotInit():void{
left = new Image(image, z);
left.x = x;
left.y = y;
left.name = obj.id;
right = new Image(image, z);
right.x = x;
right.y = y;
right.name = obj.id;
}
public function get x():int{
return (posx[obj.substitute]);
}
public function get y():int{
return (posy[obj.substitute]);
}
public function get z():int{
return (posz[obj.substitute]);
}
public function get offsetx():int{
return (offx[obj.substitute]);
}
public function get offsety():int{
return (offy[obj.substitute]);
}
public function get rotation():int{
return (rot[obj.substitute]);
}
public function get flip():Boolean{
return (!((flp[obj.substitute] == 0)));
}
public function get width():int{
return (wdt[obj.substitute]);
}
public function get height():int{
return (hght[obj.substitute]);
}
public function get image():String{
return (images[obj.substitute]);
}
public function click(p__1:int, p__2:int):Boolean{
return (left.testHit(p__1, p__2));
}
public function hit(p__1:int, p__2:int):void{
obj.game.main.addPlayData([Game.THING_CLICKED, obj.nr, p__1, p__2]);
}
}
}//package amazingadventures.client
Section 16
//Outro (amazingadventures.client.Outro)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import util.*;
import flash.display.*;
import flash.text.*;
import flash.net.*;
public class Outro extends MovieClip implements Renderable {
public var main:Main;// = null
public var penalties:String;
public var timeBonus:String;
public var totalScore:String;
public var startTick:int;
public var endTick:int;
public var score:String;
public var textMc:MovieClip;
public var soundBtn:SoundBtn;
public var timeLeftTf:TextField;
public var musicBtn:MusicBtn;
public var musicBh:ButtonHandler;// = null
public var soundBh:ButtonHandler;// = null
public var scoreTf:TextField;
public var bestTf:TextField;
public var registerTf:TextField;
public var bestMc:MovieClip;
public var gameoverTf:TextField;
public var gameover:String;
public var scoreLevel1:String;
public var scoreLevel2:String;
public var unusedHintBonus:String;
public var best:String;
public var countDownSeconds:int;// = -1
public var gameQuitSent:Boolean;// = false
public var gameEndsInStr:String;
public var scoreAnimations:Array;// = null
public var outroFading:Boolean;// = false
public var blinkScore1:Boolean;// = false
public var blinkScore2:Boolean;// = false
public var blinkHint:Boolean;// = false
public var blinkTime:Boolean;// = false
public var blinkTotal:Boolean;// = false
public var blinkTick:int;
public var blinkRed:Boolean;// = false
public static const TICKS:int = 1260;
public static const SHORT_MODE_TICKS:int = 360;
public static const MINIMAL_GAME_QUIT_DELAY:int = 120;
public function Outro(game:Game){
var score2:int;
var bestScore1:int;
var bestScore2:int;
var bestHint:int;
var bestTime:int;
var bestTotal:int;
var fields:Array;
var numfields:Array;
var bestfields:Array;
var bestnumfields:Array;
var tick:int;
var interval:int;
var countDownSec:int;
var width:Number;
var game = game;
var i:* = undefined;
super();
this.gotoAndStop(1);
main = game.main;
startTick = game.main.gameTimer.currentTick;
blinkTick = game.main.gameTimer.currentTick;
endTick = (startTick + Outro.TICKS);
score2 = 0;
if ((game.miniGame is PlaceGame)){
score2 = game.placeGame.score;
} else {
if ((game.miniGame is SpotGame)){
score2 = game.spotGame.score;
};
};
gameEndsInStr = Main.gameDataXml.text.(@id == "game_ends_in");
gameover = Main.gameDataXml.text.(@id == "game_over");
score = Main.gameDataXml.text.(@id == "score");
scoreLevel1 = (Main.gameDataXml.text.(@id == "score_level_1") + " ................................................................................");
scoreLevel2 = (Main.gameDataXml.text.(@id == "score_level_2") + " ................................................................................");
unusedHintBonus = (Main.gameDataXml.text.(@id == "unused_hint_bonus") + " ................................................................................");
timeBonus = (Main.gameDataXml.text.(@id == "time_bonus") + " ................................................................................");
penalties = (Main.gameDataXml.text.(@id == "penalties") + " ................................................................................");
totalScore = (Main.gameDataXml.text.(@id == "total_score") + " ................................................................................");
best = Main.gameDataXml.text.(@id == "best_ever");
gameoverTf.text = (("••• " + gameover) + " •••");
scoreTf.text = score;
textMc.score1Tf.text = scoreLevel1;
textMc.score2Tf.text = scoreLevel2;
textMc.hintTf.text = unusedHintBonus;
textMc.timeTf.text = timeBonus;
textMc.penaltyTf.text = penalties;
textMc.totalTf.text = totalScore;
bestTf.text = best;
bestMc.score1Tf.text = scoreLevel1;
bestMc.score2Tf.text = scoreLevel2;
bestMc.hintTf.text = unusedHintBonus;
bestMc.timeTf.text = timeBonus;
bestMc.totalTf.text = totalScore;
registerTf.text = Main.gameDataXml.text.(@id == "register");
textMc.score1NumTf.text = game.spyGame.score;
textMc.score2NumTf.text = score2;
textMc.hintNumTf.text = game.hintScore;
textMc.timeNumTf.text = game.timeBonus;
textMc.penaltyNumTf.text = -(game.penalties);
textMc.totalNumTf.text = game.totalScore;
bestScore1 = parseInt(Main.gameDataXml.text.(@id == "best_score1"), 10);
bestScore2 = parseInt(Main.gameDataXml.text.(@id == "best_score2"), 10);
bestHint = parseInt(Main.gameDataXml.text.(@id == "best_hint"), 10);
bestTime = parseInt(Main.gameDataXml.text.(@id == "best_time"), 10);
bestTotal = parseInt(Main.gameDataXml.text.(@id == "best_total"), 10);
if (bestScore1 < game.spyGame.score){
blinkScore1 = true;
bestMc.score1NumTf.text = game.spyGame.score;
} else {
bestMc.score1NumTf.text = bestScore1;
};
if (bestScore2 < score2){
blinkScore2 = true;
bestMc.score2NumTf.text = score2;
} else {
bestMc.score2NumTf.text = bestScore2;
};
if (bestHint < game.hintScore){
blinkHint = true;
bestMc.hintNumTf.text = game.hintScore;
} else {
bestMc.hintNumTf.text = bestHint;
};
if (bestTime < game.timeBonus){
blinkTime = true;
bestMc.timeNumTf.text = game.timeBonus;
} else {
bestMc.timeNumTf.text = bestTime;
};
if (bestTotal < game.totalScore){
blinkTotal = true;
bestMc.totalNumTf.text = game.totalScore;
} else {
bestMc.totalNumTf.text = bestTotal;
};
fields = [textMc.score1Tf, textMc.score2Tf, textMc.hintTf, textMc.timeTf, textMc.penaltyTf, textMc.totalTf];
numfields = [textMc.score1NumTf, textMc.score2NumTf, textMc.hintNumTf, textMc.timeNumTf, textMc.penaltyNumTf, textMc.totalNumTf];
i = 0;
while (i < fields.length) {
width = ((341 - numfields[i].textWidth) - 4);
fields[i].width = width;
i = (i + 1);
};
bestfields = [bestMc.score1Tf, bestMc.score2Tf, bestMc.hintTf, bestMc.timeTf, bestMc.totalTf];
bestnumfields = [bestMc.score1NumTf, bestMc.score2NumTf, bestMc.hintNumTf, bestMc.timeNumTf, bestMc.totalNumTf];
i = 0;
while (i < bestfields.length) {
width = ((252 - bestnumfields[i].textWidth) - 4);
bestfields[i].width = width;
i = (i + 1);
};
soundBh = new ButtonHandler(soundBtn);
soundBh.setOnOff(main.soundManager.getSoundOn());
musicBh = new ButtonHandler(musicBtn);
musicBh.setOnOff(main.soundManager.getMusicOn());
soundBh.btn.addEventListener(MouseEvent.CLICK, game.c.toggleSound);
musicBh.btn.addEventListener(MouseEvent.CLICK, game.c.toggleMusic);
game.main.soundManager.gameEnd();
tick = game.main.gameTimer.currentTick;
interval = 7;
scoreAnimations = new Array();
scoreAnimations.push(new ScoreAnimation(textMc.score1NumTf, game.spyGame.score, tick, game.main.soundManager));
if (score2 > 0){
tick = (tick + (ScoreAnimation.TICKS + interval));
};
scoreAnimations.push(new ScoreAnimation(textMc.score2NumTf, score2, tick, game.main.soundManager));
if (game.hintScore > 0){
tick = (tick + (ScoreAnimation.TICKS + interval));
};
scoreAnimations.push(new ScoreAnimation(textMc.hintNumTf, game.hintScore, tick, game.main.soundManager, new HintScoreSnd()));
if (game.timeBonus > 0){
tick = (tick + (ScoreAnimation.TICKS + interval));
};
scoreAnimations.push(new ScoreAnimation(textMc.timeNumTf, game.timeBonus, tick, game.main.soundManager));
if (game.penalties < 0){
tick = (tick + (ScoreAnimation.TICKS + interval));
};
scoreAnimations.push(new ScoreAnimation(textMc.penaltyNumTf, -(game.penalties), tick, game.main.soundManager));
if (game.totalScore > 0){
tick = (tick + (ScoreAnimation.TICKS + interval));
};
scoreAnimations.push(new ScoreAnimation(textMc.totalNumTf, game.totalScore, tick, game.main.soundManager, new TotalScoreSnd()));
countDownSec = ((TICKS / Game.TICKS_PER_SECOND) + 1);
timeLeftTf.text = ((((gameEndsInStr + " ") + countDownSeconds) + " ") + GameC.secondsStr);
addEventListener(MouseEvent.CLICK, gameQuit);
}
public function gameQuit(p__1:MouseEvent):void{
var l__4:ScoreAnimation;
var l__2:int;
if (((main.game.c.shortMode) && ((this.currentFrame == 1)))){
return;
};
while (l__2 < scoreAnimations.length) {
l__4 = ScoreAnimation(scoreAnimations[l__2]);
main.renderer.stop(l__4);
l__4.textField.text = ("" + l__4.score);
l__2++;
};
var l__3:int = main.gameTimer.currentTick;
if (l__3 > (startTick + Outro.MINIMAL_GAME_QUIT_DELAY)){
endTick = (l__3 + Outro.MINIMAL_GAME_QUIT_DELAY);
} else {
endTick = (startTick + Outro.MINIMAL_GAME_QUIT_DELAY);
};
if (!outroFading){
outroFading = true;
main.soundManager.outroFadeOut();
};
removeEventListener(MouseEvent.CLICK, gameQuit);
}
public function drSubmit(score:int):void{
var score = score;
trace(("DR-Score:" + score));
url = "index.php?act=Arcade&do=newscore";
request = new URLRequest(url);
variables = new URLVariables();
variables.gname = "ScrapbookAS3v2GerDR";
variables.gscore = score;
request.data = variables;
request.method = URLRequestMethod.POST;
navigateToURL(request, "_self");
//unresolved jump
var _slot1 = e;
trace(_slot1);
}
public function destroy():void{
soundBh.btn.removeEventListener(MouseEvent.CLICK, main.game.c.toggleSound);
musicBh.btn.removeEventListener(MouseEvent.CLICK, main.game.c.toggleMusic);
removeEventListener(MouseEvent.CLICK, main.startGame);
}
public function render(p__1:int, p__2:Number):int{
var l__5:* = undefined;
if (((((main.game.c.shortMode) && ((currentFrame == 1)))) && (((p__1 - startTick) >= SHORT_MODE_TICKS)))){
this.gotoAndStop(2);
};
if (p__1 >= (endTick - Outro.MINIMAL_GAME_QUIT_DELAY)){
if (!outroFading){
outroFading = true;
main.soundManager.outroFadeOut();
};
};
if ((((p__1 >= endTick)) && (!(gameQuitSent)))){
drSubmit(textMc.totalNumTf.text);
gameQuitSent = true;
timeLeftTf.text = ((((gameEndsInStr + " ") + 0) + " ") + GameC.secondsStr);
return (Renderer.STOP);
};
var l__3:int = (endTick - p__1);
var l__4:int = ((l__3 / Game.TICKS_PER_SECOND) + 1);
if (countDownSeconds != l__4){
countDownSeconds = l__4;
if (countDownSeconds >= 0){
timeLeftTf.text = ((((gameEndsInStr + " ") + countDownSeconds) + " ") + GameC.secondsStr);
};
};
if ((p__1 - blinkTick) > (0.35 * Game.TICKS_PER_SECOND)){
blinkTick = p__1;
blinkRed = !(blinkRed);
l__5 = (blinkRed) ? 0xFF0000 : 9970027;
if (blinkScore1){
bestMc.score1Tf.textColor = l__5;
bestMc.score1NumTf.textColor = l__5;
};
if (blinkScore2){
bestMc.score2Tf.textColor = l__5;
bestMc.score2NumTf.textColor = l__5;
};
if (blinkHint){
bestMc.hintTf.textColor = l__5;
bestMc.hintNumTf.textColor = l__5;
};
if (blinkTime){
bestMc.timeTf.textColor = l__5;
bestMc.timeNumTf.textColor = l__5;
};
if (blinkTotal){
bestMc.totalTf.textColor = l__5;
bestMc.totalNumTf.textColor = l__5;
};
};
return (Renderer.CONTINUE);
}
}
}//package amazingadventures.client
Section 17
//PlaceFailAnimation (amazingadventures.client.PlaceFailAnimation)
package amazingadventures.client {
import util.*;
import flash.display.*;
import flash.geom.*;
public class PlaceFailAnimation implements Renderable {
public var resize:ChainResize;// = null
public var movement:Movement;// = null
public var imageSprite:Sprite;// = null
public var placeGameC:PlaceGameC;// = null
public function PlaceFailAnimation(p__1:Sprite, p__2:PlaceGameC, p__3:int, p__4:Point, p__5:Number){
super();
imageSprite = p__1;
placeGameC = p__2;
movement = new Movement(p__1, p__3, (p__3 + 25), p__1.x, p__1.y, p__4.x, p__4.y);
resize = new ChainResize(p__1);
resize.addResize(p__3, p__1.scaleX, p__1.scaleY);
resize.addResize((p__3 + 25), p__5, p__5);
}
public function render(p__1:int, p__2:Number):int{
if (movement != null){
if (p__1 >= movement.endTick){
movement = null;
} else {
resize.update(p__1, p__2);
movement.update(p__1, p__2);
};
} else {
placeGameC.returnImageSpriteToSlider(imageSprite);
return (Renderer.STOP);
};
return (Renderer.CONTINUE);
}
}
}//package amazingadventures.client
Section 18
//PlaceGameC (amazingadventures.client.PlaceGameC)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class PlaceGameC {
public var placeGame:PlaceGame;// = null
public var leftHalf:GraphicsHalf;// = null
public var rightHalf:GraphicsHalf;// = null
public var slideBar2:NewSlideBar;// = null
public var slideImages:Sprite;// = null
public var gameSprite:Sprite;// = null
public var animationLayer:Sprite;// = null
public var draggedSprite:Sprite;// = null
public var draggedSpriteScale:Number;// = 1
public var draggedSpritePoint:Point;// = null
public var draggedSpriteDepth:int;// = -1
public var missingSide:int;
public function PlaceGameC(p__1:PlaceGame){
var l__6:Obj;
var l__7:Obj;
var l__4:int;
var l__5:int;
super();
placeGame = p__1;
slideBar2 = p__1.game.c.newBar.newSlideBar;
gameSprite = p__1.game.c.gameSprite;
animationLayer = p__1.game.c.animationLayer;
slideImages = new Sprite();
slideBar2.addChild(slideImages);
var l__2:Array = new Array();
var l__3:Array = new Array();
while (l__4 < p__1.objs.size()) {
l__6 = Obj(p__1.objs.g(l__4));
l__6.c.placeInit();
if (p__1.leftObjs.indexOf(l__6) == -1){
l__2.push(l__6.c.left);
};
if (p__1.rightObjs.indexOf(l__6) == -1){
l__3.push(l__6.c.right);
};
l__4++;
};
while (l__5 < p__1.excludedObjs.size()) {
l__7 = Obj(p__1.excludedObjs.g(l__5));
if (p__1.leftObjs.indexOf(l__7) != -1){
makeImageSprite(l__7.c.original_image, l__7.id);
};
if (p__1.rightObjs.indexOf(l__7) != -1){
makeImageSprite(l__7.c.original_image, l__7.id);
};
l__5++;
};
updateSlideBar();
leftHalf = new GraphicsHalf(l__2, p__1.sideOfScene);
gameSprite.addChild(leftHalf);
rightHalf = new GraphicsHalf(l__3, p__1.sideOfScene);
rightHalf.x = 378;
gameSprite.addChild(rightHalf);
p__1.game.c.middleBorder.visible = true;
p__1.game.c.middleBorderLeft.visible = true;
p__1.game.c.middleBorderRight.visible = true;
p__1.game.c.middleBorderTop.visible = true;
if (p__1.game.hintsLeft > 0){
p__1.game.c.hintBh.func = hintClicked;
p__1.game.c.hintBh.active = true;
p__1.game.c.newBar.hintMc.addEventListener(MouseEvent.CLICK, hintClicked);
};
p__1.game.c.updateItemsLeft(p__1.excludedObjs.size());
p__1.game.c.newBar.itemsLeftBox.visible = true;
p__1.game.c.updateItemsLeft(p__1.excludedObjs.size());
p__1.game.c.newBar.newSlideBar.moveShort.visible = true;
}
public function updateSlideBar():void{
var l__3:Sprite;
var l__1:int;
while (l__1 < slideImages.numChildren) {
l__3 = Sprite(slideImages.getChildAt(l__1));
l__3.x = (l__1 * 66);
l__3.y = 0;
l__1++;
};
var l__2:int = (PlaceGame.NO_THINGS_TO_PLACE - slideImages.numChildren);
slideImages.x = (100 + (l__2 * 32));
slideImages.y = 33;
}
public function makeImageSprite(p__1:Image, p__2:String):void{
p__1.x = 0;
p__1.y = 0;
p__1.mouseEnabled = true;
var l__3:Sprite = new Sprite();
activateDrag(l__3);
l__3.name = p__2;
l__3.addChild(p__1);
p__1.x = -(Math.floor((l__3.width / 2)));
p__1.y = -(Math.floor((l__3.height / 2)));
var l__4:GlowFilter = new GlowFilter(0xFFFFFF, 1, 6, 6, 1.49, BitmapFilterQuality.LOW, false, false);
l__3.filters = [l__4];
var l__5:Number = 48;
var l__6:Number = 1;
var l__7:Number = p__1.width;
if (p__1.height > p__1.width){
l__7 = p__1.height;
};
if (l__7 > l__5){
l__6 = (l__7 / l__5);
l__6 = (1 / l__6);
};
l__3.scaleX = l__6;
l__3.scaleY = l__6;
slideImages.addChild(l__3);
}
public function activateDrag(p__1:Sprite):void{
p__1.addEventListener(MouseEvent.MOUSE_DOWN, imageDrag);
}
public function deActivateDrag(p__1:Sprite):void{
p__1.removeEventListener(MouseEvent.MOUSE_DOWN, imageDrag);
}
public function imageDrag(p__1:MouseEvent):void{
var l__2:Sprite = Sprite(p__1.target.parent);
deActivateDrag(l__2);
var l__3:String = l__2.name;
placeGame.game.main.addPlayData([Game.INPUT_IMAGE_DRAG, l__3]);
}
public function startImageDrag(p__1:String):void{
draggedSprite = Sprite(slideImages.getChildByName(p__1));
draggedSpritePoint = draggedSprite.parent.localToGlobal(new Point(draggedSprite.x, draggedSprite.y));
draggedSpriteDepth = slideImages.getChildIndex(draggedSprite);
draggedSpriteScale = draggedSprite.scaleX;
draggedSprite.scaleX = 1;
draggedSprite.scaleY = 1;
animationLayer.addChild(draggedSprite);
draggedSprite.startDrag(true);
draggedSprite.addEventListener(MouseEvent.MOUSE_DOWN, imageDrop);
updateSlideBar();
missingSide = 0;
if (placeGame.rightObjs.indexOf(placeGame.draggedObj) != -1){
missingSide = 1;
};
}
public function imageDrop(p__1:MouseEvent):void{
var l__5:GraphicsHalf;
var l__6:Image;
var l__7:Point;
var l__2:int;
var l__4:Boolean;
draggedSprite.removeEventListener(MouseEvent.MOUSE_DOWN, imageDrop);
draggedSprite.stopDrag();
var l__3:int = draggedSprite.x;
if (l__3 > 378){
l__2 = 1;
l__3 = (l__3 - 378);
} else {
l__3 = (l__3 + 378);
};
if (l__2 == missingSide){
l__5 = leftHalf;
l__6 = placeGame.draggedObj.c.right;
if (l__2 == 1){
l__5 = rightHalf;
l__6 = placeGame.draggedObj.c.left;
};
l__4 = l__6.hitTestPoint(l__3, draggedSprite.y);
if (((((!(l__4)) && ((l__6.width < 15)))) && ((l__6.height < 15)))){
l__7 = l__6.localToGlobal(new Point(0, 0));
l__7.x = ((l__7.x)>378) ? (l__7.x - 378) : (l__7.x + 378);
l__7.x = (l__7.x + Math.floor((l__6.width / 2)));
l__7.y = (l__7.y + Math.floor((l__6.height / 2)));
l__4 = draggedSprite.hitTestPoint(l__7.x, l__7.y);
};
};
if (((!(l__4)) && (draggedSprite.getChildAt(0).hitTestObject(placeGame.game.c.newBar)))){
placeGame.game.addPlayData([Game.INPUT_PUT_BACK]);
} else {
placeGame.game.main.addPlayData([Game.INPUT_IMAGE_DROP, l__4]);
};
}
public function hintClicked(p__1:Event=null):void{
placeGame.game.main.addPlayData([Game.INPUT_HINT]);
if (placeGame.game.hintsLeft <= 1){
placeGame.game.c.hintBh.setOnOff(false);
placeGame.game.c.hintBh.active = false;
placeGame.game.c.newBar.hintMc.visible = false;
} else {
placeGame.game.c.hintBh.setOnOff(true);
};
Main.main.soundManager.startSound(new HintSnd(), SoundManager.VOLUME_HINT);
}
public function giveHint():void{
var l__1:Obj;
var l__3:int;
var l__2:int = (Math.random() * placeGame.excludedObjs.size());
l__1 = Obj(placeGame.excludedObjs.g(l__2));
if (placeGame.rightObjs.indexOf(l__1) != -1){
l__3 = 1;
};
var l__4:HintAnimation = new HintAnimation(placeGame.game.c);
l__4.miniGameInit(l__3, l__1, placeGame.game.main.gameTimer.currentTick);
placeGame.game.c.hintLayer.addChild(l__4);
placeGame.game.main.renderer.start(l__4);
placeGame.game.c.updateRelaxHints();
}
public function animateSuccess(p__1:int):void{
var l__2:Image = placeGame.draggedObj.c.left;
var l__3:GraphicsHalf = leftHalf;
if (missingSide == 1){
l__2 = placeGame.draggedObj.c.right;
l__3 = rightHalf;
};
animationLayer.removeChild(draggedSprite);
l__2.x = placeGame.draggedObj.c.x;
l__2.y = placeGame.draggedObj.c.y;
if (l__2.x >= 378){
l__2.x = (l__2.x - 378);
};
GameC.addChildAtByZ(l__2, l__3);
var l__4:Point = l__3.localToGlobal(new Point(l__2.x, l__2.y));
l__4.x = (l__4.x + Math.floor((l__2.width / 2)));
l__4.y = (l__4.y + Math.floor((l__2.height / 2)));
var l__5:SuccessAnimation = new SuccessAnimation();
animationLayer.addChild(l__5);
l__5.x = l__4.x;
l__5.y = l__4.y;
l__5.init(placeGame.game.main.gameTimer.currentTick);
placeGame.game.main.renderer.start(l__5);
var l__6:ScorePop = new ScorePop();
l__6.x = l__4.x;
var l__7:int = (755 - 150);
if (l__6.x > l__7){
l__6.x = l__7;
};
l__6.y = l__4.y;
animationLayer.addChild(l__6);
l__6.init(placeGame.game.main.gameTimer.currentTick, p__1);
placeGame.game.main.renderer.start(l__6);
placeGame.game.c.updateScoreTf();
placeGame.game.c.updateItemsLeft(placeGame.excludedObjs.size());
Main.main.soundManager.startSound(new FoundSnd(), SoundManager.VOLUME_MINI_GAME_MATCH);
}
public function animateFailure(p__1:int, p__2:int):void{
var l__5:ScorePop;
var l__6:int;
var l__3:PlaceFailAnimation = new PlaceFailAnimation(draggedSprite, this, p__1, draggedSpritePoint, draggedSpriteScale);
placeGame.game.main.renderer.start(l__3);
var l__4:FailAnimation = new FailAnimation(draggedSprite.x, draggedSprite.y, placeGame.game.main.gameTimer.currentTick);
animationLayer.addChild(l__4);
placeGame.game.main.renderer.start(l__4);
if (p__2 < 0){
l__5 = new ScorePop();
animationLayer.addChild(l__5);
l__6 = (755 - 100);
if (draggedSprite.x > l__6){
l__5.x = l__6;
} else {
l__5.x = draggedSprite.x;
};
l__5.y = draggedSprite.y;
l__5.init(placeGame.game.main.gameTimer.currentTick, p__2);
placeGame.game.main.renderer.start(l__5);
};
placeGame.game.c.updateScoreTf();
Main.main.soundManager.startSound(new PenaltySnd(), SoundManager.VOLUME_PENALTY);
}
public function animatePutBack(p__1:int):void{
var l__2:PlaceFailAnimation = new PlaceFailAnimation(draggedSprite, this, p__1, draggedSpritePoint, draggedSpriteScale);
placeGame.game.main.renderer.start(l__2);
}
public function returnImageSpriteToSlider(p__1):void{
slideImages.addChildAt(p__1, draggedSpriteDepth);
updateSlideBar();
activateDrag(p__1);
}
public function cleanUp():void{
var l__1:DisplayObject;
while (slideImages.numChildren > 0) {
l__1 = slideImages.getChildAt(0);
if ((l__1 is Sprite)){
deActivateDrag(Sprite(l__1));
};
slideImages.removeChild(l__1);
};
}
}
}//package amazingadventures.client
Section 19
//ScoreAnimation (amazingadventures.client.ScoreAnimation)
package amazingadventures.client {
import flash.media.*;
import amazingadventures.*;
import util.*;
import flash.text.*;
public class ScoreAnimation implements Renderable {
public var startTick:int;// = -1
public var score:int;// = -1
public var textField:TextField;// = null
public var started:Boolean;// = false
public var scorePerInterval:Number;// = 0
public var soundManager:SoundManager;// = null
public var extraSound:Sound;// = null
private var lastTick:int;
public static const TICKS:int = 30;
public static const INTERVAL:int = 1;
public function ScoreAnimation(p__1:TextField, p__2:int, p__3:int, p__4:SoundManager, p__5:Sound=null){
lastTick = -(ScoreAnimation.INTERVAL);
super();
textField = p__1;
score = p__2;
startTick = p__3;
soundManager = p__4;
extraSound = p__5;
p__1.text = "";
if (p__2 > 0){
scorePerInterval = (p__2 / (ScoreAnimation.TICKS / ScoreAnimation.INTERVAL));
Main.renderer.start(this);
} else {
p__1.text = "0";
};
}
public function render(p__1:int, p__2:Number):int{
var l__3:int;
if (((!(started)) && ((p__1 > startTick)))){
started = true;
lastTick = p__1;
soundManager.startSound(new ScoreCountSnd(), SoundManager.VOLUME_OUTRO_SCORE);
if (extraSound){
soundManager.startSound(extraSound, (SoundManager.VOLUME_OUTRO_SCORE + 0.2));
};
};
if (((started) && ((p__1 >= (lastTick + ScoreAnimation.INTERVAL))))){
l__3 = ((lastTick - startTick) / ScoreAnimation.INTERVAL);
textField.text = ("" + Math.floor((l__3 * scorePerInterval)));
lastTick = p__1;
};
if (p__1 >= (startTick + ScoreAnimation.TICKS)){
textField.text = ("" + score);
return (Renderer.STOP);
};
return (Renderer.CONTINUE);
}
}
}//package amazingadventures.client
Section 20
//ScorePop (amazingadventures.client.ScorePop)
package amazingadventures.client {
import flash.events.*;
import util.*;
import flash.display.*;
import flash.text.*;
public class ScorePop extends Sprite implements Renderable {
public var textField:TextField;
public var movement:Movement;// = null
public var fader:Fader;// = null
public function ScorePop(){
super();
mouseEnabled = false;
textField.mouseEnabled = false;
}
public function init(p__1, p__2:int):void{
var l__3:* = "";
if (p__2 > 0){
textField.text = (("+ " + p__2) + l__3);
} else {
textField.text = (("- " + -(p__2)) + l__3);
};
movement = new Movement(this, p__1, (p__1 + 120), x, y, x, (y - 100));
fader = new Fader(this, p__1, (p__1 + 120), 1, 0);
}
public function render(p__1:int, p__2:Number):int{
if (movement != null){
if (y == movement.endY){
movement = null;
} else {
movement.update(p__1, p__2);
fader.update(p__1, p__2);
};
};
if (movement == null){
return (Renderer.STOP_REMOVE);
};
return (Renderer.CONTINUE);
}
}
}//package amazingadventures.client
Section 21
//SlideBarAnimation (amazingadventures.client.SlideBarAnimation)
package amazingadventures.client {
import amazingadventures.*;
import util.*;
import flash.display.*;
public class SlideBarAnimation implements Renderable {
var spyGameC:SpyGameC;
var move:Movement;// = null
var slideBar:MovieClip;
var startTick:int;
var state:int;// = 0
public function SlideBarAnimation(p__1:int, p__2:MovieClip, p__3:int){
super();
spyGameC = spyGameC;
slideBar = p__2;
move = new Movement(p__2, p__1, (p__1 + 30), p__2.x, p__2.y, p__2.x, p__3);
startTick = p__1;
}
public function render(p__1:int, p__2:Number):int{
var l__3:int;
if (move != null){
move.update(p__1, p__2);
if (p__1 >= move.endTick){
move = null;
};
} else {
if (state == 0){
state = 1;
move = new Movement(slideBar, p__1, (p__1 + 30), slideBar.x, slideBar.y, slideBar.x, 11);
l__3 = 1;
while (l__3 < slideBar.numChildren) {
slideBar.getChildAt(l__3).visible = true;
l__3++;
};
slideBar.levelNameTf.visible = false;
} else {
return (Renderer.STOP);
};
};
return (Renderer.CONTINUE);
}
}
}//package amazingadventures.client
Section 22
//SoundManager (amazingadventures.client.SoundManager)
package amazingadventures.client {
import flash.events.*;
import flash.media.*;
import util.*;
import flash.utils.*;
public class SoundManager {
public const LOOP_DELAY:int = 400;
public const OUTRO_DELAY:int = 400;
public const OUTRO_FADE_OUT:int = 1400;
public var soundOn:Boolean;// = true
public var musicOn:Boolean;// = true
private var introSound:Sound;
private var introSoundChannel:SoundChannel;
private var introSoundTransform:SoundTransform;
private var levelSound:Sound;
private var levelSoundChannel:SoundChannel;
private var levelSoundTransform:SoundTransform;
private var loopSound:Sound;
private var loopSoundChannel:SoundChannel;
private var loopSoundTransform:SoundTransform;
private var outroSoundTransform:SoundTransform;
private var outroSound:Sound;
public var outroSoundChannel:SoundChannel;
private var timeWarningSound:Sound;
private var timeWarningSoundChannel:SoundChannel;
private var timeWarningSoundTransform:SoundTransform;
private var timer:Timer;
public static const STEREO_INTENSITY:Number = 0.7;
public static const VOLUME_INTRO:Number = 0.7;
public static const VOLUME_LOOP:Number = 0.6;
public static const VOLUME_OUTRO:Number = 0.7;
public static const VOLUME_CLICK:Number = 0.7;
public static const VOLUME_ROLL_OVER:Number = 0.7;
public static const VOLUME_HINT:Number = 0.7;
public static const VOLUME_FOUND:Number = 0.7;
public static const VOLUME_LEVEL_WIN_POINTS:Number = 0.7;
public static const VOLUME_MINI_GAME_MATCH:Number = 0.7;
public static const VOLUME_MISSION_WIN_PONINTS:Number = 0.7;
public static const VOLUME_NOT_FOUND:Number = 0.7;
public static const VOLUME_PENALTY:Number = 0.7;
public static const VOLUME_TIME_WARNING:Number = 0.7;
public static const VOLUME_OUTRO_SCORE:Number = 0.7;
public function SoundManager(){
super();
}
public function toggleSound(p__1:MouseEvent=null):void{
soundOn = !(soundOn);
if (!soundOn){
if (timeWarningSoundChannel != null){
timeWarningSoundChannel.soundTransform = new SoundTransform(0);
};
} else {
if (timeWarningSoundChannel != null){
timeWarningSoundChannel.soundTransform = new SoundTransform(SoundManager.VOLUME_TIME_WARNING);
};
};
}
public function toggleMusic(p__1:Event=null):void{
musicOn = !(musicOn);
if (musicOn){
startMusic();
} else {
stopMusic();
};
}
public function stopMusic():void{
if (loopSoundChannel != null){
loopSoundChannel.soundTransform = new SoundTransform(0);
};
if (introSoundChannel != null){
introSoundChannel.soundTransform = new SoundTransform(0);
};
if (outroSoundChannel != null){
outroSoundChannel.soundTransform = new SoundTransform(0);
};
}
public function startMusic():void{
if (musicOn){
if (loopSoundChannel != null){
loopSoundChannel.soundTransform = new SoundTransform(SoundManager.VOLUME_LOOP);
};
if (introSoundChannel != null){
introSoundChannel.soundTransform = new SoundTransform(SoundManager.VOLUME_INTRO);
};
if (outroSoundChannel != null){
outroSoundChannel.soundTransform = new SoundTransform(SoundManager.VOLUME_OUTRO);
};
};
}
public function startIntroSound(p__1:Event=null):void{
var l__2:Number = SoundManager.VOLUME_INTRO;
if (!musicOn){
l__2 = 0;
};
introSoundTransform = new SoundTransform(l__2);
introSound = new IntroSnd();
introSoundChannel = introSound.play(0, 0, introSoundTransform);
}
public function startLevelClearSound(p__1:Event=null):void{
var l__2:Number = SoundManager.VOLUME_INTRO;
if (!musicOn){
l__2 = 0;
};
levelSoundTransform = new SoundTransform(l__2);
levelSound = new LevelClearSnd();
levelSoundChannel = levelSound.play(0, 0, levelSoundTransform);
}
public function gameStart(p__1:Event=null):void{
if (introSoundChannel != null){
new SoundFader(introSoundChannel, LOOP_DELAY);
};
timer = new Timer(LOOP_DELAY, 1);
timer.addEventListener("timerComplete", startLoopSound);
timer.start();
}
public function startLoopSound(p__1:Event=null):void{
var l__2:Number = SoundManager.VOLUME_LOOP;
if (!musicOn){
l__2 = 0;
};
loopSoundTransform = new SoundTransform(l__2);
loopSound = new LoopSnd();
loopSoundChannel = loopSound.play(0, int.MAX_VALUE, loopSoundTransform);
}
public function gameEnd():void{
if (introSoundChannel != null){
new SoundFader(introSoundChannel, OUTRO_DELAY);
};
if (loopSoundChannel != null){
new SoundFader(loopSoundChannel, OUTRO_DELAY);
};
if (levelSoundChannel != null){
new SoundFader(levelSoundChannel, OUTRO_DELAY);
};
timer = new Timer(OUTRO_DELAY, 1);
timer.addEventListener("timerComplete", startOutroSound);
timer.start();
}
public function startOutroSound(p__1:Event=null):void{
var l__2:Number = SoundManager.VOLUME_OUTRO;
if (!musicOn){
l__2 = 0;
};
outroSoundTransform = new SoundTransform(l__2);
outroSound = new OutroSnd();
outroSoundChannel = outroSound.play(0, 0, outroSoundTransform);
}
protected function playSound(p__1:Sound, p__2:Number, p__3:int=0):void{
var l__4:SoundTransform = new SoundTransform(p__2);
var l__5:Sound = p__1;
var l__6:SoundChannel = l__5.play(0, p__3, l__4);
}
public function startSound(p__1:Sound, p__2:Number, p__3:int=0):void{
if (soundOn){
playSound(p__1, p__2, p__3);
};
}
public function startTimeWarning():void{
var l__1:Number = SoundManager.VOLUME_TIME_WARNING;
if (!soundOn){
l__1 = 0;
};
timeWarningSoundTransform = new SoundTransform(l__1);
timeWarningSound = new TimeWarningSnd();
timeWarningSoundChannel = timeWarningSound.play(0, 0, timeWarningSoundTransform);
}
public function getSoundOn():Boolean{
return (soundOn);
}
public function getMusicOn():Boolean{
return (musicOn);
}
public function outroFadeOut():void{
if (outroSoundChannel != null){
new SoundFader(outroSoundChannel, OUTRO_FADE_OUT);
};
if (loopSoundChannel != null){
new SoundFader(loopSoundChannel, OUTRO_FADE_OUT);
};
}
}
}//package amazingadventures.client
Section 23
//SpotFoundAnimation (amazingadventures.client.SpotFoundAnimation)
package amazingadventures.client {
import util.*;
import flash.display.*;
public class SpotFoundAnimation implements Renderable {
var move:Movement;// = null
var startTick:int;
var fade:Fader;// = null
var image:Image;
var flower:DisplayObject;
var endScale:Number;
public function SpotFoundAnimation(p__1:Image, p__2:int, p__3:int, p__4:int, p__5:Number, p__6:DisplayObject){
super();
image = p__1;
flower = p__6;
move = new Movement(p__1, p__2, (p__2 + 60), p__1.x, p__1.y, p__3, p__4);
fade = new Fader(p__6, p__2, (p__2 + 60), 1, 0);
startTick = p__2;
endScale = p__5;
}
public function render(p__1:int, p__2:Number):int{
var l__3:Number;
if (move != null){
move.update(p__1, p__2);
fade.update(p__1, p__2);
l__3 = ((1 - endScale) * (((p__1 + p__2) - startTick) / 60));
image.scaleX = (1 - l__3);
image.scaleY = (1 - l__3);
if (p__1 >= move.endTick){
move = null;
fade = null;
};
} else {
flower.alpha = 0;
flower.visible = false;
return (Renderer.STOP);
};
return (Renderer.CONTINUE);
}
}
}//package amazingadventures.client
Section 24
//SpotGameC (amazingadventures.client.SpotGameC)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import flash.display.*;
import flash.geom.*;
import flash.filters.*;
public class SpotGameC {
public var spotGame:SpotGame;// = null
public var leftHalf:GraphicsHalf;// = null
public var rightHalf:GraphicsHalf;// = null
public var gameSprite:Sprite;// = null
public var animationLayer:Sprite;// = null
public var target:Target;// = null
public var imagesToHitLeft:Array;// = null
public var imagesToHitRight:Array;// = null
public var flowerPos:int;// = 0
var leftImages:Array;
var rightImages:Array;
public function SpotGameC(p__1:SpotGame){
var l__2:int;
var l__3:Obj;
var l__4:Obj;
var l__5:Obj;
var l__6:MovieClip;
super();
spotGame = p__1;
gameSprite = p__1.game.c.gameSprite;
animationLayer = p__1.game.c.animationLayer;
leftImages = new Array();
rightImages = new Array();
l__2 = 0;
while (l__2 < p__1.objs.size()) {
l__3 = Obj(p__1.objs.g(l__2));
l__3.c.spotInit();
if (p__1.leftExcludedObjs.indexOf(l__3) == -1){
leftImages.push(l__3.c.left);
};
if (p__1.rightExcludedObjs.indexOf(l__3) == -1){
rightImages.push(l__3.c.right);
};
l__2++;
};
imagesToHitRight = new Array();
l__2 = 0;
while (l__2 < p__1.leftExcludedObjs.size()) {
l__4 = Obj(p__1.leftExcludedObjs.g(l__2));
imagesToHitRight.push(l__4.c.right);
l__2++;
};
imagesToHitLeft = new Array();
l__2 = 0;
while (l__2 < p__1.rightExcludedObjs.size()) {
l__5 = Obj(p__1.rightExcludedObjs.g(l__2));
imagesToHitLeft.push(l__5.c.left);
l__2++;
};
leftHalf = new GraphicsHalf(leftImages, p__1.sideOfScene);
gameSprite.addChild(leftHalf);
rightHalf = new GraphicsHalf(rightImages, p__1.sideOfScene);
rightHalf.x = 378;
gameSprite.addChild(rightHalf);
p__1.game.c.middleBorder.visible = true;
p__1.game.c.middleBorderLeft.visible = true;
p__1.game.c.middleBorderRight.visible = true;
p__1.game.c.middleBorderTop.visible = true;
if (p__1.game.hintsLeft > 0){
p__1.game.c.hintBh.func = hintClicked;
p__1.game.c.hintBh.active = true;
p__1.game.c.newBar.hintMc.addEventListener(MouseEvent.CLICK, hintClicked);
};
p__1.game.c.newBar.itemsLeftBox.visible = true;
p__1.game.c.updateItemsLeft(p__1.excludedObjs.size());
l__2 = 0;
while (l__2 < p__1.excludedObjs.size()) {
l__6 = new ShadowFlower();
l__6.x = (78 + (l__2 * 66));
l__6.y = 10;
p__1.game.c.newBar.newSlideBar.addChild(l__6);
l__2++;
};
p__1.game.c.newBar.newSlideBar.moveShort.visible = true;
}
public function init():void{
target = new Target();
gameSprite.addChild(target);
target.init();
gameSprite.addEventListener(MouseEvent.CLICK, click);
}
public function click(p__1:MouseEvent):void{
var l__2:Number;
var l__3:Number;
var l__4:int;
var l__6:Image;
var l__7:Image;
var l__9:Image;
if ((((p__1.stageX > 0)) && ((p__1.stageX < 756)))){
if (p__1.stageX > 378){
l__2 = (p__1.stageX - 378);
l__3 = p__1.stageX;
} else {
l__2 = p__1.stageX;
l__3 = (p__1.stageX + 378);
};
};
var l__8:* = -1;
l__4 = (leftImages.length - 1);
while (l__4 >= 0) {
l__6 = Image(leftImages[l__4]);
if (((!((getExcludedObjById(l__6.name) == null))) && (l__6.testHit(l__2, p__1.stageY)))){
l__7 = l__6;
l__8 = parseInt(l__6.name.substr(3));
break;
};
l__4--;
};
var l__10:* = -1;
l__4 = (rightImages.length - 1);
while (l__4 >= 0) {
l__6 = Image(rightImages[l__4]);
if (((!((getExcludedObjById(l__6.name) == null))) && (l__6.testHit(l__3, p__1.stageY)))){
l__9 = l__6;
l__10 = parseInt(l__6.name.substr(3));
break;
};
l__4--;
};
l__6 = null;
if ((((l__8 > -1)) && ((l__8 > l__10)))){
l__6 = l__7;
} else {
if (l__10 > -1){
l__6 = l__9;
};
};
var l__11:* = "background";
if (l__6 != null){
l__11 = l__6.name;
};
target.click(spotGame.game.main.gameTimer.currentTick);
spotGame.game.main.renderer.start(target);
spotGame.game.main.addPlayData([Game.INPUT_SPOT_CLICK, l__11, int(p__1.stageX), int(p__1.stageY)]);
}
public function hintClicked(p__1:Event=null):void{
spotGame.game.main.addPlayData([Game.INPUT_HINT]);
if (spotGame.game.hintsLeft <= 1){
spotGame.game.c.hintBh.setOnOff(false);
spotGame.game.c.hintBh.active = false;
spotGame.game.c.newBar.hintMc.visible = false;
} else {
spotGame.game.c.hintBh.setOnOff(true);
};
Main.main.soundManager.startSound(new HintSnd(), SoundManager.VOLUME_HINT);
}
public function giveHint():void{
var l__1:Obj;
var l__3:int;
var l__2:int = (Math.random() * spotGame.excludedObjs.size());
l__1 = Obj(spotGame.excludedObjs.g(l__2));
if (spotGame.rightExcludedObjs.indexOf(l__1) != -1){
l__3 = 1;
};
var l__4:HintAnimation = new HintAnimation(spotGame.game.c);
l__4.miniGameInit(l__3, l__1, spotGame.game.main.gameTimer.currentTick);
spotGame.game.c.hintLayer.addChild(l__4);
spotGame.game.main.renderer.start(l__4);
spotGame.game.c.updateRelaxHints();
}
public function animateSuccess(p__1:int, p__2:Obj, p__3:int, p__4:int):void{
var l__10:int;
var l__21:GraphicsHalf;
var l__22:Image;
spotGame.game.c.updateScoreTf();
spotGame.game.c.updateItemsLeft(spotGame.excludedObjs.size());
var l__5:Image = p__2.c.original_image;
if (p__3 == 1){
l__21 = rightHalf;
l__22 = p__2.c.right;
} else {
l__21 = leftHalf;
l__22 = p__2.c.left;
};
var l__6:GlowFilter = new GlowFilter(0xFFFFFF, 1, 6, 6, 1.49, BitmapFilterQuality.LOW, false, false);
l__5.filters = [l__6];
l__5.x = (l__22.x + p__2.c.offsetx);
l__5.y = (l__22.y + p__2.c.offsety);
l__21.removeChild(l__22);
var l__7:int = Math.floor((l__5.width / 2));
var l__8:int = Math.floor((l__5.height / 2));
var l__9:SuccessAnimation = new SuccessAnimation();
animationLayer.addChild(l__9);
l__9.x = (l__5.x + l__7);
l__9.y = (l__5.y + l__8);
l__9.init(spotGame.game.main.gameTimer.currentTick);
spotGame.game.main.renderer.start(l__9);
if (l__5.x > 378){
l__10 = (l__5.x - 378);
} else {
l__10 = (l__5.x + 378);
};
var l__11:SuccessAnimation = new SuccessAnimation();
animationLayer.addChild(l__11);
l__11.x = (l__10 + l__7);
l__11.y = (l__5.y + l__8);
l__11.init(spotGame.game.main.gameTimer.currentTick);
spotGame.game.main.renderer.start(l__11);
var l__12:Point = l__21.localToGlobal(new Point(l__5.x, l__5.y));
l__5.x = l__12.x;
l__5.y = l__12.y;
animationLayer.addChild(l__5);
var l__13:Number = 48;
var l__14:Number = 1;
var l__15:Number = l__5.width;
if (l__5.height > l__5.width){
l__15 = l__5.height;
};
if (l__15 > l__13){
l__14 = (l__15 / l__13);
l__14 = (1 / l__14);
};
var l__16:Point = spotGame.game.c.newBar.newSlideBar.localToGlobal(new Point((78 + (flowerPos++ * 66)), 10));
l__16.x = (l__16.x + ((48 - (l__5.width * l__14)) / 2));
l__16.y = (l__16.y + ((48 - (l__5.height * l__14)) / 2));
var l__17:DisplayObject = spotGame.game.c.newBar.newSlideBar.getChildAt(flowerPos);
var l__18:SpotFoundAnimation = new SpotFoundAnimation(l__5, p__4, l__16.x, l__16.y, l__14, l__17);
spotGame.game.main.renderer.start(l__18);
var l__19:ScorePop = new ScorePop();
l__19.x = (l__5.x + l__7);
var l__20:int = (755 - 150);
if (l__19.x > l__20){
l__19.x = l__20;
};
l__19.y = (l__5.y + l__8);
animationLayer.addChild(l__19);
l__19.init(p__4, p__1);
spotGame.game.main.renderer.start(l__19);
Main.main.soundManager.startSound(new FoundSnd(), SoundManager.VOLUME_MINI_GAME_MATCH);
}
public function animateFailure(p__1:int, p__2:int, p__3:int):void{
var l__5:ScorePop;
var l__6:int;
spotGame.game.c.updateScoreTf();
var l__4:FailAnimation = new FailAnimation(p__1, p__2, spotGame.game.main.gameTimer.currentTick);
animationLayer.addChild(l__4);
spotGame.game.main.renderer.start(l__4);
if (p__3 < 0){
l__5 = new ScorePop();
animationLayer.addChild(l__5);
l__6 = (755 - 100);
if (p__1 > l__6){
l__5.x = l__6;
} else {
l__5.x = p__1;
};
l__5.y = p__2;
l__5.init(spotGame.game.main.gameTimer.currentTick, p__3);
spotGame.game.main.renderer.start(l__5);
};
Main.main.soundManager.startSound(new PenaltySnd(), SoundManager.VOLUME_PENALTY);
}
public function cleanUp():void{
gameSprite.removeEventListener(MouseEvent.CLICK, click);
target.cleanUp();
}
public function getExcludedObjById(p__1:String):Obj{
var l__3:Obj;
var l__2:int;
while (l__2 < spotGame.excludedObjs.size()) {
l__3 = Obj(spotGame.excludedObjs.g(l__2));
if (p__1 == l__3.id){
return (l__3);
};
l__2++;
};
return (null);
}
}
}//package amazingadventures.client
Section 25
//SpyGameC (amazingadventures.client.SpyGameC)
package amazingadventures.client {
import flash.events.*;
import amazingadventures.*;
import util.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public class SpyGameC {
public var spyGame:SpyGame;// = null
public var gameSprite:Sprite;// = null
public var animationLayer:Sprite;// = null
public var background:Image;// = null
public var slideBar:NewSlideBar;// = null
public var slideBarStartIndex:int;// = 0
public function SpyGameC(spyGame:SpyGame){
var spyGame = spyGame;
super();
spyGame = spyGame;
gameSprite = spyGame.game.c.gameSprite;
animationLayer = spyGame.game.c.animationLayer;
spyGame.game.c.updateItemsLeft(Game.NO_THINGS_TO_FIND);
spyGame.game.c.newBar.scoreMc.scoreTf.text = ("" + 0);
spyGame.game.c.newBar.newSlideBar.levelNameTf.text = Main.gameDataXml.@placename;
background = new Image("0", -1);
background.name = "background";
background.x = 0;
background.y = 0;
gameSprite.addChild(background);
prepareObjs();
prepareTextItems();
spyGame.game.c.hintBh.func = hintClicked;
spyGame.game.c.newBar.hintMc.hint1Tf.text = Main.gameDataXml.text.(@id == "hint");
spyGame.game.c.newBar.hintMc.hint2Tf.text = Main.gameDataXml.text.(@id == "hint");
spyGame.game.c.newBar.hintMc.hint2Tf.visible = false;
spyGame.game.c.newBar.hintMc.hint2Arrow.visible = false;
spyGame.game.c.newBar.hintMc.addEventListener(MouseEvent.CLICK, hintClicked);
gameSprite.addEventListener(MouseEvent.CLICK, gameClicked);
spyGame.game.c.newBar.newSlideBar.moveShort.visible = false;
}
public function wait():Boolean{
return ((spyGame.game.main.gameTimer.currentTick < (2.75 * Game.TICKS_PER_SECOND)));
}
public function gameClicked(p__1:MouseEvent):void{
var l__5:Obj;
var l__3:Obj;
var l__4:int;
if (wait()){
return;
};
var l__2:* = -1;
while (l__4 < spyGame.thingsToFind.size()) {
l__5 = Obj(spyGame.thingsToFind.g(l__4));
if (((!(l__5.found)) && (l__5.c.click(p__1.stageX, p__1.stageY)))){
if (l__5.c.z > l__2){
l__2 = l__5.c.z;
l__3 = l__5;
};
};
l__4++;
};
if (l__3 != null){
l__3.c.hit(p__1.stageX, p__1.stageY);
} else {
spyGame.game.main.addPlayData([Game.INPUT_BG_CLICKED, Math.floor(p__1.stageX), Math.floor(p__1.stageY)]);
};
}
public function hintClicked(p__1:Event=null):void{
if (wait()){
return;
};
spyGame.game.main.addPlayData([Game.INPUT_HINT]);
if (spyGame.game.hintsLeft <= 1){
spyGame.game.c.hintBh.setOnOff(false);
spyGame.game.c.hintBh.active = false;
spyGame.game.c.newBar.hintMc.visible = false;
} else {
spyGame.game.c.hintBh.setOnOff(true);
};
Main.main.soundManager.startSound(new HintSnd(), SoundManager.VOLUME_HINT);
}
public function giveHint():void{
var l__1:Obj;
var l__3:int;
var l__2:Array = new Array();
while (l__3 < spyGame.thingsToFind.size()) {
l__1 = Obj(spyGame.thingsToFind.g(l__3));
if (spyGame.foundThings.indexOf(l__1) == -1){
l__2.push(l__1);
};
l__3++;
};
var l__4:int = (Math.random() * l__2.length);
l__1 = Obj(l__2[l__4]);
var l__5:HintAnimation = new HintAnimation(spyGame.game.c);
l__5.spyInit(l__1, spyGame.game.main.gameTimer.currentTick);
spyGame.game.c.hintLayer.addChild(l__5);
spyGame.game.main.renderer.start(l__5);
spyGame.game.c.updateRelaxHints();
}
public function prepareObjs():void{
var l__3:Obj;
var l__2:int;
var l__1:Stack = spyGame.game.objs;
while (l__2 < l__1.size()) {
l__3 = Obj(l__1.g(l__2));
l__3.c.spyInit(gameSprite);
l__2++;
};
}
public function prepareTextItems():void{
var obj:Obj;
var objId:String;
var str:String;
var textItem:TextItem;
var textFormat:TextFormat;
var row:int;
var col:int;
var i:int;
slideBar = spyGame.game.c.newBar.newSlideBar;
slideBarStartIndex = slideBar.numChildren;
var topMargin = 20;
var lineHeight = 23;
var leftMargin = 75;
var colSpacing = 147;
var stringsXml:XMLList = Main.gameDataXml.strings;
while (i < spyGame.thingsToFind.size()) {
obj = Obj(spyGame.thingsToFind.g(i));
objId = ((Main.gameDataXml.@fileplacename + "_obj_") + Numbers.itoa(obj.nr, 3));
str = String(stringsXml.text.(@id == objId));
textItem = new TextItem();
textFormat = new TextFormat();
textFormat.letterSpacing = 1;
textFormat.size = 13;
textItem.textField.defaultTextFormat = textFormat;
textItem.textField.text = str;
textItem.line.gotoAndStop(0);
slideBar.addChild(textItem);
while ((((textItem.textField.textWidth > (textItem.textField.width - 10))) && ((int(textFormat.size) > 8)))) {
textFormat.size = (int(textFormat.size) - 1);
textItem.textField.setTextFormat(textFormat);
textItem.textField.y = (textItem.textField.y + 0.5);
};
row = 0;
col = i;
if (i >= 5){
row = 1;
col = (i - 5);
};
textItem.x = (leftMargin + (col * colSpacing));
textItem.y = (topMargin + (row * lineHeight));
textItem.visible = false;
i = (i + 1);
};
}
public function thingFound(p__1:Obj, p__2:int, p__3:int):void{
var l__4:Image = p__1.c.original_image;
l__4.x = (p__1.c.left.x + p__1.c.offsetx);
l__4.y = (p__1.c.left.y + p__1.c.offsety);
gameSprite.removeChild(p__1.c.left);
var l__5:TextItem = TextItem(slideBar.getChildAt((slideBarStartIndex + p__2)));
var l__6:Point = slideBar.localToGlobal(new Point(l__5.x, l__5.y));
var l__7:FoundAnimation = new FoundAnimation(animationLayer, l__4, l__5, l__6.x, l__6.y, spyGame.game.main.gameTimer.currentTick, p__3);
spyGame.game.main.renderer.start(l__7);
Main.main.soundManager.startSound(new FoundSnd(), SoundManager.VOLUME_FOUND);
spyGame.game.c.updateScoreTf();
spyGame.game.c.updateItemsLeft((spyGame.thingsToFind.size() - spyGame.foundThings.size()));
}
public function wrongThing(p__1:int, p__2:int, p__3:int):void{
var l__5:ScorePop;
var l__6:int;
spyGame.game.c.updateScoreTf();
var l__4:FailAnimation = new FailAnimation(p__1, p__2, spyGame.game.main.gameTimer.currentTick);
animationLayer.addChild(l__4);
spyGame.game.main.renderer.start(l__4);
if (p__3 < 0){
l__5 = new ScorePop();
animationLayer.addChild(l__5);
l__6 = (755 - 100);
if (p__1 > l__6){
l__5.x = l__6;
} else {
l__5.x = p__1;
};
l__5.y = p__2;
l__5.init(spyGame.game.main.gameTimer.currentTick, p__3);
spyGame.game.main.renderer.start(l__5);
};
Main.main.soundManager.startSound(new PenaltySnd(), SoundManager.VOLUME_PENALTY);
}
public function removeGraphics():void{
var l__2:ObjC;
var l__1:int;
gameSprite.removeChild(background);
while (l__1 < spyGame.game.objs.size()) {
l__2 = Obj(spyGame.game.objs.g(l__1)).c;
l__2.spyCleanUp();
l__1++;
};
while (slideBar.numChildren > 1) {
slideBar.removeChildAt(1);
};
slideBar = null;
gameSprite = null;
animationLayer = null;
}
public function deActivate():void{
gameSprite.removeEventListener(MouseEvent.CLICK, gameClicked);
spyGame.game.c.hintBh.active = false;
}
public function checkForShortGameEnd():void{
if (((spyGame.game.c.shortMode) && ((spyGame.foundThings.size() >= 8)))){
spyGame.game.gameEnd(spyGame.game.main.gameTimer.currentTick, Game.SHORT_GAME_END);
};
}
}
}//package amazingadventures.client
Section 26
//SuccessAnimation (amazingadventures.client.SuccessAnimation)
package amazingadventures.client {
import flash.events.*;
import flash.media.*;
import amazingadventures.*;
import util.*;
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public class SuccessAnimation extends MovieClip implements Renderable {
public var framePlayer:FramePlayer;// = null
public function SuccessAnimation(){
var l__2:MovieClip;
var l__1:int;
addFrameScript(30, frame31);
super();
mouseEnabled = false;
while (l__1 < this.numChildren) {
l__2 = MovieClip(this.getChildAt(l__1));
l__2.mouseEnabled = false;
l__1++;
};
}
public function init(p__1:int):void{
framePlayer = new FramePlayer(this, p__1, 120, 0);
}
public function render(p__1:int, p__2:Number):int{
if (framePlayer != null){
if (p__1 > framePlayer.endTick){
framePlayer = null;
} else {
framePlayer.update(p__1, p__2);
};
};
if (framePlayer == null){
return (Renderer.STOP_REMOVE);
};
return (Renderer.CONTINUE);
}
function frame31(){
}
}
}//package amazingadventures.client
Section 27
//Target (amazingadventures.client.Target)
package amazingadventures.client {
import flash.events.*;
import util.*;
import flash.display.*;
public class Target extends MovieClip implements Renderable {
public var framePlayer:FramePlayer;// = null
public function Target(){
super();
this.gotoAndStop(18);
}
public function init():void{
stage.addEventListener(MouseEvent.MOUSE_MOVE, update);
}
public function cleanUp():void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, update);
}
public function update(p__1:MouseEvent):void{
var l__3:Number;
var l__2:Number = stage.mouseX;
if (l__2 > 378){
l__3 = (l__2 - 378);
} else {
l__3 = (l__2 + 378);
};
if (l__3 < 0){
l__3 = 0;
} else {
if (l__3 > 755){
l__3 = 755;
};
};
x = l__3;
y = stage.mouseY;
p__1.updateAfterEvent();
}
public function click(p__1:int):void{
var l__2:* = 45;
framePlayer = new FramePlayer(this, p__1, l__2, 0);
}
public function render(p__1:int, p__2:Number):int{
if (framePlayer != null){
framePlayer.update(p__1, p__2);
if (p__1 >= framePlayer.endTick){
framePlayer = null;
};
return (Renderer.CONTINUE);
};
return (Renderer.STOP);
}
}
}//package amazingadventures.client
Section 28
//Game (amazingadventures.Game)
package amazingadventures {
import flash.events.*;
import util.*;
import amazingadventures.client.*;
public class Game {
public var objs:Stack;// = null
public var main:Main;// = null
public var spyGame:SpyGame;// = null
public var placeGame:PlaceGame;// = null
public var spotGame:SpotGame;// = null
public var miniGame:Object;// = null
public var rand:Random;// = null
public var countDownTicks:int;// = 0
public var state:int;// = 0
public var c:GameC;// = null
private var playData:Stack;// = null
public var showDialogTick:int;// = -1
public var startMiniGameTick:int;// = -1
public var showEndDialogTick:int;// = -1
public var penalties:int;// = 0
public var hintScore:int;// = 0
public var timeBonus:int;// = 0
public var totalScore:int;// = 0
public var seed:int;// = -1
public var hintsLeft:int;// = 2
public var endReason;// = -1
public static const NOT_SET:int = -1;
public static const NOT_STARTED:int = 0;
public static const SPY_GAME:int = 1;
public static const PLACE_START_DIALOG:int = 2;
public static const PLACE_GAME:int = 3;
public static const SPOT_START_DIALOG:int = 4;
public static const SPOT_GAME:int = 5;
public static const GAME_OVER:int = 6;
public static const STATE_STRINGS:Array = ["not started", "spy game", "place start dialog", "place game", "spot start dialog", "spot game", "game over"];
public static const TIME_RAN_OUT:int = 0;
public static const USER_CHOSE_EXIT:int = 1;
public static const COMPLETED:int = 2;
public static const ERROR:int = 3;
public static const SHORT_GAME_END:int = 4;
public static const RELAX_LAST_MISS:int = 5;
public static const RELAX_COMPLETE:int = 6;
public static const LOAD_SWF_FAIL:int = 7;
public static const END_REASONS:Array = ["timeRanOut", "userChoseExit", "completed", "error", "shortGameEnd", "relaxLastMiss", "relaxComplete", "loadSwfFail"];
public static const INPUT_EXIT:int = 0;
public static const FIRST_TICK:int = 1;
public static const LAST_TICK:int = 2;
public static const CHEAT_TIMER_ALERT:int = 3;
public static const THING_CLICKED:int = 4;
public static const ERROR_MESSAGE:int = 5;
public static const INPUT_HINT:int = 6;
public static const INPUT_BG_CLICKED:int = 7;
public static const INPUT_START_NEXT:int = 8;
public static const INPUT_IMAGE_DRAG:int = 9;
public static const INPUT_IMAGE_DROP:int = 10;
public static const INPUT_SPOT_CLICK:int = 11;
public static const INPUT_PUT_BACK:int = 12;
public static const INPUT_TOGGLE_SOUND:int = 13;
public static const INPUT_TOGGLE_MUSIC:int = 14;
public static const SCORE:int = 15;
public static const INPUT_STRINGS:Array = ["exit", "firstTick", "lastTick", "cheatTimerAlert", "thingClicked", "errorMessage", "hint", "bgClicked", "startMini", "startDrag", "dropImage", "spotClick", "putBack", "toggleSound", "toggleMusic", "score"];
public static const TICKS_PER_SECOND:int = 60;
public static const COUNTDOWN_SECONDS:int = 360;
public static const COUNTDOWN_TICKS:int = 21600;
public static const MINIGAME_DIALOG_SECONDS:int = 10;
public static const MINIGAME_DIALOG_TICKS:int = 600;
public static const NO_THINGS_TO_FIND:int = 10;
public static const PLACES:Array = ["machupicchu", "greece", "amazon", "angkorwat", "ayersrock", "barrierreef", "beachhut", "castle", "greatwall", "hawaii", "hermitage", "igauzufalls", "igloo", "london", "morocco", "petra", "port", "rockymnt", "serengeti", "shipwreck", "speakeasy", "statueofliberty", "tajmahal", "temple", "train"];
public static const PRACTICE_PLACES:Array = [1, 7, 10, 13, 24];
public static const DELUXE_PLACES:Array = ["airplane", "archtent", "bar", "bedroom", "boat", "cavepainting", "courtyard", "digs", "excavation", "garden", "goldmask", "market", "mine", "pyramid", "shipwreck", "stable", "temple", "tent", "throne", "tomb", "treasure", "underwater"];
public static const DELUXE_PRACTICE_PLACES:Array = [0, 7, 11, 12, 15];
public static const MAX_TIME_BONUS:int = 10000;
public static const UNUSED_HINT:int = 2000;
public function Game(main:Main, seed:int){
var main = main;
var seed = seed;
super();
main = main;
seed = seed;
main.log((("[seed " + seed) + "]"));
rand = new Random(seed);
var wasted:int = rand.nextInt(Game.PLACES.length);
main.log(("place: " + getPlaceName()));
countDownTicks = Game.COUNTDOWN_TICKS;
c = new GameC(this);
var removedObjects:Array = Main.gameDataXml.removed.split(":");
makeObjects(Main.gameDataXml.images, removedObjects);
objs.sort(function (p__1:Obj, p__2:Obj):Number{
if (p__1.c.z == p__2.c.z){
return (0);
};
return (((p__1.c.z)<p__2.c.z) ? -1 : 1);
});
playData = new Stack();
spyGame = new SpyGame(this);
}
protected function makeObjects(p__1:XMLList, p__2:Array):void{
var l__5:String;
var l__6:XMLList;
var l__4:int;
objs = new Stack();
var l__3:XMLList = p__1.elements("obj");
while (l__4 < l__3.length()) {
l__5 = l__3[l__4].@id;
if (p__2.indexOf(l__5) == -1){
l__6 = XMLList(l__3[l__4]);
objs.push(new Obj(this, l__6));
};
l__4++;
};
}
public function tick(p__1:int):void{
executePlayData(p__1);
update(p__1);
}
protected function executePlayData(p__1:int):void{
var l__2:Array;
var l__3:int;
var l__4:int;
var l__5:String;
var l__6:String;
var l__7:int;
var l__8:Boolean;
var l__9:String;
while (playData.size() > 0) {
l__2 = playData.remove(0);
l__3 = int(l__2[0]);
l__4 = int(l__2[1]);
l__5 = String(Game.INPUT_STRINGS[l__3]);
l__6 = ((l__5 + " ") + l__4);
l__7 = 2;
while (l__7 < l__2.length) {
l__7 = (l__7 + 1);
l__9 = l__2[l__7];
l__6 = (l__6 + (" " + l__9));
};
main.log((("[" + l__6) + "]"));
l__8 = false;
if (state == Game.SPY_GAME){
l__8 = spyGame.executeInput(l__2, l__3, l__4, p__1);
} else {
if (state == Game.PLACE_GAME){
l__8 = placeGame.executeInput(l__2, l__3, l__4, p__1);
} else {
if (state == Game.SPOT_GAME){
l__8 = spotGame.executeInput(l__2, l__3, l__4, p__1);
} else {
if ((((state == Game.PLACE_START_DIALOG)) || ((state == Game.SPOT_START_DIALOG)))){
switch (l__3){
case Game.THING_CLICKED:
case Game.INPUT_HINT:
case Game.INPUT_BG_CLICKED:
l__8 = true;
l__8;
break;
};
};
};
};
};
if (!l__8){
switch (l__3){
case Game.INPUT_EXIT:
inputExit(p__1);
break;
case Game.INPUT_START_NEXT:
startNext();
break;
case Game.LAST_TICK:
break;
case Game.CHEAT_TIMER_ALERT:
break;
case Game.FIRST_TICK:
break;
case Game.INPUT_TOGGLE_MUSIC:
break;
case Game.INPUT_TOGGLE_SOUND:
break;
default:
main.log(("**** Error in game.tick(). Invalid inputType: " + l__3));
};
if (((!((l__4 == p__1))) && (!((l__3 == Game.LAST_TICK))))){
main.log(((("**** Warning, bad sync! tickToExecute " + l__4) + " currentTick ") + p__1));
};
};
};
}
protected function update(p__1:int):void{
countDown(p__1);
if (p__1 == showDialogTick){
if (c.shortMode){
} else {
(startMiniGameTick = (p__1 + Game.MINIGAME_DIALOG_TICKS));
if (state == Game.PLACE_START_DIALOG){
c.showExtraGameDialog();
spyGame.cleanUp();
(placeGame = new PlaceGame(this));
(miniGame = placeGame);
} else {
if (state == Game.SPOT_START_DIALOG){
c.showExtraGameDialog();
spyGame.cleanUp();
(spotGame = new SpotGame(this));
(miniGame = spotGame);
};
};
};
} else {
if (p__1 == showEndDialogTick){
main.showOutro();
};
};
if (p__1 == startMiniGameTick){
startNext();
};
}
protected function countDown(p__1:int):void{
if ((((((state == Game.SPY_GAME)) || ((state == Game.PLACE_GAME)))) || ((state == Game.SPOT_GAME)))){
if (((!((state == Game.SPY_GAME))) || ((p__1 >= (2.75 * Game.TICKS_PER_SECOND))))){
countDownTicks--;
};
};
if (state != Game.GAME_OVER){
if (countDownTicks <= 0){
gameEnd(p__1, Game.TIME_RAN_OUT);
};
if (countDownTicks == (Game.TICKS_PER_SECOND * 6)){
c.timeWarning(true);
};
};
}
public function startNext():void{
if (state == Game.PLACE_START_DIALOG){
c.startNext();
(state = Game.PLACE_GAME);
(startMiniGameTick = 0);
} else {
if (state == Game.SPOT_START_DIALOG){
c.startNext();
(state = Game.SPOT_GAME);
(startMiniGameTick = 0);
spotGame.c.init();
};
};
}
public function relaxWrongObj(p__1:int):void{
}
public function gameEnd(p__1:int, p__2:int):void{
var l__6:Number;
var l__5:int;
(this.endReason = p__2);
c.deActivate();
var l__3:String = String(Game.END_REASONS[p__2]);
main.log(("gameEnd, endReason: " + l__3));
(state = Game.GAME_OVER);
var l__4:* = 120;
if ((((p__2 == Game.USER_CHOSE_EXIT)) || ((p__2 == Game.TIME_RAN_OUT)))){
l__4 = 5;
l__4;
};
(showEndDialogTick = (main.gameTimer.currentTick + l__4));
if (p__2 == Game.COMPLETED){
(hintScore = (Game.UNUSED_HINT * hintsLeft));
l__6 = (Number(countDownTicks) / Game.COUNTDOWN_TICKS);
l__6;
(timeBonus = Math.floor((Game.MAX_TIME_BONUS * l__6)));
};
(totalScore = (((spyGame.score + penalties) + hintScore) + timeBonus));
main.log(("SpyGame score " + spyGame.score));
if (miniGame != null){
if ((miniGame is PlaceGame)){
(totalScore = (totalScore + placeGame.score));
main.log(("PlaceGame score " + placeGame.score));
} else {
(totalScore = (totalScore + spotGame.score));
main.log(("spotGame score " + spotGame.score));
};
};
main.log(("hintScore " + hintScore));
main.log(("timeBonus " + timeBonus));
main.log(("penalties " + penalties));
main.log(("totalScore " + totalScore));
if ((miniGame is PlaceGame)){
l__5 = placeGame.score;
l__5;
} else {
if ((miniGame is SpotGame)){
l__5 = spotGame.score;
l__5;
};
};
main.addPlayData([Game.SCORE, spyGame.score, l__5, hintScore, timeBonus, penalties, totalScore, countDownTicks]);
main.addPlayData([Game.LAST_TICK, (main.soundManager.soundOn) ? 1 : 0, (main.soundManager.musicOn) ? 1 : 0]);
main.gameEnd(totalScore, p__2);
}
protected function inputExit(p__1:int):void{
trace("InputExit");
}
public function start():void{
(state = Game.SPY_GAME);
c.start();
}
public function addPlayData(p__1:Array):void{
playData.push(p__1);
}
public function getPlaceName():String{
return (Main.gameDataXml.@placename);
}
public function spyGameEnded(p__1:MouseEvent=null):void{
main.soundManager.startLevelClearSound();
var l__2:int = rand.nextInt(2);
if (l__2 == 0){
(state = Game.PLACE_START_DIALOG);
main.log("mini game: place");
} else {
(state = Game.SPOT_START_DIALOG);
main.log("mini game: spot");
};
var l__3:* = 120;
if (p__1 != null){
l__3 = 5;
l__3;
};
(showDialogTick = (main.gameTimer.currentTick + l__3));
}
public function getObj(p__1:int):Obj{
var l__3:Obj;
var l__2:int;
while (l__2 < objs.size()) {
l__3 = Obj(objs.g(l__2));
l__3;
if (l__3.nr == p__1){
return (l__3);
};
var _temp1 = l__2;
l__2 = (l__2 + 1);
_temp1;
};
return (null);
}
public function getCurrentScore():int{
var l__1:int = getScoreBeforePenalties();
l__1 = (l__1 + penalties);
l__1;
if (l__1 < 0){
l__1 = 0;
l__1;
};
return (l__1);
}
public function getScoreBeforePenalties():int{
var l__1:int = spyGame.score;
if ((((state == Game.PLACE_GAME)) || ((((state == Game.GAME_OVER)) && ((miniGame is PlaceGame)))))){
l__1 = (l__1 + placeGame.score);
l__1;
} else {
if ((((state == Game.SPOT_GAME)) || ((((state == Game.GAME_OVER)) && ((miniGame is SpotGame)))))){
l__1 = (l__1 + spotGame.score);
l__1;
};
};
return (l__1);
}
public function subtractPenalty(p__1):int{
var l__2:int = getCurrentScore();
(penalties = (penalties + p__1));
var l__3:int = (getCurrentScore() - l__2);
var l__4:int = getScoreBeforePenalties();
if ((l__4 + penalties) < 0){
(penalties = -(l__4));
};
return (l__3);
}
public function destroy():void{
c.deActivate();
if (placeGame != null){
placeGame.c.cleanUp();
};
if (spotGame != null){
spotGame.c.cleanUp();
};
}
}
}//package amazingadventures
Section 29
//Main (amazingadventures.Main)
package amazingadventures {
import flash.events.*;
import util.*;
import flash.display.*;
import amazingadventures.client.*;
import flash.net.*;
import flash.external.*;
public class Main extends Sprite {
public var game:Game;// = null
public var renderer:Renderer;// = null
public var soundManager:SoundManager;// = null
public var gameTimer:GameTimer;// = null
public var gameLog:String;// = ""
public var communicator:Communicator;// = null
public var intro:Intro;// = null
public var outro:Outro;// = null
public var middleGameDialog;// = null
public static const DEV_MODE:int = 1;
public static const MONEY_GAME:int = 1;
public static const GAME_TYPE:int = 1;
public static var gameDataXml:XML = null;
public static var main:Main = null;
public static var renderer:Renderer = null;
public function Main(){
super();
Main.main = this;
renderer = new Renderer();
Main.renderer = renderer;
communicator = new Communicator();
soundManager = new SoundManager();
intro = new Intro(this);
addChild(intro);
gameTimer = new GameTimer(Game.TICKS_PER_SECOND, null, renderer);
addEventListener("enterFrame", gameTimer.advanceTime);
if (Main.GAME_TYPE == Main.DEV_MODE){
fakeGameData();
} else {
getGameData();
};
}
protected function getGameData():void{
var l__1:Object = ExternalInterface.call("getGameData");
if (((!((l__1 == null))) && (l__1.success))){
Main.gameDataXml = new XML(l__1.message);
gameDataLoaded();
} else {
log("Error: Could not load game Data!");
};
}
protected function fakeGameData():void{
var myLoader:URLLoader;
var xmlLoaded:Function;
var loadError:Function;
var drRan:int;
drRan = int((Math.random() * 5));
trace(("drRan:" + drRan));
xmlLoaded = function (p__1:Event):void{
Main.gameDataXml = new XML(myLoader.data);
gameDataLoaded();
};
loadError = function (p__1:Event):void{
trace(("xml load error " + p__1));
};
myLoader = new URLLoader();
myLoader.addEventListener(Event.COMPLETE, xmlLoaded);
myLoader.addEventListener(IOErrorEvent.IO_ERROR, loadError);
myLoader.load(new URLRequest((("arcade/gamedata/ScrapbookAS3v2GerDR/" + drRan) + "_ger.xml")));
}
public function gameDataLoaded():void{
if (parseInt(Main.gameDataXml.@sound) == 0){
soundManager.toggleSound();
};
if (parseInt(Main.gameDataXml.@music) == 0){
soundManager.toggleMusic();
};
soundManager.startIntroSound();
intro.gameDataReady();
Image.LoadSwf(this, Main.gameDataXml.@graphicspath);
}
public function prepareRelaxGames():void{
}
public function middleGameDialogStarted():void{
game.destroy();
removeChild(game.c);
game = null;
}
public function graphicsLoaded():void{
var l__1:int = (int((Math.random() * 10000000000)) + 1);
game = new Game(this, l__1);
intro.init();
}
public function startGame(p__1:Event=null):void{
stage.frameRate = 120;
game.start();
if (Main.GAME_TYPE == Main.MONEY_GAME){
};
removeEventListener("enterFrame", gameTimer.advanceTime);
gameTimer = new GameTimer(Game.TICKS_PER_SECOND, game, renderer);
addEventListener("enterFrame", gameTimer.advanceTime);
addPlayData([Game.FIRST_TICK]);
}
public function addPlayData(p__1:Array):void{
var l__2:int = (gameTimer.currentTick + 1);
p__1.splice(1, 0, l__2);
game.addPlayData(p__1);
if (Main.GAME_TYPE == Main.MONEY_GAME){
};
}
public function showMiddleGameDialog():void{
middleGameDialog = new MiddleGameDialog(-1, true, this);
addChild(middleGameDialog);
}
public function showOutro():void{
outro = new Outro(game);
addChild(outro);
renderer.start(outro);
}
public function gameEnd(p__1:int, p__2:int):void{
trace(((("EndGame:" + p__1) + " ") + p__2));
if (Main.GAME_TYPE == Main.MONEY_GAME){
};
}
public function gameQuit(p__1:Event=null):void{
trace("gameQuit");
}
public function log(p__1:String):void{
gameLog = (gameLog + (p__1 + "\n"));
}
public function loadFail():void{
var l__1:int;
gameEnd(l__1, Game.LOAD_SWF_FAIL);
}
}
}//package amazingadventures
Section 30
//Obj (amazingadventures.Obj)
package amazingadventures {
import amazingadventures.client.*;
public class Obj {
public var game:Game;// = null
public var c:ObjC;// = null
public var id:String;// = ""
public var substitute:int;// = 0
public var nr:int;// = -1
public var spot:int;// = -1
public var place:int;// = -1
public var found:Boolean;// = false
public static const NOT_SET:int = -1;
public static const LEFT:int = 0;
public static const RIGHT:int = 1;
public function Obj(p__1:Game, p__2:XMLList){
super();
game = p__1;
id = ("obj" + p__2.@id);
nr = parseInt(p__2.@id);
var l__3:int = p__2.elements("pos").length();
substitute = p__1.rand.nextInt(l__3);
c = new ObjC(this, p__2);
if (mostlyVisible(c.y, c.height, 10, 600)){
if (mostlyVisible(c.x, c.width, 10, 364)){
spot = Obj.LEFT;
place = Obj.LEFT;
} else {
if (mostlyVisible(c.x, c.width, 386, 745)){
spot = Obj.RIGHT;
place = Obj.RIGHT;
};
};
};
var l__4:Number = (c.origWidth / c.origHeight);
var l__5:Number = Math.max(c.origWidth, c.origHeight);
if ((((((l__5 > 128)) && ((((l__4 < 0.33)) || ((l__4 > 3)))))) || ((l__5 > 196)))){
place = Obj.NOT_SET;
};
}
private function mostlyVisible(p__1:Number, p__2:Number, p__3:Number, p__4:Number){
var l__5:Number = Math.max((p__3 - p__1), 0);
var l__6:Number = Math.max(((p__1 + p__2) - p__4), 0);
return ((((l__5 + l__6) / p__2) < 0.3));
}
public function toString():String{
return ((((((((((((((("[" + id) + " ") + nr) + " s:") + spot) + " p:") + place) + " ") + c.image) + " ") + c.x) + " ") + c.y) + "]"));
}
}
}//package amazingadventures
Section 31
//PlaceGame (amazingadventures.PlaceGame)
package amazingadventures {
import flash.events.*;
import util.*;
import amazingadventures.client.*;
public class PlaceGame {
public var game:Game;// = null
public var objs:Stack;// = null
public var c:PlaceGameC;// = null
public var score:int;// = 0
public var excludedObjs:Stack;// = null
public var leftObjs:Stack;// = null
public var rightObjs:Stack;// = null
public var lastHitTick:int;// = -1
public var sideOfScene:int;// = -1
public var draggedObj:Obj;// = null
public static const OBJ_POINTS:int = 1000;
public static const WRONG_OBJ:int = -200;
public static const NO_THINGS_TO_PLACE:int = 10;
public function PlaceGame(p__1:Game){
var l__5:int;
var l__6:Boolean;
var l__2:Obj;
var l__3:int;
var l__4:int;
super();
game = p__1;
sideOfScene = p__1.rand.nextInt(2);
p__1.main.log(("sideOfScene " + sideOfScene));
objs = new Stack();
while (l__3 < p__1.objs.size()) {
l__2 = Obj(p__1.objs.g(l__3));
if (l__2.place == sideOfScene){
objs.push(l__2);
};
l__3++;
};
excludedObjs = new Stack();
leftObjs = new Stack();
rightObjs = new Stack();
while (l__4 < PlaceGame.NO_THINGS_TO_PLACE) {
l__5 = 0;
do {
l__5 = p__1.rand.nextInt(objs.size());
l__2 = Obj(objs.g(l__5));
} while (((!((leftObjs.indexOf(l__2) == -1))) || (!((rightObjs.indexOf(l__2) == -1)))));
l__6 = (p__1.rand.nextInt(2) == 1);
excludedObjs.push(l__2);
if (l__6){
rightObjs.push(l__2);
p__1.main.log(("right " + l__2.nr));
} else {
leftObjs.push(l__2);
p__1.main.log(("left " + l__2.nr));
};
l__4++;
};
c = new PlaceGameC(this);
}
public function executeInput(p__1:Array, p__2:int, p__3:int, p__4:int):Boolean{
var l__5:* = true;
switch (p__2){
case Game.INPUT_IMAGE_DRAG:
startImageDrag(String(p__1[2]));
break;
case Game.INPUT_IMAGE_DROP:
imageDropped(Boolean(p__1[2]), p__4);
break;
case Game.INPUT_PUT_BACK:
putBack(p__4);
break;
case Game.INPUT_BG_CLICKED:
break;
case Game.INPUT_HINT:
giveHint();
break;
default:
l__5 = false;
};
return (l__5);
}
public function startImageDrag(p__1:String):void{
var l__2:int = parseInt(p__1.substr(3));
var l__3:Obj = game.getObj(l__2);
if (excludedObjs.indexOf(l__3) != -1){
draggedObj = l__3;
c.startImageDrag(p__1);
};
}
public function imageDropped(p__1:Boolean, p__2:int):void{
var l__3:int;
var l__4:int;
if (p__1){
score = (score + PlaceGame.OBJ_POINTS);
game.main.log("success");
l__3 = excludedObjs.indexOf(draggedObj);
excludedObjs.remove(l__3);
l__3 = leftObjs.indexOf(draggedObj);
if (l__3 != -1){
leftObjs.remove(l__3);
};
l__3 = rightObjs.indexOf(draggedObj);
if (l__3 != -1){
rightObjs.remove(l__3);
};
game.spyGame.logScore();
logScore();
lastHitTick = p__2;
if (excludedObjs.size() == 0){
lastHitTick = -1;
game.gameEnd(game.main.gameTimer.currentTick, Game.COMPLETED);
game.main.soundManager.startLevelClearSound();
};
c.animateSuccess(PlaceGame.OBJ_POINTS);
} else {
game.main.log("fail");
l__4 = game.subtractPenalty(SpotGame.WRONG_OBJ);
game.spyGame.logScore();
logScore();
c.animateFailure(game.main.gameTimer.currentTick, l__4);
};
draggedObj = null;
}
public function putBack(p__1:int):void{
c.animatePutBack(p__1);
draggedObj = null;
}
public function giveHint():void{
if (game.hintsLeft > 0){
game.hintsLeft--;
c.giveHint();
};
}
public function logScore():void{
game.main.log(("place game score: " + score));
}
}
}//package amazingadventures
Section 32
//SpotGame (amazingadventures.SpotGame)
package amazingadventures {
import util.*;
import amazingadventures.client.*;
public class SpotGame {
public var game:Game;// = null
public var objs:Stack;// = null
public var c:SpotGameC;// = null
public var score:int;// = 0
public var excludedObjs:Stack;// = null
public var lastHitTick:int;// = -1
public var sideOfScene:int;// = -1
public var leftExcludedObjs:Stack;// = null
public var rightExcludedObjs:Stack;// = null
public static const OBJ_POINTS:int = 1000;
public static const WRONG_OBJ:int = -200;
public static const NO_THINGS_TO_FIND:int = 10;
public function SpotGame(p__1:Game){
var l__5:int;
var l__6:Boolean;
var l__2:Obj;
var l__3:int;
var l__4:int;
super();
game = p__1;
sideOfScene = p__1.rand.nextInt(2);
p__1.main.log(("sideOfScene " + sideOfScene));
objs = new Stack();
while (l__3 < p__1.objs.size()) {
l__2 = Obj(p__1.objs.g(l__3));
if (l__2.spot == sideOfScene){
objs.push(l__2);
};
l__3++;
};
excludedObjs = new Stack();
leftExcludedObjs = new Stack();
rightExcludedObjs = new Stack();
while (l__4 < SpotGame.NO_THINGS_TO_FIND) {
l__5 = 0;
do {
l__5 = p__1.rand.nextInt(objs.size());
l__2 = Obj(objs.g(l__5));
} while (((!((leftExcludedObjs.indexOf(l__2) == -1))) || (!((rightExcludedObjs.indexOf(l__2) == -1)))));
l__6 = (p__1.rand.nextInt(2) == 1);
excludedObjs.push(l__2);
if (l__6){
rightExcludedObjs.push(l__2);
p__1.main.log(("right missing " + l__2.nr));
} else {
leftExcludedObjs.push(l__2);
p__1.main.log(("left missing " + l__2.nr));
};
l__4++;
};
c = new SpotGameC(this);
}
public function executeInput(p__1:Array, p__2:int, p__3:int, p__4:int):Boolean{
var l__5:* = true;
switch (p__2){
case Game.INPUT_SPOT_CLICK:
spotClick(String(p__1[2]), int(p__1[3]), int(p__1[4]), p__4);
break;
case Game.INPUT_BG_CLICKED:
break;
case Game.INPUT_HINT:
giveHint();
break;
default:
l__5 = false;
};
return (l__5);
}
public function spotClick(p__1:String, p__2:int, p__3:int, p__4:int):void{
var l__6:Obj;
var l__7:int;
var l__9:int;
var l__10:int;
var l__5:Boolean;
var l__8:* = -1;
if (p__1 != "background"){
l__9 = 0;
while (l__9 < excludedObjs.size()) {
l__6 = Obj(excludedObjs.g(l__9));
if (p__1 == l__6.id){
l__5 = true;
l__7 = excludedObjs.indexOf(l__6);
excludedObjs.remove(l__7);
l__7 = leftExcludedObjs.indexOf(l__6);
if (l__7 != -1){
l__8 = 1;
leftExcludedObjs.remove(l__7);
};
l__7 = rightExcludedObjs.indexOf(l__6);
if (l__7 != -1){
l__8 = 0;
rightExcludedObjs.remove(l__7);
};
lastHitTick = p__4;
break;
};
l__9++;
};
};
if (l__5){
game.main.log("success");
score = (score + SpotGame.OBJ_POINTS);
game.spyGame.logScore();
logScore();
c.animateSuccess(SpotGame.OBJ_POINTS, l__6, l__8, p__4);
if (excludedObjs.size() == 0){
lastHitTick = -1;
game.gameEnd(game.main.gameTimer.currentTick, Game.COMPLETED);
game.main.soundManager.startLevelClearSound();
};
} else {
game.main.log("fail");
l__10 = game.subtractPenalty(SpotGame.WRONG_OBJ);
game.spyGame.logScore();
logScore();
c.animateFailure(p__2, p__3, l__10);
};
}
public function giveHint():void{
if (game.hintsLeft > 0){
game.hintsLeft--;
c.giveHint();
};
}
public function logScore():void{
game.main.log(("spot game score: " + score));
}
}
}//package amazingadventures
Section 33
//SpyGame (amazingadventures.SpyGame)
package amazingadventures {
import util.*;
import flash.display.*;
import amazingadventures.client.*;
public class SpyGame {
public var game:Game;// = null
public var c:SpyGameC;// = null
public var score:int;// = 0
public var lastHitTick:int;// = -1
public var thingsToFind:Stack;// = null
public var foundThings:Stack;// = null
public var completed:Boolean;// = false
public static const OBJ_POINTS:int = 1000;
public static const WRONG_OBJ:int = -200;
public function SpyGame(p__1:Game){
var l__3:int;
var l__4:Obj;
var l__2:int;
super();
game = p__1;
thingsToFind = new Stack();
foundThings = new Stack();
p__1.main.log("thingsToFind:");
while (l__2 < Game.NO_THINGS_TO_FIND) {
l__3 = 0;
do {
l__3 = p__1.rand.nextInt(p__1.objs.size());
l__4 = Obj(p__1.objs.g(l__3));
} while (thingsToFind.indexOf(l__4) != -1);
thingsToFind.push(l__4);
p__1.main.log(("obj " + l__4.nr));
l__2++;
};
c = new SpyGameC(this);
}
public function executeInput(p__1:Array, p__2:int, p__3:int, p__4:int):Boolean{
var l__5:* = true;
switch (p__2){
case Game.THING_CLICKED:
thingClicked(parseInt(p__1[2]), int(p__1[3]), int(p__1[4]), p__4);
break;
case Game.INPUT_BG_CLICKED:
bgClicked(int(p__1[2]), int(p__1[3]));
break;
case Game.INPUT_HINT:
giveHint();
break;
default:
l__5 = false;
};
return (l__5);
}
public function thingClicked(p__1:int, p__2:int, p__3:int, p__4:int):void{
var l__7:Obj;
var l__8:int;
var l__5:Boolean;
var l__6:int;
while (l__6 < thingsToFind.size()) {
l__7 = Obj(thingsToFind.g(l__6));
if ((((foundThings.indexOf(l__7) == -1)) && ((p__1 == l__7.nr)))){
game.main.log(("found " + l__7.id));
l__5 = true;
foundThings.push(l__7);
score = (score + SpyGame.OBJ_POINTS);
logScore();
lastHitTick = p__4;
l__7.found = true;
c.thingFound(l__7, l__6, SpyGame.OBJ_POINTS);
c.checkForShortGameEnd();
if (foundThings.size() >= Game.NO_THINGS_TO_FIND){
completed = true;
lastHitTick = -1;
game.spyGameEnded();
c.deActivate();
};
break;
};
l__6++;
};
if (!l__5){
game.main.log(("wrong obj " + p__1));
l__8 = game.subtractPenalty(SpyGame.WRONG_OBJ);
logScore();
c.wrongThing(p__2, p__3, l__8);
};
}
public function bgClicked(p__1:int, p__2:int):void{
game.main.log("wrong obj background");
var l__3:int = game.subtractPenalty(SpyGame.WRONG_OBJ);
logScore();
c.wrongThing(p__1, p__2, l__3);
}
public function giveHint():void{
if (game.hintsLeft > 0){
game.hintsLeft--;
c.giveHint();
};
}
public function cleanUp():void{
c.removeGraphics();
thingsToFind = null;
foundThings = null;
}
public function logScore():void{
game.main.log(("spy game score: " + score));
}
}
}//package amazingadventures
Section 34
//ChainResize (util.ChainResize)
package util {
import flash.events.*;
import flash.display.*;
public class ChainResize {
var displayObject:DisplayObject;
var points:Array;
var from:ResizePoint;
var to:ResizePoint;
public function ChainResize(p__1:DisplayObject){
super();
displayObject = p__1;
points = new Array();
}
public function addResize(p__1:int, p__2:Number, p__3:Number):void{
points.push(new ResizePoint(p__1, p__2, p__3));
}
public function update(p__1:int, p__2:Number):int{
var l__3:Number;
var l__4:Number;
var l__5:Number;
var l__6:Number;
if (from == null){
from = shift();
to = shift();
};
if (p__1 >= to.tick){
if (points.length > 0){
from = to;
to = shift();
} else {
displayObject.scaleX = to.scaleX;
displayObject.scaleY = to.scaleY;
return (Renderer.STOP);
};
};
if (((!((from == null))) && (!((to == null))))){
l__3 = (to.tick - from.tick);
l__4 = (to.scaleX - from.scaleX);
l__5 = (to.scaleY - from.scaleY);
l__6 = (((p__1 + p__2) - from.tick) / l__3);
displayObject.scaleX = (from.scaleX + (l__4 * l__6));
displayObject.scaleY = (from.scaleY + (l__5 * l__6));
};
return (Renderer.CONTINUE);
}
public function shift():ResizePoint{
return (ResizePoint(points.shift()));
}
}
}//package util
Section 35
//Communicator (util.Communicator)
package util {
import flash.external.*;
import flash.system.*;
public class Communicator {
public function Communicator(){
super();
}
public function sendPlayData(p__1:Array):void{
var l__2:String = ((String(p__1[0]) + ",") + String(p__1[1]));
var l__3:int = p__1.length;
var l__4:* = 2;
while (l__4 < l__3) {
l__2 = (l__2 + (" " + String(p__1[l__4])));
l__4++;
};
l__2 = (l__2 + "=0");
ExternalInterface.call("playData", l__2);
}
public function sendFsCommand(p__1:String, p__2:String):void{
fscommand(p__1, p__2);
}
}
}//package util
Section 36
//Fader (util.Fader)
package util {
import amazingadventures.*;
import flash.display.*;
public class Fader {
public var displayObject:DisplayObject;
public var startTick:int;// = -1
public var endTick:int;// = -1
public var totalTicks:int;// = -1
public var startAlpha:Number;// = 0
public var endAlpha:Number;// = 0
public var alphaChange:Number;// = 0
public function Fader(p__1:DisplayObject, p__2:int, p__3:int, p__4:Number, p__5:Number){
super();
displayObject = p__1;
startTick = p__2;
endTick = p__3;
totalTicks = (p__3 - p__2);
startAlpha = p__4;
endAlpha = p__5;
alphaChange = (p__5 - p__4);
}
public function update(p__1:int, p__2:Number):Boolean{
var l__4:Number;
var l__3:Boolean;
if (p__1 >= startTick){
if (p__1 >= endTick){
displayObject.alpha = endAlpha;
l__3 = true;
} else {
l__4 = (((p__1 + p__2) - startTick) / totalTicks);
displayObject.alpha = (startAlpha + (alphaChange * l__4));
};
};
return (l__3);
}
}
}//package util
Section 37
//FramePlayer (util.FramePlayer)
package util {
import amazingadventures.*;
import flash.display.*;
public class FramePlayer {
public var startTick:int;
public var endTick:int;
public var movieClip:MovieClip;
public var ticks:int;
public var remainingRepeats:int;
public var forward:Boolean;
public function FramePlayer(p__1:MovieClip, p__2:int, p__3:int, p__4:int, p__5:Boolean=true){
super();
movieClip = p__1;
startTick = p__2;
ticks = p__3;
endTick = (p__2 + p__3);
forward = p__5;
remainingRepeats = p__4;
}
public function update(p__1:int, p__2:Number):int{
var l__3:int;
var l__4:Number;
var l__5:int;
if (p__1 >= startTick){
if (p__1 >= endTick){
if (remainingRepeats-- > 0){
endTick = (p__1 + ticks);
startTick = p__1;
update(p__1, p__2);
} else {
movieClip.gotoAndStop(getFrame(movieClip.totalFrames));
return (Renderer.STOP);
};
} else {
l__3 = (p__1 - startTick);
l__4 = (l__3 / ticks);
l__5 = (1 + (l__4 * movieClip.totalFrames));
movieClip.gotoAndStop(getFrame(l__5));
};
};
return (Renderer.CONTINUE);
}
protected function getFrame(p__1:int):int{
if (forward){
return (p__1);
};
return (((movieClip.totalFrames + 1) - p__1));
}
}
}//package util
Section 38
//Integer64 (util.Integer64)
package util {
import flash.events.*;
import util.*;
class Integer64 {
private var p:Array;
private var r:Array;
private var s:Array;
function Integer64(p__1){
super();
r = [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]];
p = [0, 0, 0, 0, 0];
s = [0, 0, 0];
if (p__1){
merge(p__1);
};
}
public function init(p__1:Integer64):void{
var l__2:* = 0;
while (l__2 < p.length) {
p[l__2] = p__1.p[l__2];
l__2 = (l__2 + 1);
};
}
public function init32(p__1:Number):void{
p[0] = (p__1 & 32767);
p__1 = (p__1 >>> 15);
p[1] = (p__1 & 32767);
p__1 = (p__1 >>> 15);
p[2] = (p__1 & 3);
p[3] = 0;
p[4] = 0;
}
public function get lsb():Number{
return (((p[0] | (p[1] << 15)) | ((p[2] & 3) << 30)));
}
public function get msb():Number{
return (((((p[2] >> 2) | ((p[3] << 15) >> 2)) | ((p[4] << (15 * 2)) >> 2)) & 2147483647));
}
public function binaryShiftLeft(p__1:Number):void{
var l__2:* = 0;
while (l__2 < p__1) {
shl();
l__2 = (l__2 + 1);
};
}
public function binaryShiftRight(p__1:Number):void{
var l__5:* = undefined;
var l__6:* = undefined;
var l__2:* = ((p__1 / 15) >> 0);
var l__3:* = (p__1 - (l__2 * 15));
var l__4:* = (p.length - 1);
while (l__4 > 0) {
l__5 = 0;
while (l__5 < l__2) {
p[l__5] = p[(l__5 + 1)];
l__5 = (l__5 + 1);
};
l__4--;
p[l__4] = 0;
};
if (l__3 > 0){
l__6 = 0;
while (l__6 < l__3) {
shr();
l__6 = (l__6 + 1);
};
};
}
public function binaryNot(p__1:Integer64):void{
p[0] = (p[0] ^ p__1.p[0]);
p[1] = (p[1] ^ p__1.p[1]);
p[2] = (p[2] ^ p__1.p[2]);
p[3] = (p[3] ^ p__1.p[3]);
p[4] = (p[4] ^ p__1.p[4]);
}
public function add64(p__1:Integer64):void{
var l__2:* = 0;
var l__3:* = 1;
var l__4:* = 0;
while ((((l__3 < p.length)) && (!((p__1.p[l__4] == 0))))) {
l__3 = (l__3 + 1);
};
l__4 = 0;
while (l__4 < l__3) {
l__2 = (l__2 + (p[l__4] + p__1.p[l__4]));
p[l__4] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__4 = (l__4 + 1);
};
}
public function add32(p__1:Number):void{
var l__2:* = 0;
var l__3:* = (p__1 & 32767);
p__1 = (p__1 >> 15);
var l__4:* = (p__1 & 32767);
p__1 = (p__1 >> 15);
var l__5:* = (p__1 & 3);
l__2 = (l__2 + (p[0] + l__3));
p[0] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (p[1] + l__4));
p[1] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (p[2] + l__5));
p[2] = (l__2 & 32767);
}
public function mulu32(p__1:Number):void{
var l__4:* = undefined;
var l__2:* = 0;
s[0] = (p__1 & 32767);
p__1 = (p__1 >>> 15);
s[1] = (p__1 & 32767);
p__1 = (p__1 >>> 15);
s[2] = (p__1 & 3);
var l__3:* = 0;
while (l__3 < 3) {
l__4 = s[l__3];
l__2 = (l__4 * p[0]);
r[l__3][0] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (l__4 * p[1]));
r[l__3][1] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (l__4 * p[2]));
r[l__3][2] = (l__2 & 3);
l__3 = (l__3 + 1);
};
l__2 = r[0][0];
p[0] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (r[0][1] + r[1][0]));
p[1] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + ((r[0][2] + r[1][1]) + r[2][0]));
p[2] = (l__2 & 3);
p[3] = 0;
p[4] = 0;
}
public function mul64(p__1:Integer64):void{
var l__4:* = undefined;
var l__2:* = 0;
var l__3:* = 0;
while (l__3 < 5) {
l__4 = p__1.p[l__3];
l__2 = (l__4 * p[0]);
r[l__3][0] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (l__4 * p[1]));
r[l__3][1] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (l__4 * p[2]));
r[l__3][2] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (l__4 * p[3]));
r[l__3][3] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (l__4 * p[4]));
r[l__3][4] = (l__2 & 32767);
l__3 = (l__3 + 1);
};
l__2 = r[0][0];
p[0] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (r[0][1] + r[1][0]));
p[1] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + ((r[0][2] + r[1][1]) + r[2][0]));
p[2] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + (((r[0][3] + r[1][2]) + r[2][1]) + r[3][0]));
p[3] = (l__2 & 32767);
l__2 = (l__2 >> 15);
l__2 = (l__2 + ((((r[0][4] + r[1][3]) + r[2][2]) + r[3][1]) + r[4][0]));
p[4] = (l__2 & 7);
}
public function mul32(p__1:Number):void{
mul64(new Integer64(p__1));
}
private function merge(p__1:Number):Number{
var l__2:* = 0;
while (l__2 < 3) {
p[l__2] = (p[l__2] + (p__1 & 32767));
p__1 = (p__1 >>> 15);
l__2 = (l__2 + 1);
};
return (p__1);
}
private function shl():void{
var l__1:* = 0;
var l__2:* = 0;
var l__3:* = 0;
var l__4:* = p.length;
while (l__3 < l__4) {
l__1 = ((p[l__3] & 0x4000) >> 14);
p[l__3] = (p[l__3] << 1);
p[l__3] = ((p[l__3] | l__2) & 32767);
l__3 = (l__3 + 1);
l__2 = l__1;
};
}
private function shr():void{
var l__1:* = 0;
var l__2:* = 0;
var l__3:* = (p.length - 1);
while (l__3 >= 0) {
l__1 = ((p[l__3] & 1) << 14);
p[l__3] = (p[l__3] >> 1);
p[l__3] = ((p[l__3] | l__2) & 32767);
l__3--;
l__2 = l__1;
};
}
}
}//package util
Section 39
//Movement (util.Movement)
package util {
import flash.display.*;
public class Movement {
public var displayObject:DisplayObject;
public var startTick:int;
public var endTick:int;
public var totalTicks:int;
public var startX:Number;
public var startY:Number;
public var endX:Number;
public var endY:Number;
public var distanceX:Number;
public var distanceY:Number;
public function Movement(p__1:DisplayObject, p__2:int, p__3:int, p__4:Number, p__5:Number, p__6:Number, p__7:Number){
super();
displayObject = p__1;
startTick = p__2;
endTick = p__3;
totalTicks = (p__3 - p__2);
startX = p__4;
startY = p__5;
endX = p__6;
endY = p__7;
distanceX = (p__6 - p__4);
distanceY = (p__7 - p__5);
}
public function update(p__1:int, p__2:Number):Boolean{
var l__4:Number;
var l__3:Boolean;
if (p__1 >= startTick){
if (p__1 >= endTick){
displayObject.x = endX;
displayObject.y = endY;
l__3 = true;
} else {
l__4 = (((p__1 + p__2) - startTick) / totalTicks);
displayObject.x = (startX + (distanceX * l__4));
displayObject.y = (startY + (distanceY * l__4));
};
};
return (l__3);
}
}
}//package util
Section 40
//Random (util.Random)
package util {
import flash.utils.*;
public class Random {
private var mta:Array;
private var lastSeed:Number;
private var mti:Number;
private static var N:Number = 624;
private static var M:Number = 397;
private static var MATRIX_A:Number = 2567483615;
private static var UPPER_MASK:Number = 2147483648;
private static var LOWER_MASK:Number = 2147483647;
private static var mag01:Array = [0, 2567483615];
public function Random(p__1:Number){
super();
mta = new Array(N);
mti = (N + 1);
if (p__1){
init_genrand(p__1);
};
}
public function set seed(p__1:Number){
init_genrand(p__1);
}
public function get seed():Number{
return (lastSeed);
}
public function nextInt(p__1:Number){
return (((genrand_int32() & 2147483647) % p__1));
}
public function nextFloat(){
return ((next(24) / (1 << 24)));
}
public function nextDouble(){
return ((next(24) / (1 << 24)));
}
public function next(p__1:Number){
if (p__1 < 32){
return ((genrand_int32() & ((1 << p__1) - 1)));
};
return (genrand_int32());
}
private function init_genrand(p__1:Number):void{
p__1 = int(p__1);
var l__2:* = getTimer();
lastSeed = p__1;
mta[0] = p__1;
var l__3:* = p__1;
var l__4:* = new Integer64(null);
var l__5:Number = N;
mti = 1;
while (mti < l__5) {
l__4.init32(((l__3 >>> 30) ^ l__3));
l__4.mulu32(1812433253);
l__3 = (mta[mti] = int((l__4.lsb + mti)));
mti++;
};
var l__6:* = getTimer();
}
private function genrand_int32(){
var l__3:* = undefined;
var l__4:* = undefined;
var l__5:* = undefined;
var l__6:* = undefined;
var l__7:* = undefined;
var l__8:* = undefined;
var l__9:* = undefined;
var l__10:* = undefined;
var l__11:* = undefined;
var l__1:Number = N;
var l__2:Number = 0;
if (mti >= l__1){
if (mti == (l__1 + 1)){
init_genrand(5489);
};
l__3 = M;
l__4 = UPPER_MASK;
l__5 = LOWER_MASK;
l__6 = mag01;
l__7 = getTimer();
l__8 = 0;
l__9 = (l__1 - l__3);
l__10 = (l__3 - l__1);
l__8 = 0;
while (l__8 < l__9) {
l__2 = ((mta[l__8] & l__4) | (mta[(l__8 + 1)] & l__5));
mta[l__8] = ((mta[(l__8 + l__3)] ^ (l__2 >>> 1)) ^ l__6[(l__2 & 1)]);
l__8 = (l__8 + 1);
};
l__9 = (l__1 - 1);
while (l__8 < l__9) {
l__2 = ((mta[l__8] & l__4) | (mta[(l__8 + 1)] & l__5));
mta[l__8] = ((mta[(l__8 + l__10)] ^ (l__2 >>> 1)) ^ l__6[(l__2 & 1)]);
l__8 = (l__8 + 1);
};
l__2 = ((mta[(l__1 - 1)] & l__4) | (mta[0] & l__5));
mta[(l__1 - 1)] = ((mta[(l__3 - 1)] ^ (l__2 >>> 1)) ^ l__6[(l__2 & 1)]);
mti = 0;
l__11 = getTimer();
};
l__2 = mta[mti++];
l__2 = (l__2 ^ (l__2 >>> 11));
l__2 = (l__2 ^ ((l__2 << 7) & 2636928640));
l__2 = (l__2 ^ ((l__2 << 15) & 4022730752));
l__2 = (l__2 ^ (l__2 >>> 18));
return (l__2);
}
}
}//package util
Section 41
//ReLoader (util.ReLoader)
package util {
import flash.events.*;
import flash.display.*;
import amazingadventures.client.*;
import flash.utils.*;
import flash.net.*;
public class ReLoader {
public var loader:Loader;// = null
public var maxErrorCount:int;// = 3
public var path:String;// = null
public var urlRequest:URLRequest;// = null
public var listener:Object;// = null
private var errorCount:int;// = 0
public function ReLoader(p__1:Object, p__2:String){
super();
listener = p__1;
path = p__2;
urlRequest = new URLRequest(p__2);
}
public function load():void{
doLoad();
}
private function doLoad(p__1:Event=null):void{
loader = new Loader();
loader.load(urlRequest);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
}
private function completeHandler(p__1:Event):void{
stopListening();
listener.loadSuccess(this);
}
private function errorHandler(p__1:Event):void{
var l__2:Timer;
stopListening();
errorCount++;
if (errorCount < maxErrorCount){
l__2 = new Timer(100, 1);
l__2.start();
l__2.addEventListener(TimerEvent.TIMER_COMPLETE, doLoad);
} else {
listener.loadFail(this);
};
}
private function stopListening():void{
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler);
loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler);
}
}
}//package util
Section 42
//Renderable (util.Renderable)
package util {
public interface Renderable {
function render(_arg1:int, _arg2:Number):int;
}
}//package util
Section 43
//Renderer (util.Renderer)
package util {
import flash.display.*;
public class Renderer {
private var objectsToRender:Array;
public static const CONTINUE:int = 0;
public static const STOP:int = 1;
public static const STOP_HIDE:int = 2;
public static const STOP_REMOVE:int = 3;
public function Renderer(){
super();
objectsToRender = new Array();
}
public function start(p__1:Renderable):void{
var l__2:int = objectsToRender.indexOf(p__1, 0);
if (l__2 == -1){
objectsToRender.push(p__1);
};
}
public function stop(p__1:Renderable):void{
var l__2:int = objectsToRender.indexOf(p__1, 0);
if (l__2 != -1){
objectsToRender.splice(l__2, 1);
};
}
public function reset():void{
objectsToRender = new Array();
}
public function update(p__1:int, p__2:Number):void{
var l__4:Renderable;
var l__5:int;
var l__3:int = (objectsToRender.length - 1);
while (l__3 >= 0) {
l__4 = Renderable(objectsToRender[l__3]);
l__5 = l__4.render(p__1, p__2);
if (l__5 != Renderer.CONTINUE){
stop(l__4);
if (l__5 == Renderer.STOP_HIDE){
DisplayObject(l__4).visible = false;
} else {
if (l__5 == Renderer.STOP_REMOVE){
DisplayObject(l__4).parent.removeChild(DisplayObject(l__4));
};
};
};
l__3--;
};
}
}
}//package util
Section 44
//ResizePoint (util.ResizePoint)
package util {
public class ResizePoint {
public var tick:int;
public var scaleX:Number;
public var scaleY:Number;
public function ResizePoint(p__1:int, p__2:Number, p__3:Number){
super();
tick = p__1;
scaleX = p__2;
scaleY = p__3;
}
}
}//package util
Section 45
//RetryLoader (util.RetryLoader)
package util {
import flash.events.*;
import amazingadventures.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class RetryLoader {
public var verbose:Boolean;// = false
public var maxFails:int;// = 10
public var loader:Loader;
public var progress:int;
public var lastHttpStatus:int;
public var lastError:String;
public var failed:Boolean;
private var failCount:int;
private var url:String;
private var retryTimer:Timer;
public function RetryLoader(p__1:String){
super();
progress = 0;
failed = false;
failCount = 0;
lastError = "";
url = p__1;
}
public function load():void{
if (verbose){
trace(("Loading " + url));
};
var l__1:LoaderContext = new LoaderContext();
l__1.checkPolicyFile = true;
l__1.applicationDomain = ApplicationDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatus);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressEvent);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
loader.load(new URLRequest(url), l__1);
}
private function fail(p__1:String):void{
if (loader == null){
return;
};
loader = null;
failCount++;
if (verbose){
trace(((("fail #" + failCount) + ": ") + p__1));
};
if (failCount >= maxFails){
failed = true;
} else {
lastError = p__1;
retryTimer = new Timer(1500, 1);
retryTimer.addEventListener(TimerEvent.TIMER_COMPLETE, retry);
retryTimer.start();
};
}
public function ioError(p__1:IOErrorEvent):void{
fail(p__1.text);
}
public function retry(p__1:TimerEvent):void{
if (verbose){
trace(("retry: " + p__1));
};
retryTimer = null;
load();
}
public function complete(p__1:Event):void{
if (int((lastHttpStatus / 100)) != 2){
fail(("Bad server reply: " + lastHttpStatus));
return;
};
lastError = ("Loaded: " + loader.contentLoaderInfo.bytesTotal);
if (verbose){
trace(("complete: " + p__1));
};
progress = 100;
}
public function httpStatus(p__1:HTTPStatusEvent):void{
lastHttpStatus = p__1.status;
if (p__1.status == 0){
lastHttpStatus = 200;
};
}
public function progressEvent(p__1:ProgressEvent):void{
progress = ((p__1.bytesLoaded * 100) / p__1.bytesTotal);
if (progress > 99){
progress = 99;
};
}
}
}//package util
Section 46
//SoundFader (util.SoundFader)
package util {
import flash.events.*;
import flash.media.*;
import amazingadventures.*;
import flash.utils.*;
public class SoundFader {
public var soundChannel:SoundChannel;
private var millisec:int;
private var listener:Object;
private var timer:Timer;
private var fadeStep:Number;// = 0.03
private var miniStep:Number;// = 0.01
private var nrOfSteps:int;
private var extraRepeats:int;// = 5
private var panning:Number;
public function SoundFader(p__1:SoundChannel, p__2:int, p__3:Object=null){
super();
soundChannel = p__1;
millisec = p__2;
listener = p__3;
var l__4:Number = p__1.soundTransform.volume;
nrOfSteps = (l__4 / fadeStep);
panning = p__1.soundTransform.pan;
var l__5:int = (p__2 / nrOfSteps);
timer = new Timer(l__5, (nrOfSteps + extraRepeats));
timer.addEventListener("timer", fade);
timer.addEventListener("timerComplete", destroy);
timer.start();
}
public function fade(p__1:TimerEvent):void{
var l__2:Number = soundChannel.soundTransform.volume;
if (l__2 > fadeStep){
l__2 = (l__2 - fadeStep);
} else {
l__2 = (l__2 - miniStep);
};
if (l__2 < 0){
l__2 = 0;
};
soundChannel.soundTransform = new SoundTransform(l__2, panning);
}
public function destroy(p__1:TimerEvent):void{
soundChannel.stop();
if (listener != null){
listener.soundFaderCompleted(this);
};
}
}
}//package util
Section 47
//Stack (util.Stack)
package util {
import flash.media.*;
public class Stack {
protected var array:Array;
public function Stack(){
super();
array = new Array();
}
public function g(p__1:int){
if ((((p__1 < 0)) || ((p__1 >= array.length)))){
throw (new Error(((("index " + p__1) + " out of range ") + array.length)));
};
return (array[p__1]);
}
public function s(p__1:int, p__2){
var l__3:* = undefined;
if ((((p__1 < 0)) || ((p__1 >= array.length)))){
throw (new Error(((("index " + p__1) + " out of range ") + array.length)));
};
l__3 = array[p__1];
array[p__1] = p__2;
return (l__3);
}
public function push(p__1){
array.push(p__1);
return (p__1);
}
public function pop(){
return (array.pop());
}
public function indexOf(p__1, p__2:int=0):int{
return (array.indexOf(p__1, p__2));
}
public function lastIndexOf(p__1, p__2:int=2147483647):int{
return (array.lastIndexOf(p__1, p__2));
}
public function add(p__1:int, p__2):void{
if ((((p__1 < 0)) || ((p__1 > array.length)))){
throw (new Error(((("index " + p__1) + " out of range ") + array.length)));
};
array.splice(p__1, 0, p__2);
}
public function remove(p__1:int){
if ((((p__1 < 0)) || ((p__1 >= array.length)))){
throw (new Error(((("index " + p__1) + " out of range ") + (array.length - 1))));
};
return (array.splice(p__1, 1)[0]);
}
public function size():int{
return (array.length);
}
public function toString():String{
return (array.toString());
}
public function getArrayCopy():Array{
var l__2:int;
var l__1:Array = new Array();
while (l__2 < size()) {
l__1[l__2] = g(l__2);
l__2++;
};
return (l__1);
}
public function sort(p__1:Function):void{
array.sort(p__1);
}
}
}//package util
Section 48
//TimeDisplay (util.TimeDisplay)
package util {
import flash.events.*;
import flash.text.*;
public class TimeDisplay {
protected var digitTextFields:Array;
protected var countDownSeconds:int;// = -1
protected var ticksPerSecond:int;
public function TimeDisplay(p__1:Array, p__2:int){
super();
digitTextFields = p__1;
ticksPerSecond = p__2;
}
public function update(p__1:int):void{
var l__3:int;
var l__4:int;
var l__2:int = (p__1 / ticksPerSecond);
if (l__2 != countDownSeconds){
countDownSeconds = l__2;
l__3 = (l__2 / 60);
l__2 = (l__2 % 60);
l__4 = (l__2 % 10);
TextField(digitTextFields[0]).text = ("" + l__4);
l__4 = (l__2 / 10);
TextField(digitTextFields[1]).text = ("" + l__4);
if (digitTextFields.length > 2){
l__4 = (l__3 % 10);
TextField(digitTextFields[2]).text = ("" + l__4);
};
if (digitTextFields.length > 3){
l__4 = (l__3 / 10);
TextField(digitTextFields[3]).text = ("" + l__4);
};
};
}
}
}//package util
Section 49
//ButtonClickSnd (ButtonClickSnd)
package {
import flash.media.*;
public dynamic class ButtonClickSnd extends Sound {
}
}//package
Section 50
//ExitBtn (ExitBtn)
package {
import flash.display.*;
public dynamic class ExitBtn extends MovieClip {
}
}//package
Section 51
//FoundSnd (FoundSnd)
package {
import flash.media.*;
public dynamic class FoundSnd extends Sound {
}
}//package
Section 52
//HintBtn (HintBtn)
package {
import flash.display.*;
public dynamic class HintBtn extends MovieClip {
}
}//package
Section 53
//HintScoreSnd (HintScoreSnd)
package {
import flash.media.*;
public dynamic class HintScoreSnd extends Sound {
}
}//package
Section 54
//HintSnd (HintSnd)
package {
import flash.media.*;
public dynamic class HintSnd extends Sound {
}
}//package
Section 55
//IntroSnd (IntroSnd)
package {
import flash.media.*;
public dynamic class IntroSnd extends Sound {
}
}//package
Section 56
//LevelClearSnd (LevelClearSnd)
package {
import flash.media.*;
public dynamic class LevelClearSnd extends Sound {
}
}//package
Section 57
//LoopSnd (LoopSnd)
package {
import flash.media.*;
public dynamic class LoopSnd extends Sound {
}
}//package
Section 58
//MiddleBorder (MiddleBorder)
package {
import flash.display.*;
public dynamic class MiddleBorder extends MovieClip {
}
}//package
Section 59
//MultiFileBlock1_1354280246 (MultiFileBlock1_1354280246)
package {
import amazingadventures.*;
import util.*;
import flash.display.*;
import amazingadventures.client.*;
public class MultiFileBlock1_1354280246 extends MovieClip {
public function MultiFileBlock1_1354280246(){
var Dummy1:GameTimer;
var Dummy2:Communicator;
var Dummy3:Game;
var Dummy4:Renderer;
var Dummy5:SoundManager;
var Dummy6:TimeDisplay;
var Dummy7:ButtonHandler;
var Dummy8:Movement;
var Dummy9:Fader;
var Dummy10:FramePlayer;
var Dummy11:Obj;
var Dummy12:PlaceGame;
var Dummy13:SpotGame;
var Dummy14:Stack;
var Dummy15:Random;
var Dummy16:SpyGame;
var Dummy17:ObjC;
var Dummy18:PlaceGameC;
var Dummy19:SpotGameC;
var Dummy20:RetryLoader;
var Dummy21:ReLoader;
var Dummy22:SoundFader;
var Dummy23:SpyGameC;
var Dummy24:ChainResize;
var Dummy25:Numbers;
var Dummy26:ResizePoint;
var Dummy27:ScoreAnimation;
var Dummy28:SlideBarAnimation;
var Dummy29:PlaceFailAnimation;
var Dummy30:SpotFoundAnimation;
var Dummy31:Main;
var Dummy32:Clock;
var Dummy33:MiddleGameDialog;
var Dummy34:ScorePop;
var Dummy35:GameC;
var Dummy36:Image;
var Dummy37:GraphicsHalf;
var Dummy38:FoundAnimation;
var Dummy39:ButtonAnimation;
var Dummy40:FailAnimation;
var Dummy41:HintAnimation;
var Dummy42:Intro;
var Dummy43:Outro;
var Dummy44:SuccessAnimation;
var Dummy45:Target;
super();
}
}
}//package
Section 60
//MusicBtn (MusicBtn)
package {
import flash.display.*;
public dynamic class MusicBtn extends MovieClip {
}
}//package
Section 61
//NewBar (NewBar)
package {
import flash.display.*;
import amazingadventures.client.*;
public dynamic class NewBar extends MovieClip {
public var itemsLeftBox:MovieClip;
public var hintBtn:HintBtn;
public var soundBtn:SoundBtn;
public var clock:Clock;
public var musicBtn:MusicBtn;
public var scoreMc:MovieClip;
public var hintMc:MovieClip;
public var newSlideBar:NewSlideBar;
public var exitBtn:ExitBtn;
}
}//package
Section 62
//NewSlideBar (NewSlideBar)
package {
import flash.display.*;
import flash.text.*;
public dynamic class NewSlideBar extends MovieClip {
public var levelNameTf:TextField;
public var moveLong:MovieClip;
public var moveShort:MovieClip;
}
}//package
Section 63
//OutroSnd (OutroSnd)
package {
import flash.media.*;
public dynamic class OutroSnd extends Sound {
}
}//package
Section 64
//PenaltySnd (PenaltySnd)
package {
import flash.media.*;
public dynamic class PenaltySnd extends Sound {
}
}//package
Section 65
//ScoreCountSnd (ScoreCountSnd)
package {
import flash.media.*;
public dynamic class ScoreCountSnd extends Sound {
}
}//package
Section 66
//ShadowFlower (ShadowFlower)
package {
import flash.display.*;
public dynamic class ShadowFlower extends MovieClip {
}
}//package
Section 67
//SoundBtn (SoundBtn)
package {
import flash.display.*;
public dynamic class SoundBtn extends MovieClip {
}
}//package
Section 68
//TextItem (TextItem)
package {
import flash.display.*;
import flash.text.*;
public dynamic class TextItem extends MovieClip {
public var line:MovieClip;
public var textField:TextField;
}
}//package
Section 69
//TimeWarningSnd (TimeWarningSnd)
package {
import flash.media.*;
public dynamic class TimeWarningSnd extends Sound {
}
}//package
Section 70
//TotalScoreSnd (TotalScoreSnd)
package {
import flash.media.*;
public dynamic class TotalScoreSnd extends Sound {
}
}//package