Section 1
//KongregateEvent (com.kongregate.as3.client.events.KongregateEvent)
package com.kongregate.as3.client.events {
import flash.events.*;
public class KongregateEvent extends Event {
public static const COMPLETE:String = "component_api_available";
public function KongregateEvent(_arg1:String){
super(_arg1);
}
}
}//package com.kongregate.as3.client.events
Section 2
//AbstractShadowService (com.kongregate.as3.client.services.AbstractShadowService)
package com.kongregate.as3.client.services {
import flash.events.*;
public class AbstractShadowService extends EventDispatcher {
protected function alert(_arg1:String, _arg2:String, _arg3="", _arg4:String=""):void{
trace(((((((("Kongregate API: " + _arg1) + ".") + _arg2) + "(") + _arg3) + ") ") + _arg4));
}
}
}//package com.kongregate.as3.client.services
Section 3
//HighScoreServiceShadow (com.kongregate.as3.client.services.HighScoreServiceShadow)
package com.kongregate.as3.client.services {
public class HighScoreServiceShadow extends AbstractShadowService implements IHighScoreServices {
private var mode:String;
public function HighScoreServiceShadow(){
mode = "";
}
public function submit(_arg1:Number, _arg2:String=null):void{
alert("IHighScoreServices", "submit", arguments);
}
public function connect():Boolean{
alert("IKongregateServices", "connect");
return (true);
}
public function requestList(_arg1:Function):void{
alert("IHighScoreServices", "requestList", "", (("[Mode: " + mode) + "]"));
_arg1({success:false});
}
public function setMode(_arg1:String):void{
alert("IHighScoreServices", "setMode", arguments);
this.mode = _arg1;
}
}
}//package com.kongregate.as3.client.services
Section 4
//IHighScoreServices (com.kongregate.as3.client.services.IHighScoreServices)
package com.kongregate.as3.client.services {
public interface IHighScoreServices {
function setMode(_arg1:String):void;
function submit(_arg1:Number, _arg2:String=null):void;
function requestList(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 5
//IKongregateServices (com.kongregate.as3.client.services.IKongregateServices)
package com.kongregate.as3.client.services {
import flash.events.*;
public interface IKongregateServices extends IEventDispatcher {
function getPlayerInfo(_arg1:Function):void;
function connect(_arg1:Number=-1):Boolean;
}
}//package com.kongregate.as3.client.services
Section 6
//IStatServices (com.kongregate.as3.client.services.IStatServices)
package com.kongregate.as3.client.services {
public interface IStatServices {
function submitArray(_arg1:Array):void;
function submit(_arg1:String, _arg2:Number):void;
}
}//package com.kongregate.as3.client.services
Section 7
//IUserServices (com.kongregate.as3.client.services.IUserServices)
package com.kongregate.as3.client.services {
public interface IUserServices {
function getName():String;
function getPlayerInfo(_arg1:Function):void;
}
}//package com.kongregate.as3.client.services
Section 8
//KongregateServiceShadow (com.kongregate.as3.client.services.KongregateServiceShadow)
package com.kongregate.as3.client.services {
public class KongregateServiceShadow extends AbstractShadowService implements IKongregateServices {
public function getName():String{
alert("IKongregateServices", "getName");
return ("Guest");
}
public function connect(_arg1:Number=-1):Boolean{
alert("IKongregateServices", "connect", arguments);
return (true);
}
public function getPlayerInfo(_arg1:Function):void{
alert("IKongregateServices", "getPlayerInfo");
_arg1(new Object());
}
}
}//package com.kongregate.as3.client.services
Section 9
//StatServiceShadow (com.kongregate.as3.client.services.StatServiceShadow)
package com.kongregate.as3.client.services {
public class StatServiceShadow extends AbstractShadowService implements IStatServices {
public function submitArray(_arg1:Array):void{
alert("IStatServices", "submitArray", arguments);
}
public function submit(_arg1:String, _arg2:Number):void{
alert("IStatServices", "submitStat", arguments);
}
}
}//package com.kongregate.as3.client.services
Section 10
//UserServiceShadow (com.kongregate.as3.client.services.UserServiceShadow)
package com.kongregate.as3.client.services {
public class UserServiceShadow extends AbstractShadowService implements IUserServices {
public function getName():String{
alert("UserService", "getName");
return ("Guest");
}
public function getPlayerInfo(_arg1:Function):void{
alert("UserService", "getPlayerInfo");
_arg1({isGuest:true, name:"Guest", points:0, level:0, isMode:false, isAdmin:false, isDeveloper:false, avatarPath:"", chatAvatarPath:""});
}
}
}//package com.kongregate.as3.client.services
Section 11
//IAPIBootstrap (com.kongregate.as3.client.IAPIBootstrap)
package com.kongregate.as3.client {
import flash.events.*;
import flash.display.*;
public interface IAPIBootstrap {
function init(_arg1:Event=null, _arg2:Stage=null):void;
function hideLog():void;
function showLog(_arg1:int=0):void;
}
}//package com.kongregate.as3.client
Section 12
//KongregateAPI (com.kongregate.as3.client.KongregateAPI)
package com.kongregate.as3.client {
import flash.events.*;
import com.kongregate.as3.client.services.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import com.kongregate.as3.client.events.*;
import flash.errors.*;
import flash.net.*;
public class KongregateAPI extends Sprite {
private const VERSION:Number = 1;
private var loader:Loader;
private var loadedDomain:ApplicationDomain;
private static const CLASS_USER:String = "com.kongregate.as3.client.services.UserServices";
private static const CLASS_STATS:String = "com.kongregate.as3.client.services.StatServices";
private static const CLASS_SERVICES:String = "com.kongregate.as3.client.services.KongregateServices";
private static const CLASS_SCORES:String = "com.kongregate.as3.client.services.HighScoreServices";
private static const DEBUG_API_URL:String = "//Linuxpc/kongregate/public/flash/API_AS3.swf";
private static var _connected:Boolean;
private static var kUser:IUserServices;
private static var _loaded:Boolean;
private static var kServices:IKongregateServices;
private static var kScores:IHighScoreServices;
private static var mInstance:KongregateAPI;
private static var kStats:IStatServices;
private static var kAPI:IAPIBootstrap;
public function KongregateAPI(){
if (mInstance != null){
throw (new Error("Warning: KongregateAPI has been added to stage more than once or accessed improperly. Use getInstance() or a stage reference to access."));
};
mInstance = this;
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
public function get loaded():Boolean{
return (_loaded);
}
public function get connected():Boolean{
return (_connected);
}
private function alertConnected(_arg1:TimerEvent=null):void{
var _local2:KongregateEvent;
var _local3:Boolean;
_local2 = new KongregateEvent(KongregateEvent.COMPLETE);
_local3 = this.dispatchEvent(_local2);
}
private function init(_arg1:Event):void{
var _local2:Object;
var _local3:String;
var _local4:URLRequest;
var _local5:LoaderContext;
this.removeEventListener(Event.ADDED_TO_STAGE, init);
_loaded = false;
_connected = false;
_local2 = LoaderInfo(root.loaderInfo).parameters;
_local3 = _local2.api_path;
if (_local3 == null){
trace("Alert: Kongregate API could not be loaded, due to local testing. API will load when the game is uploaded.");
createShadowServices();
return;
};
Security.allowDomain("*.kongregate.com");
Security.allowDomain("kongregatetrunk.com");
_local4 = new URLRequest(_local3);
_local5 = new LoaderContext(false);
_local5.applicationDomain = ApplicationDomain.currentDomain;
_local5.securityDomain = SecurityDomain.currentDomain;
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.load(_local4, _local5);
}
public function get api():IAPIBootstrap{
return (kAPI);
}
private function loadComplete(_arg1:Event):void{
getServices();
}
public function get scores():IHighScoreServices{
return (kScores);
}
private function ioErrorHandler(_arg1:IOErrorEvent):void{
throw (new IOError(("API file not found. " + _arg1)));
}
public function get services():IKongregateServices{
return (kServices);
}
public function get stats():IStatServices{
return (kStats);
}
private function createShadowServices():void{
var _local1:Timer;
trace(">>> Kongregate Shadow Services instantiated for local development..");
kServices = new KongregateServiceShadow();
kScores = new HighScoreServiceShadow();
kStats = new StatServiceShadow();
kUser = new UserServiceShadow();
_local1 = new Timer(200, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, alertConnected);
_local1.start();
_connected = true;
}
public function get user():IUserServices{
return (kUser);
}
private function getServices():void{
var _local1:ApplicationDomain;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
_local1 = ApplicationDomain.currentDomain;
kAPI = IAPIBootstrap(loader.getChildAt(0));
this.addChild(loader);
_local2 = _local1.getDefinition(CLASS_SERVICES);
trace(_local2);
kServices = _local2.getInstance();
_local3 = _local1.getDefinition(CLASS_SCORES);
kScores = _local3.getInstance();
_local4 = _local1.getDefinition(CLASS_STATS);
kStats = _local4.getInstance();
_local5 = _local1.getDefinition(CLASS_USER);
kUser = _local5.getInstance();
kServices.connect(VERSION);
_loaded = true;
_connected = true;
alertConnected();
}
public static function getInstance():KongregateAPI{
if (!mInstance){
throw (new IllegalOperationError("You must add the Kongregate API component to the stage before attempting to access it."));
};
return (mInstance);
}
}
}//package com.kongregate.as3.client
Section 13
//Inventory (Data.Inventory)
package Data {
import Interface.*;
import flash.display.*;
public class Inventory extends Sprite {
private var items:Array;
private var activeItem:int;// = -1
public function Inventory(){
items = new Array();
}
private function realign():void{
var _local1:int;
while (_local1 < items.length) {
items[_local1].x = (_local1 * 48);
_local1++;
};
}
public function addItem(_arg1:InventoryIcon):void{
items.push(_arg1);
realign();
this.addChild(_arg1);
trace(("added " + _arg1));
}
public function activate(_arg1:InventoryIcon):void{
activeItem = items.indexOf(_arg1);
var _local2:int;
while (_local2 < items.length) {
if (items[_local2] == _arg1){
items[_local2].isActive = true;
} else {
items[_local2].isActive = false;
};
_local2++;
};
}
public function deactivate():void{
items[activeItem].isActive = false;
activeItem = -1;
}
public function removeActiveItem():void{
Cursor.deactivateInventory();
this.removeChild(items[activeItem]);
items.splice(activeItem, 1);
activeItem = -1;
realign();
}
}
}//package Data
Section 14
//NavNode (Data.NavNode)
package Data {
import flash.display.*;
public class NavNode extends Node {
public var bmSouth:Bitmap;
public var hotspotsWest:Array;
public var nodeWest:int;
public var bmWest:Bitmap;
public var nodeEast:int;
public var hotspotsEast:Array;
public var nodeNorth:int;
public var bmEast:Bitmap;
public var hotspotsSouth:Array;
public var nodeSouth:int;
public var hotspotsNorth:Array;
public var bmNorth:Bitmap;
public function NavNode(_arg1:Class, _arg2:Class, _arg3:Class, _arg4:Class, _arg5:int, _arg6:int, _arg7:int, _arg8:int){
hotspotsNorth = new Array();
hotspotsSouth = new Array();
hotspotsEast = new Array();
hotspotsWest = new Array();
super();
bmNorth = new (_arg1);
bmSouth = new (_arg2);
bmEast = new (_arg3);
bmWest = new (_arg4);
nodeNorth = _arg5;
nodeSouth = _arg6;
nodeEast = _arg7;
nodeWest = _arg8;
}
public function nodeTo(_arg1:int):int{
switch (_arg1){
case Main.NORTH:
return (nodeNorth);
case Main.SOUTH:
return (nodeSouth);
case Main.EAST:
return (nodeEast);
case Main.WEST:
return (nodeWest);
default:
return (-1);
};
}
public function bmTo(_arg1:int):Bitmap{
switch (_arg1){
case Main.NORTH:
return (bmNorth);
case Main.SOUTH:
return (bmSouth);
case Main.EAST:
return (bmEast);
case Main.WEST:
return (bmWest);
default:
return (null);
};
}
public function hotspotsTo(_arg1:int):Array{
switch (_arg1){
case Main.NORTH:
return (hotspotsNorth);
case Main.SOUTH:
return (hotspotsSouth);
case Main.EAST:
return (hotspotsEast);
case Main.WEST:
return (hotspotsWest);
default:
return (null);
};
}
}
}//package Data
Section 15
//Node (Data.Node)
package Data {
public class Node {
}
}//package Data
Section 16
//NodeFactory (Data.NodeFactory)
package Data {
import flash.events.*;
import Interface.*;
import flash.media.*;
public class NodeFactory {
public static const totalBarcodes:int = 30;
private static const sndMail:Sound = (new clsMail() as Sound);
private static const sndWallBreak:Sound = (new clsWallBreak() as Sound);
private static var clsMail:Class = NodeFactory_clsMail;
private static var sprHouseKey:Class = NodeFactory_sprHouseKey;
private static var bgNode6S:Class = NodeFactory_bgNode6S;
private static var sprSmallPanelCover:Class = NodeFactory_sprSmallPanelCover;
private static var bgNode12S:Class = NodeFactory_bgNode12S;
private static var bgNode11S:Class = NodeFactory_bgNode11S;
private static var bgNode6W:Class = NodeFactory_bgNode6W;
private static var bgNode7E:Class = NodeFactory_bgNode7E;
private static var sprLampshadeTurned:Class = NodeFactory_sprLampshadeTurned;
private static var bgNode7N:Class = NodeFactory_bgNode7N;
private static var bgNode7S:Class = NodeFactory_bgNode7S;
private static var bgNode10W:Class = NodeFactory_bgNode10W;
private static var bgNode7W:Class = NodeFactory_bgNode7W;
private static var bgNode12N:Class = NodeFactory_bgNode12N;
private static var bgNode13E:Class = NodeFactory_bgNode13E;
private static var bgNode13N:Class = NodeFactory_bgNode13N;
private static var bgNode13W:Class = NodeFactory_bgNode13W;
private static var bgNode12W:Class = NodeFactory_bgNode12W;
private static var sprBatteries:Class = NodeFactory_sprBatteries;
private static var bgNode13S:Class = NodeFactory_bgNode13S;
private static var bgNode14E:Class = NodeFactory_bgNode14E;
private static var bgNode0E:Class = NodeFactory_bgNode0E;
private static var sprBigPanelCoverKeyhole:Class = NodeFactory_sprBigPanelCoverKeyhole;
private static var bgNode0N:Class = NodeFactory_bgNode0N;
private static var bgNode14S:Class = NodeFactory_bgNode14S;
private static var bgNode0S:Class = NodeFactory_bgNode0S;
private static var clsWallBreak:Class = NodeFactory_clsWallBreak;
private static var sprEnvelopeTiny:Class = NodeFactory_sprEnvelopeTiny;
private static var bgNode14W:Class = NodeFactory_bgNode14W;
private static var bgNode0W:Class = NodeFactory_bgNode0W;
private static var bgNode19:Class = NodeFactory_bgNode19;
private static var bgNode9E:Class = NodeFactory_bgNode9E;
private static var bgNode1E:Class = NodeFactory_bgNode1E;
private static var bgNode9N:Class = NodeFactory_bgNode9N;
public static var INVENTORY:Inventory = new Inventory();
private static var sprWallBarcode:Class = NodeFactory_sprWallBarcode;
private static var sprEnvelopeSmall:Class = NodeFactory_sprEnvelopeSmall;
private static var bgNode1N:Class = NodeFactory_bgNode1N;
private static var bgNode9W:Class = NodeFactory_bgNode9W;
private static var bgNode9S:Class = NodeFactory_bgNode9S;
private static var bgNode1S:Class = NodeFactory_bgNode1S;
private static var bgNode1W:Class = NodeFactory_bgNode1W;
private static var bgNode16:Class = NodeFactory_bgNode16;
private static var bgNode17:Class = NodeFactory_bgNode17;
private static var bgNode14N:Class = NodeFactory_bgNode14N;
private static var bgNode2E:Class = NodeFactory_bgNode2E;
private static var bgNode18:Class = NodeFactory_bgNode18;
private static var sprWallHole:Class = NodeFactory_sprWallHole;
private static var bgNode2N:Class = NodeFactory_bgNode2N;
private static var sprBigPanelCover:Class = NodeFactory_sprBigPanelCover;
private static var bgNode2S:Class = NodeFactory_bgNode2S;
private static var bgNode2W:Class = NodeFactory_bgNode2W;
private static var bgNode3E:Class = NodeFactory_bgNode3E;
public static var NODES:Array = getNodes();
private static var bgNode3N:Class = NodeFactory_bgNode3N;
private static var sprEnvelope:Class = NodeFactory_sprEnvelope;
private static var bgNode3S:Class = NodeFactory_bgNode3S;
private static var bgNode3W:Class = NodeFactory_bgNode3W;
private static var sprCube:Class = NodeFactory_sprCube;
private static var sprBaseballBat:Class = NodeFactory_sprBaseballBat;
private static var bgNode4E:Class = NodeFactory_bgNode4E;
private static var bgNode4N:Class = NodeFactory_bgNode4N;
private static var sprBattCover:Class = NodeFactory_sprBattCover;
private static var bgNode4S:Class = NodeFactory_bgNode4S;
private static var bgNode4W:Class = NodeFactory_bgNode4W;
private static var bgNode10S:Class = NodeFactory_bgNode10S;
private static var sprSmallBarcode:Class = NodeFactory_sprSmallBarcode;
private static var bgNode10N:Class = NodeFactory_bgNode10N;
private static var sprElectricKnife:Class = NodeFactory_sprElectricKnife;
private static var sprOldKey:Class = NodeFactory_sprOldKey;
private static var bgNode5E:Class = NodeFactory_bgNode5E;
private static var sprScanner:Class = NodeFactory_sprScanner;
private static var bgNode11E:Class = NodeFactory_bgNode11E;
private static var bgNode5N:Class = NodeFactory_bgNode5N;
private static var bgNode10E:Class = NodeFactory_bgNode10E;
private static var bgNode5S:Class = NodeFactory_bgNode5S;
private static var bgNode11N:Class = NodeFactory_bgNode11N;
private static var bgNode5W:Class = NodeFactory_bgNode5W;
private static var sprSmallCube:Class = NodeFactory_sprSmallCube;
private static var bgNode11W:Class = NodeFactory_bgNode11W;
private static var sprLampshadeUnturned:Class = NodeFactory_sprLampshadeUnturned;
private static var bgNode6E:Class = NodeFactory_bgNode6E;
private static var sprPillBottle:Class = NodeFactory_sprPillBottle;
private static var bgNode12E:Class = NodeFactory_bgNode12E;
private static var bgNode6N:Class = NodeFactory_bgNode6N;
private static function getNodes():Array{
var smallEnv0:SceneryHotspot;
var smallCoverPlate:GenericHotspot;
var correctsmallcombo:Array;
var smallEnv1:SceneryHotspot;
var envelope:NodeLinkHotspot;
var lampshade:RotationalHotspot;
var lightbarcode:BarcodeHotspot;
var wallhole:NodeLinkHotspot;
var saw:GenericHotspot;
var spider:SpiderHotspot;
var cage:GenericHotspot;
var smallcube:SceneryHotspot;
var bigCoverPlateKeyhole:GenericHotspot;
var bigCoverPlate:GenericHotspot;
var correctbigcombo:Array;
var cube:GenericHotspot;
var batterycover:GenericHotspot;
var ret:Array = new Array();
ret[0] = new NavNode(bgNode0N, bgNode0S, bgNode0E, bgNode0W, -1, -1, 1, -1);
ret[0].hotspotsWest.push(new BarcodeHotspot(225, 334, "THEY ARE FEEDING YOU POISON AND LIES", sprSmallBarcode));
smallEnv0 = new SceneryHotspot(265, 290, sprEnvelopeTiny);
smallEnv0.visible = false;
ret[0].hotspotsEast.push(smallEnv0);
smallCoverPlate = new GenericHotspot(473, 239, sprSmallPanelCover);
ret[0].hotspotsWest.push(smallCoverPlate);
correctsmallcombo = new Array("R", "G", "B", "C", "M", "Y");
var smallResult:Function = function ():void{
if (correctsmallcombo){
smallCoverPlate.visible = false;
ViewScreen.setText("Another game beaten. What was that sound? It came from the door behind me...");
correctsmallcombo = null;
sndMail.play();
smallEnv0.visible = true;
smallEnv1.visible = true;
envelope.visible = true;
};
};
var smallCombo:Array = new Array();
ret[0].hotspotsWest.push(new CombinationHotspot(523, 213, 20, 20, "R", smallCombo, 6, correctsmallcombo, smallResult));
ret[0].hotspotsWest.push(new CombinationHotspot(449, 309, 20, 20, "G", smallCombo, 6, correctsmallcombo, smallResult));
ret[0].hotspotsWest.push(new CombinationHotspot(563, 339, 20, 20, "B", smallCombo, 6, correctsmallcombo, smallResult));
ret[0].hotspotsWest.push(new CombinationHotspot(471, 244, 20, 20, "C", smallCombo, 6, correctsmallcombo, smallResult));
ret[0].hotspotsWest.push(new CombinationHotspot(501, 332, 20, 20, "M", smallCombo, 6, correctsmallcombo, smallResult));
ret[0].hotspotsWest.push(new CombinationHotspot(560, 261, 20, 20, "Y", smallCombo, 6, correctsmallcombo, smallResult));
ret[1] = new NavNode(bgNode1N, bgNode1S, bgNode1E, bgNode1W, -1, 2, 4, 0);
smallEnv1 = new SceneryHotspot(250, 365, sprEnvelopeSmall);
smallEnv1.visible = false;
ret[1].hotspotsEast.push(smallEnv1);
ret[2] = new NavNode(bgNode2N, bgNode2S, bgNode2E, bgNode2W, 1, -1, -1, 3);
ret[2].hotspotsEast.push(new BarcodeHotspot(240, 292, "IT IS ALL A LIE", sprSmallBarcode));
ret[2].hotspotsEast.push(new BarcodeHotspot(315, 298, "YOUR LIFE IS NOT REAL", sprSmallBarcode));
ret[2].hotspotsEast.push(new BarcodeHotspot(190, 180, "YOU KNOW NOTHING", sprSmallBarcode));
ret[2].hotspotsSouth.push(new BarcodeHotspot(147, 258, "SOME PEOPLE ARE MORE FREE THAN OTHERS", null, 275, 150));
var hotplate:GenericHotspot = new GenericHotspot(45, 275, null, 168, 131);
hotplate.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
ViewScreen.setText("I'll leave the hotplate off. I'm not hungry.");
});
ret[2].hotspotsEast.push(hotplate);
ret[3] = new NavNode(bgNode3N, bgNode3S, bgNode3E, bgNode3W, -1, -1, 2, -1);
ret[3].hotspotsWest.push(new BarcodeHotspot(250, 0xFF, "THEY ARE ALWAYS WATCHING YOU", null, 150, 70));
ret[3].hotspotsNorth.push(new BarcodeHotspot(120, 384, "THERE IS NOTHING OUTSIDE THIS PLACE", sprSmallBarcode));
ret[3].hotspotsNorth.push(new BarcodeHotspot(520, 385, "YOU ARE NOT A PERSON YOU ARE A CONTROL SUBJECT", sprSmallBarcode));
var remote:GenericHotspot = new GenericHotspot(300, 300, null, 80, 133);
remote.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
ViewScreen.setText("My TV's broken. I can't remember the last time it was working.");
});
ret[3].hotspotsNorth.push(remote);
ret[4] = new NavNode(bgNode4N, bgNode4S, bgNode4E, bgNode4W, -1, 5, -1, 1);
var baseballbat:PickupHotspot = new PickupHotspot(190, 315, sprBaseballBat, new InventoryIcon(Cursor.bmCurBaseballBat), "I found a baseball bat.");
ret[4].hotspotsNorth.push(baseballbat);
envelope = new NodeLinkHotspot(245, 340, 17, sprEnvelope);
envelope.visible = false;
ret[4].hotspotsEast.push(envelope);
ret[4].hotspotsEast.push(new NodeLinkHotspot(295, 31, 16, null, 25, 25));
var doorknob:GenericHotspot = new GenericHotspot(423, 205, null, 38, 38);
doorknob.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
if (Cursor.activeInventoryCursor == Cursor.bmCurHouseKey){
ViewScreen.currentViewScreen.setNode(12);
} else {
ViewScreen.setText("The door is locked. Weird... I don't remember ever having a key.");
};
});
ret[4].hotspotsEast.push(doorknob);
ret[5] = new NavNode(bgNode5N, bgNode5S, bgNode5E, bgNode5W, 4, -1, -1, -1);
var pillbottle:PickupHotspot = new PickupHotspot(450, 195, sprPillBottle, new InventoryIcon(Cursor.bmCurPillBottle), "I found my pills. I don't remember what they cure.");
ret[5].hotspotsWest.push(pillbottle);
ret[6] = new NavNode(bgNode6N, bgNode6S, bgNode6E, bgNode6W, -1, 1, -1, 7);
ret[6].hotspotsEast.push(new BarcodeHotspot(265, 190, "THEY HAVE ALWAYS BEEN HERE", null, 132, 79));
lampshade = new RotationalHotspot(415, 90, sprLampshadeUnturned, sprLampshadeTurned);
lightbarcode = new BarcodeHotspot(280, 110, "BREAK HERE", sprWallBarcode);
lightbarcode.visible = false;
lampshade.addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
lightbarcode.toggleVisibility((lampshade.currentFrame == 1));
});
ret[1].hotspotsNorth.push(lightbarcode);
wallhole = new NodeLinkHotspot(120, 10, 6, sprWallHole);
wallhole.visible = false;
ret[1].hotspotsNorth.push(wallhole);
ret[1].hotspotsNorth.push(lampshade);
lightbarcode.addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
if (Cursor.activeInventoryCursor == Cursor.bmCurBaseballBat){
wallhole.visible = true;
sndWallBreak.play();
INVENTORY.removeActiveItem();
ViewScreen.setText("The wall crumbled away easily! There must have been a door here once.");
};
});
ret[7] = new NavNode(bgNode7N, bgNode7S, bgNode7E, bgNode7W, 10, 9, 6, -1);
ret[9] = new NavNode(bgNode9N, bgNode9S, bgNode9E, bgNode9W, 7, -1, -1, -1);
ret[9].hotspotsSouth.push(new NodeLinkHotspot(282, 299, 19, null, 109, 87));
ret[10] = new NavNode(bgNode10N, bgNode10S, bgNode10E, bgNode10W, -1, 7, 11, -1);
ret[10].hotspotsWest.push(new BarcodeHotspot(185, 120, "SAVE ALL BARCODES", null, 85, 32));
saw = new GenericHotspot(244, 263, sprElectricKnife);
saw.addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
if (Cursor.activeInventoryCursor == Cursor.bmCurBatteries){
saw.visible = false;
NodeFactory.INVENTORY.addItem(new InventoryIcon(Cursor.bmCurSaw));
INVENTORY.removeActiveItem();
ViewScreen.setText("I put in the batteries and picked up the electric knife.");
} else {
ViewScreen.setText("It's an electric knife or saw, but it needs two D batteries.");
};
});
ret[10].hotspotsNorth.push(saw);
ret[11] = new NavNode(bgNode11N, bgNode11S, bgNode11E, bgNode11W, -1, -1, -1, 10);
spider = new SpiderHotspot(319, 302);
ret[11].hotspotsNorth.push(spider);
ret[11].hotspotsNorth.push(new PickupHotspot(0xFF, 330, sprOldKey, new InventoryIcon(Cursor.bmCurOldKey), "I found an old-looking key."));
cage = new GenericHotspot(222, 271, null, 202, 110);
cage.addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
if (Cursor.activeInventoryCursor == Cursor.bmCurPillBottle){
spider.die();
cage.visible = false;
INVENTORY.removeActiveItem();
ViewScreen.setText("I wonder what was actually in those pills...");
} else {
ViewScreen.setText("I'm not reaching in with that spider crawling around in there.");
};
});
ret[11].hotspotsNorth.push(cage);
smallcube = new SceneryHotspot(322, 241, sprSmallCube);
ret[11].hotspotsEast.push(smallcube);
ret[11].hotspotsEast.push(new NodeLinkHotspot(304, 222, 18, null, 72, 58));
bigCoverPlateKeyhole = new GenericHotspot(303, 221, sprBigPanelCoverKeyhole);
bigCoverPlateKeyhole.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
if (Cursor.activeInventoryCursor == Cursor.bmCurOldKey){
bigCoverPlateKeyhole.visible = false;
INVENTORY.removeActiveItem();
ViewScreen.setText("A panel opened, revealing a small niche.");
};
});
ret[11].hotspotsEast.push(bigCoverPlateKeyhole);
bigCoverPlate = new GenericHotspot(303, 221, sprBigPanelCover);
ret[11].hotspotsEast.push(bigCoverPlate);
correctbigcombo = new Array("R", "G", "B", "C", "M", "Y");
var bigResult:Function = function ():void{
if (correctbigcombo){
bigCoverPlate.visible = false;
ViewScreen.setText("A keyhole appeared in the middle of the wall.");
correctbigcombo = null;
};
};
var bigCombo:Array = new Array();
ret[11].hotspotsEast.push(new CombinationHotspot(323, 63, 34, 34, "R", bigCombo, 6, correctbigcombo, bigResult));
ret[11].hotspotsEast.push(new CombinationHotspot(168, 337, 34, 34, "G", bigCombo, 6, correctbigcombo, bigResult));
ret[11].hotspotsEast.push(new CombinationHotspot(465, 335, 34, 34, "B", bigCombo, 6, correctbigcombo, bigResult));
ret[11].hotspotsEast.push(new CombinationHotspot(213, 180, 34, 34, "C", bigCombo, 6, correctbigcombo, bigResult));
ret[11].hotspotsEast.push(new CombinationHotspot(322, 353, 34, 34, "M", bigCombo, 6, correctbigcombo, bigResult));
ret[11].hotspotsEast.push(new CombinationHotspot(420, 181, 34, 34, "Y", bigCombo, 6, correctbigcombo, bigResult));
ret[11].hotspotsSouth.push(new BarcodeHotspot(235, 178, "THE BRAIN IS THE CENTER OF ALL REBELLION", null, 25, 15));
ret[11].hotspotsSouth.push(new BarcodeHotspot(444, 297, "THEY CANNOT WATCH YOU THINK", null, 52, 17));
ret[12] = new NavNode(bgNode12N, bgNode12S, bgNode12E, bgNode12W, -1, 13, -1, -1);
ret[12].hotspotsWest.push(new NodeLinkHotspot(264, 102, 4, null, 207, 367));
var sealeddoor:GenericHotspot = new GenericHotspot(232, 90, null, 224, 358);
sealeddoor.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
ViewScreen.setText("This door is locked, and the key's broken off in the lock.");
});
ret[12].hotspotsEast.push(sealeddoor);
ret[13] = new NavNode(bgNode13N, bgNode13S, bgNode13E, bgNode13W, 12, 14, -1, -1);
ret[13].hotspotsWest.push(new BarcodeHotspot(144, 358, "IS ANY PERSON TRULY FREE", null, 90, 48));
ret[13].hotspotsWest.push(new BarcodeHotspot(250, 184, "IS ANY PERSON TRULY SANE", null, 72, 45));
ret[13].hotspotsWest.push(new BarcodeHotspot(471, 138, "THIS IS NOT THE WAY THE WORLD IS SUPPOSED TO BE", null, 64, 37));
ret[13].hotspotsWest.push(new BarcodeHotspot(504, 323, "FORGIVE ME", null, 63, 38));
ret[13].hotspotsEast.push(new BarcodeHotspot(126, 127, "YOU CAN'T SEE COLORS ANYMORE", null, 66, 35));
ret[13].hotspotsEast.push(new BarcodeHotspot(107, 277, "WHY DO GOOD THINGS HAPPEN TO BAD PEOPLE", null, 63, 36));
ret[13].hotspotsEast.push(new BarcodeHotspot(272, 188, "THERE ARE OTHER WORLDS THAN THESE", null, 67, 44));
ret[13].hotspotsEast.push(new BarcodeHotspot(253, 400, "YOU SHOULD HAVE STAYED INSIDE", null, 90, 45));
ret[13].hotspotsEast.push(new BarcodeHotspot(443, 298, "I AM A MAN OF WEALTH AND TASTE", null, 64, 41));
ret[14] = new NavNode(bgNode14N, bgNode14S, bgNode14E, bgNode14W, 13, 15, -1, -1);
ret[14].hotspotsWest.push(new BarcodeHotspot(110, 104, "IS THE TRUTH A LIE OR IS THE LIE A TRUTH", null, 85, 75));
ret[14].hotspotsWest.push(new BarcodeHotspot(404, 114, "YOU MUST READ THEM", null, 82, 41));
ret[14].hotspotsWest.push(new BarcodeHotspot(247, 336, "EVERYTHING I TELL YOU IS A LIE", null, 96, 59));
ret[14].hotspotsWest.push(new BarcodeHotspot(472, 292, "EVEN IDEAS CAN BE KILLED", null, 83, 52));
ret[14].hotspotsEast.push(new BarcodeHotspot(117, 200, "A BARCODE IS A SERIES OF BLACK AND WHITE BARS", null, 85, 75));
ret[14].hotspotsEast.push(new BarcodeHotspot(436, 93, "USED TO REPRESENT DATA IN AN OPTICAL FORM", null, 122, 36));
ret[14].hotspotsEast.push(new BarcodeHotspot(388, 328, "THAT CAN BE READ VIA A LASER OR OTHER SCANNER", null, 85, 44));
ret[16] = new ZoomNode(bgNode16, 4);
ret[17] = new ZoomNode(bgNode17, 4);
var scanner:PickupHotspot = new PickupHotspot(85, 275, sprScanner, new InventoryIcon(Cursor.bmCurScanner), "I found some sort of barcode reader.");
ret[17].hotspots.push(scanner);
ret[18] = new ZoomNode(bgNode18, 11);
ret[18].hotspots.push(new PickupHotspot(294, 379, sprHouseKey, new InventoryIcon(Cursor.bmCurHouseKey), "It looks like an apartment key. How did this get here?"));
cube = new GenericHotspot(170, 164, sprCube);
cube.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
if (Cursor.activeInventoryCursor == Cursor.bmCurSaw){
smallcube.visible = false;
cube.visible = false;
INVENTORY.removeActiveItem();
ViewScreen.setText("The electric knife cut through the cube and it fell apart, revealing a key.");
} else {
ViewScreen.setText("It's a cube made of clear, soft plastic, and there's something inside.");
};
});
ret[18].hotspots.push(cube);
ret[19] = new ZoomNode(bgNode19, 9);
var batteries:PickupHotspot = new PickupHotspot(357, 258, sprBatteries, new InventoryIcon(Cursor.bmCurBatteries), "I found some D batteries. The recorded sound turned off.");
ret[19].hotspots.push(batteries);
batteries.addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
Ambiance.stopAmbiance();
});
batterycover = new GenericHotspot(345, 250, sprBattCover);
ret[19].hotspots.push(batterycover);
batterycover.addEventListener(MouseEvent.CLICK, function (_arg1:Event):void{
batterycover.visible = false;
});
return (ret);
}
public static function reset():void{
NODES = getNodes();
INVENTORY = new Inventory();
}
}
}//package Data
Section 17
//NodeFactory_bgNode0E (Data.NodeFactory_bgNode0E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode0E extends BitmapAsset {
}
}//package Data
Section 18
//NodeFactory_bgNode0N (Data.NodeFactory_bgNode0N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode0N extends BitmapAsset {
}
}//package Data
Section 19
//NodeFactory_bgNode0S (Data.NodeFactory_bgNode0S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode0S extends BitmapAsset {
}
}//package Data
Section 20
//NodeFactory_bgNode0W (Data.NodeFactory_bgNode0W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode0W extends BitmapAsset {
}
}//package Data
Section 21
//NodeFactory_bgNode10E (Data.NodeFactory_bgNode10E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode10E extends BitmapAsset {
}
}//package Data
Section 22
//NodeFactory_bgNode10N (Data.NodeFactory_bgNode10N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode10N extends BitmapAsset {
}
}//package Data
Section 23
//NodeFactory_bgNode10S (Data.NodeFactory_bgNode10S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode10S extends BitmapAsset {
}
}//package Data
Section 24
//NodeFactory_bgNode10W (Data.NodeFactory_bgNode10W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode10W extends BitmapAsset {
}
}//package Data
Section 25
//NodeFactory_bgNode11E (Data.NodeFactory_bgNode11E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode11E extends BitmapAsset {
}
}//package Data
Section 26
//NodeFactory_bgNode11N (Data.NodeFactory_bgNode11N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode11N extends BitmapAsset {
}
}//package Data
Section 27
//NodeFactory_bgNode11S (Data.NodeFactory_bgNode11S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode11S extends BitmapAsset {
}
}//package Data
Section 28
//NodeFactory_bgNode11W (Data.NodeFactory_bgNode11W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode11W extends BitmapAsset {
}
}//package Data
Section 29
//NodeFactory_bgNode12E (Data.NodeFactory_bgNode12E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode12E extends BitmapAsset {
}
}//package Data
Section 30
//NodeFactory_bgNode12N (Data.NodeFactory_bgNode12N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode12N extends BitmapAsset {
}
}//package Data
Section 31
//NodeFactory_bgNode12S (Data.NodeFactory_bgNode12S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode12S extends BitmapAsset {
}
}//package Data
Section 32
//NodeFactory_bgNode12W (Data.NodeFactory_bgNode12W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode12W extends BitmapAsset {
}
}//package Data
Section 33
//NodeFactory_bgNode13E (Data.NodeFactory_bgNode13E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode13E extends BitmapAsset {
}
}//package Data
Section 34
//NodeFactory_bgNode13N (Data.NodeFactory_bgNode13N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode13N extends BitmapAsset {
}
}//package Data
Section 35
//NodeFactory_bgNode13S (Data.NodeFactory_bgNode13S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode13S extends BitmapAsset {
}
}//package Data
Section 36
//NodeFactory_bgNode13W (Data.NodeFactory_bgNode13W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode13W extends BitmapAsset {
}
}//package Data
Section 37
//NodeFactory_bgNode14E (Data.NodeFactory_bgNode14E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode14E extends BitmapAsset {
}
}//package Data
Section 38
//NodeFactory_bgNode14N (Data.NodeFactory_bgNode14N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode14N extends BitmapAsset {
}
}//package Data
Section 39
//NodeFactory_bgNode14S (Data.NodeFactory_bgNode14S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode14S extends BitmapAsset {
}
}//package Data
Section 40
//NodeFactory_bgNode14W (Data.NodeFactory_bgNode14W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode14W extends BitmapAsset {
}
}//package Data
Section 41
//NodeFactory_bgNode16 (Data.NodeFactory_bgNode16)
package Data {
import mx.core.*;
public class NodeFactory_bgNode16 extends BitmapAsset {
}
}//package Data
Section 42
//NodeFactory_bgNode17 (Data.NodeFactory_bgNode17)
package Data {
import mx.core.*;
public class NodeFactory_bgNode17 extends BitmapAsset {
}
}//package Data
Section 43
//NodeFactory_bgNode18 (Data.NodeFactory_bgNode18)
package Data {
import mx.core.*;
public class NodeFactory_bgNode18 extends BitmapAsset {
}
}//package Data
Section 44
//NodeFactory_bgNode19 (Data.NodeFactory_bgNode19)
package Data {
import mx.core.*;
public class NodeFactory_bgNode19 extends BitmapAsset {
}
}//package Data
Section 45
//NodeFactory_bgNode1E (Data.NodeFactory_bgNode1E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode1E extends BitmapAsset {
}
}//package Data
Section 46
//NodeFactory_bgNode1N (Data.NodeFactory_bgNode1N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode1N extends BitmapAsset {
}
}//package Data
Section 47
//NodeFactory_bgNode1S (Data.NodeFactory_bgNode1S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode1S extends BitmapAsset {
}
}//package Data
Section 48
//NodeFactory_bgNode1W (Data.NodeFactory_bgNode1W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode1W extends BitmapAsset {
}
}//package Data
Section 49
//NodeFactory_bgNode2E (Data.NodeFactory_bgNode2E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode2E extends BitmapAsset {
}
}//package Data
Section 50
//NodeFactory_bgNode2N (Data.NodeFactory_bgNode2N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode2N extends BitmapAsset {
}
}//package Data
Section 51
//NodeFactory_bgNode2S (Data.NodeFactory_bgNode2S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode2S extends BitmapAsset {
}
}//package Data
Section 52
//NodeFactory_bgNode2W (Data.NodeFactory_bgNode2W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode2W extends BitmapAsset {
}
}//package Data
Section 53
//NodeFactory_bgNode3E (Data.NodeFactory_bgNode3E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode3E extends BitmapAsset {
}
}//package Data
Section 54
//NodeFactory_bgNode3N (Data.NodeFactory_bgNode3N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode3N extends BitmapAsset {
}
}//package Data
Section 55
//NodeFactory_bgNode3S (Data.NodeFactory_bgNode3S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode3S extends BitmapAsset {
}
}//package Data
Section 56
//NodeFactory_bgNode3W (Data.NodeFactory_bgNode3W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode3W extends BitmapAsset {
}
}//package Data
Section 57
//NodeFactory_bgNode4E (Data.NodeFactory_bgNode4E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode4E extends BitmapAsset {
}
}//package Data
Section 58
//NodeFactory_bgNode4N (Data.NodeFactory_bgNode4N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode4N extends BitmapAsset {
}
}//package Data
Section 59
//NodeFactory_bgNode4S (Data.NodeFactory_bgNode4S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode4S extends BitmapAsset {
}
}//package Data
Section 60
//NodeFactory_bgNode4W (Data.NodeFactory_bgNode4W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode4W extends BitmapAsset {
}
}//package Data
Section 61
//NodeFactory_bgNode5E (Data.NodeFactory_bgNode5E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode5E extends BitmapAsset {
}
}//package Data
Section 62
//NodeFactory_bgNode5N (Data.NodeFactory_bgNode5N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode5N extends BitmapAsset {
}
}//package Data
Section 63
//NodeFactory_bgNode5S (Data.NodeFactory_bgNode5S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode5S extends BitmapAsset {
}
}//package Data
Section 64
//NodeFactory_bgNode5W (Data.NodeFactory_bgNode5W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode5W extends BitmapAsset {
}
}//package Data
Section 65
//NodeFactory_bgNode6E (Data.NodeFactory_bgNode6E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode6E extends BitmapAsset {
}
}//package Data
Section 66
//NodeFactory_bgNode6N (Data.NodeFactory_bgNode6N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode6N extends BitmapAsset {
}
}//package Data
Section 67
//NodeFactory_bgNode6S (Data.NodeFactory_bgNode6S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode6S extends BitmapAsset {
}
}//package Data
Section 68
//NodeFactory_bgNode6W (Data.NodeFactory_bgNode6W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode6W extends BitmapAsset {
}
}//package Data
Section 69
//NodeFactory_bgNode7E (Data.NodeFactory_bgNode7E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode7E extends BitmapAsset {
}
}//package Data
Section 70
//NodeFactory_bgNode7N (Data.NodeFactory_bgNode7N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode7N extends BitmapAsset {
}
}//package Data
Section 71
//NodeFactory_bgNode7S (Data.NodeFactory_bgNode7S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode7S extends BitmapAsset {
}
}//package Data
Section 72
//NodeFactory_bgNode7W (Data.NodeFactory_bgNode7W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode7W extends BitmapAsset {
}
}//package Data
Section 73
//NodeFactory_bgNode9E (Data.NodeFactory_bgNode9E)
package Data {
import mx.core.*;
public class NodeFactory_bgNode9E extends BitmapAsset {
}
}//package Data
Section 74
//NodeFactory_bgNode9N (Data.NodeFactory_bgNode9N)
package Data {
import mx.core.*;
public class NodeFactory_bgNode9N extends BitmapAsset {
}
}//package Data
Section 75
//NodeFactory_bgNode9S (Data.NodeFactory_bgNode9S)
package Data {
import mx.core.*;
public class NodeFactory_bgNode9S extends BitmapAsset {
}
}//package Data
Section 76
//NodeFactory_bgNode9W (Data.NodeFactory_bgNode9W)
package Data {
import mx.core.*;
public class NodeFactory_bgNode9W extends BitmapAsset {
}
}//package Data
Section 77
//NodeFactory_clsMail (Data.NodeFactory_clsMail)
package Data {
import mx.core.*;
public class NodeFactory_clsMail extends SoundAsset {
}
}//package Data
Section 78
//NodeFactory_clsWallBreak (Data.NodeFactory_clsWallBreak)
package Data {
import mx.core.*;
public class NodeFactory_clsWallBreak extends SoundAsset {
}
}//package Data
Section 79
//NodeFactory_sprBaseballBat (Data.NodeFactory_sprBaseballBat)
package Data {
import mx.core.*;
public class NodeFactory_sprBaseballBat extends BitmapAsset {
}
}//package Data
Section 80
//NodeFactory_sprBattCover (Data.NodeFactory_sprBattCover)
package Data {
import mx.core.*;
public class NodeFactory_sprBattCover extends BitmapAsset {
}
}//package Data
Section 81
//NodeFactory_sprBatteries (Data.NodeFactory_sprBatteries)
package Data {
import mx.core.*;
public class NodeFactory_sprBatteries extends BitmapAsset {
}
}//package Data
Section 82
//NodeFactory_sprBigPanelCover (Data.NodeFactory_sprBigPanelCover)
package Data {
import mx.core.*;
public class NodeFactory_sprBigPanelCover extends BitmapAsset {
}
}//package Data
Section 83
//NodeFactory_sprBigPanelCoverKeyhole (Data.NodeFactory_sprBigPanelCoverKeyhole)
package Data {
import mx.core.*;
public class NodeFactory_sprBigPanelCoverKeyhole extends BitmapAsset {
}
}//package Data
Section 84
//NodeFactory_sprCube (Data.NodeFactory_sprCube)
package Data {
import mx.core.*;
public class NodeFactory_sprCube extends BitmapAsset {
}
}//package Data
Section 85
//NodeFactory_sprElectricKnife (Data.NodeFactory_sprElectricKnife)
package Data {
import mx.core.*;
public class NodeFactory_sprElectricKnife extends BitmapAsset {
}
}//package Data
Section 86
//NodeFactory_sprEnvelope (Data.NodeFactory_sprEnvelope)
package Data {
import mx.core.*;
public class NodeFactory_sprEnvelope extends BitmapAsset {
}
}//package Data
Section 87
//NodeFactory_sprEnvelopeSmall (Data.NodeFactory_sprEnvelopeSmall)
package Data {
import mx.core.*;
public class NodeFactory_sprEnvelopeSmall extends BitmapAsset {
}
}//package Data
Section 88
//NodeFactory_sprEnvelopeTiny (Data.NodeFactory_sprEnvelopeTiny)
package Data {
import mx.core.*;
public class NodeFactory_sprEnvelopeTiny extends BitmapAsset {
}
}//package Data
Section 89
//NodeFactory_sprHouseKey (Data.NodeFactory_sprHouseKey)
package Data {
import mx.core.*;
public class NodeFactory_sprHouseKey extends BitmapAsset {
}
}//package Data
Section 90
//NodeFactory_sprLampshadeTurned (Data.NodeFactory_sprLampshadeTurned)
package Data {
import mx.core.*;
public class NodeFactory_sprLampshadeTurned extends BitmapAsset {
}
}//package Data
Section 91
//NodeFactory_sprLampshadeUnturned (Data.NodeFactory_sprLampshadeUnturned)
package Data {
import mx.core.*;
public class NodeFactory_sprLampshadeUnturned extends BitmapAsset {
}
}//package Data
Section 92
//NodeFactory_sprOldKey (Data.NodeFactory_sprOldKey)
package Data {
import mx.core.*;
public class NodeFactory_sprOldKey extends BitmapAsset {
}
}//package Data
Section 93
//NodeFactory_sprPillBottle (Data.NodeFactory_sprPillBottle)
package Data {
import mx.core.*;
public class NodeFactory_sprPillBottle extends BitmapAsset {
}
}//package Data
Section 94
//NodeFactory_sprScanner (Data.NodeFactory_sprScanner)
package Data {
import mx.core.*;
public class NodeFactory_sprScanner extends BitmapAsset {
}
}//package Data
Section 95
//NodeFactory_sprSmallBarcode (Data.NodeFactory_sprSmallBarcode)
package Data {
import mx.core.*;
public class NodeFactory_sprSmallBarcode extends BitmapAsset {
}
}//package Data
Section 96
//NodeFactory_sprSmallCube (Data.NodeFactory_sprSmallCube)
package Data {
import mx.core.*;
public class NodeFactory_sprSmallCube extends BitmapAsset {
}
}//package Data
Section 97
//NodeFactory_sprSmallPanelCover (Data.NodeFactory_sprSmallPanelCover)
package Data {
import mx.core.*;
public class NodeFactory_sprSmallPanelCover extends BitmapAsset {
}
}//package Data
Section 98
//NodeFactory_sprWallBarcode (Data.NodeFactory_sprWallBarcode)
package Data {
import mx.core.*;
public class NodeFactory_sprWallBarcode extends BitmapAsset {
}
}//package Data
Section 99
//NodeFactory_sprWallHole (Data.NodeFactory_sprWallHole)
package Data {
import mx.core.*;
public class NodeFactory_sprWallHole extends BitmapAsset {
}
}//package Data
Section 100
//ZoomNode (Data.ZoomNode)
package Data {
import flash.display.*;
public class ZoomNode extends Node {
public var bmBackground:Bitmap;
public var hotspots:Array;
public var backNode:int;
public function ZoomNode(_arg1:Class, _arg2:int){
hotspots = new Array();
super();
this.backNode = _arg2;
bmBackground = (new (_arg1) as Bitmap);
}
}
}//package Data
Section 101
//Ambiance (Interface.Ambiance)
package Interface {
import flash.events.*;
import flash.media.*;
public class Ambiance {
private static const sndAmbiance:Sound = new clsAmbiance();
private static var scAmbiance:SoundChannel;
private static var clsAmbiance:Class = Ambiance_clsAmbiance;
private static function restartAmbiance(_arg1:Event):void{
var _local2:Number;
if (scAmbiance){
_local2 = scAmbiance.soundTransform.volume;
scAmbiance = sndAmbiance.play();
scAmbiance.soundTransform = new SoundTransform(_local2);
scAmbiance.addEventListener(Event.SOUND_COMPLETE, restartAmbiance);
};
}
public static function startAmbiance(_arg1:Number):void{
scAmbiance = sndAmbiance.play();
scAmbiance.soundTransform = new SoundTransform(_arg1);
scAmbiance.addEventListener(Event.SOUND_COMPLETE, restartAmbiance);
}
public static function stopAmbiance():void{
scAmbiance.removeEventListener(Event.SOUND_COMPLETE, restartAmbiance);
scAmbiance.stop();
scAmbiance = null;
}
public static function setVolume(_arg1:Number):void{
if (scAmbiance){
scAmbiance.soundTransform = new SoundTransform(_arg1);
};
}
}
}//package Interface
Section 102
//Ambiance_clsAmbiance (Interface.Ambiance_clsAmbiance)
package Interface {
import mx.core.*;
public class Ambiance_clsAmbiance extends SoundAsset {
}
}//package Interface
Section 103
//BackButton (Interface.BackButton)
package Interface {
public class BackButton extends Hotspot {
public function BackButton(){
graphics.beginFill(0xFF0000, 0);
graphics.drawRect(0, 0, Main.STAGE_WIDTH, 100);
graphics.endFill();
this.x = 0;
this.y = (Main.STAGE_HEIGHT - 100);
super();
}
override protected function activeCursor():void{
Cursor.setBack();
}
}
}//package Interface
Section 104
//BarcodeHotspot (Interface.BarcodeHotspot)
package Interface {
import flash.events.*;
import com.kongregate.as3.client.*;
import flash.display.*;
import Util.*;
import flash.media.*;
public class BarcodeHotspot extends Hotspot {
private var scanned:Boolean;// = false
private var scanning:Boolean;// = false
private var myMessage:String;
private var bmMine:Bitmap;
private static const sndBeep:Sound = (new clsBeep() as Sound);
private static var clsBeep:Class = BarcodeHotspot_clsBeep;
public static var barcodesScanned:int;
public function BarcodeHotspot(_arg1:int, _arg2:int, _arg3:String, _arg4:Class=null, _arg5:int=-1, _arg6:int=-1){
this.x = _arg1;
this.y = _arg2;
if ((((_arg5 > 0)) && ((_arg6 > 0)))){
graphics.beginFill(0xFF0000, 0);
graphics.drawRect(0, 0, _arg5, _arg6);
};
if (_arg4){
this.bmMine = (new (_arg4) as Bitmap);
SugarGraphics.drawSprite(graphics, bmMine.bitmapData, 0, 0);
if (_arg5 < bmMine.width){
_arg5 = bmMine.width;
};
if (_arg6 < bmMine.height){
_arg6 = bmMine.height;
};
};
myMessage = _arg3;
mouseChildren = false;
}
override protected function dragEnter(_arg1:MouseEvent):void{
if (Cursor.currentCursor != Cursor.bmCurScanner){
return;
};
if (_arg1.localX < 25){
scanning = true;
} else {
scanning = false;
};
}
override protected function dragLeave(_arg1:MouseEvent):void{
if (Cursor.currentCursor != Cursor.bmCurScanner){
return;
};
if (scanning){
if (_arg1.localX >= this.width){
sndBeep.play();
ViewScreen.setText((("The scanner reads \"" + myMessage) + ".\""));
if (!scanned){
barcodesScanned++;
scanned = true;
KongregateAPI.getInstance().stats.submit("BarcodesScanned", barcodesScanned);
};
dispatchEvent(new Event("SCANNED"));
} else {
scanning = false;
};
};
}
}
}//package Interface
Section 105
//BarcodeHotspot_clsBeep (Interface.BarcodeHotspot_clsBeep)
package Interface {
import mx.core.*;
public class BarcodeHotspot_clsBeep extends SoundAsset {
}
}//package Interface
Section 106
//ClosingCutscene (Interface.ClosingCutscene)
package Interface {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class ClosingCutscene extends Sprite {
private var cell:Bitmap;
private var celltimer:int;// = 0
private var timer:Timer;
private var treetimer:int;// = 0
private var white:Sprite;
private var whitetimer:int;// = 0
private var black:Sprite;
private static var bgCellOverlay:Class = ClosingCutscene_bgCellOverlay;
private static var bgColorTrees:Class = ClosingCutscene_bgColorTrees;
public function ClosingCutscene(){
var _local1:Bitmap = new bgColorTrees();
this.addChild(_local1);
cell = new bgCellOverlay();
cell.alpha = 0;
this.addChild(cell);
black = new Sprite();
black.graphics.beginFill(0);
black.graphics.drawRect(0, 0, Main.STAGE_WIDTH, Main.STAGE_HEIGHT);
black.graphics.endFill();
this.addChild(black);
white = new Sprite();
white.graphics.beginFill(0xFFFFFF);
white.graphics.drawRect(0, 0, Main.STAGE_WIDTH, Main.STAGE_HEIGHT);
white.graphics.endFill();
white.alpha = 0;
this.addChild(white);
timer = new Timer((1000 / 30));
timer.addEventListener(TimerEvent.TIMER, fadeLoop);
timer.start();
}
private function fadeLoop(_arg1:TimerEvent):void{
if (black.alpha > 0){
black.alpha = (black.alpha - 0.01);
} else {
if (treetimer < 60){
treetimer++;
} else {
if (cell.alpha < 1){
cell.alpha = (cell.alpha + 0.01);
} else {
if (celltimer < 30){
celltimer++;
} else {
if (white.alpha < 1){
white.alpha = (white.alpha + 0.01);
} else {
if (whitetimer < 15){
whitetimer++;
} else {
timer.removeEventListener(TimerEvent.TIMER, fadeLoop);
this.addChild(new EndScreen());
};
};
};
};
};
};
}
}
}//package Interface
Section 107
//ClosingCutscene_bgCellOverlay (Interface.ClosingCutscene_bgCellOverlay)
package Interface {
import mx.core.*;
public class ClosingCutscene_bgCellOverlay extends BitmapAsset {
}
}//package Interface
Section 108
//ClosingCutscene_bgColorTrees (Interface.ClosingCutscene_bgColorTrees)
package Interface {
import mx.core.*;
public class ClosingCutscene_bgColorTrees extends BitmapAsset {
}
}//package Interface
Section 109
//CombinationHotspot (Interface.CombinationHotspot)
package Interface {
import flash.events.*;
import flash.media.*;
public class CombinationHotspot extends Hotspot {
private var myCodeCorrect:Array;
private var myValue:String;
private var myCodeResult:Function;
private var myHistory:Array;
private var myCodeLength:int;
private static const sndButton:Sound = (new clsButton() as Sound);
private static var clsButton:Class = CombinationHotspot_clsButton;
public function CombinationHotspot(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:String, _arg6:Array, _arg7:int, _arg8:Array, _arg9:Function){
this.x = _arg1;
this.y = _arg2;
graphics.beginFill(0xFF0000, 0);
graphics.drawRect(0, 0, _arg3, _arg4);
graphics.endFill();
myValue = _arg5;
myHistory = _arg6;
myCodeLength = _arg7;
myCodeCorrect = _arg8;
myCodeResult = _arg9;
this.addEventListener(MouseEvent.CLICK, onClick);
}
private function onClick(_arg1:MouseEvent):void{
sndButton.play();
myHistory.push(myValue);
if (myHistory.length > myCodeLength){
myHistory.splice(0, (myHistory.length - myCodeLength));
};
if (myHistory.toString() == myCodeCorrect.toString()){
myCodeResult();
};
}
}
}//package Interface
Section 110
//CombinationHotspot_clsButton (Interface.CombinationHotspot_clsButton)
package Interface {
import mx.core.*;
public class CombinationHotspot_clsButton extends SoundAsset {
}
}//package Interface
Section 111
//CreditScreen (Interface.CreditScreen)
package Interface {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import Util.*;
public class CreditScreen extends Sprite {
public function CreditScreen(){
super();
var creditsText:TextField = new TextField();
creditsText.defaultTextFormat = Fonts.AndrewCentered;
creditsText.embedFonts = true;
creditsText.mouseEnabled = true;
creditsText.selectable = true;
creditsText.width = Main.STAGE_WIDTH;
creditsText.height = Main.STAGE_HEIGHT;
creditsText.background = true;
creditsText.backgroundColor = 0xFFFFFF;
creditsText.wordWrap = true;
creditsText.text = "Bars of Black and White was created by Gregory Weir - http://ludusnovus.net";
creditsText.appendText("\n\nIt uses the Andrew Script font from Andrew Vardeman - http://www.dafont.com/andrew-script.font");
creditsText.appendText("\n\nIt uses sounds from soundsnap.com users Gap Digital, Justine Angus, Bobby Cole, and Radio Mall");
creditsText.appendText("\n\nIt uses the public domain image \"Park in Autumn\" by Petr Kratochvil from http://www.publicdomainpictures.net/");
creditsText.appendText("\n\nThanks to Andrew Geiger, Shun Coaster, and Lissa Avery for testing and suggestions.");
this.addChild(creditsText);
var backButton:TextField = new TextField();
backButton.defaultTextFormat = Fonts.BigAndrewCentered;
backButton.embedFonts = true;
backButton.selectable = false;
backButton.width = 150;
backButton.x = 262;
backButton.y = 450;
backButton.height = 50;
backButton.text = "BACK";
this.addChild(backButton);
backButton.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
Main(parent).closeCredits();
});
}
}
}//package Interface
Section 112
//Cursor (Interface.Cursor)
package Interface {
import flash.display.*;
import Util.*;
public class Cursor extends Sprite {
public static const bmRotate:Bitmap = (new curRotate() as Bitmap);
public static const bmCurOldKey:Bitmap = (new curOldKey() as Bitmap);
private static const bmRight:Bitmap = (new curRight() as Bitmap);
public static const theCursor:Cursor = new (Cursor);
;
public static const bmCurPillBottle:Bitmap = (new curPillBottle() as Bitmap);
public static const bmCurHouseKey:Bitmap = (new curHouseKey() as Bitmap);
public static const bmCurScanner:Bitmap = (new curScanner() as Bitmap);
public static const bmCurSaw:Bitmap = (new curSaw() as Bitmap);
private static const bmBack:Bitmap = (new curBack() as Bitmap);
private static const bmInactive:Bitmap = (new curInactive() as Bitmap);
public static const bmCurBaseballBat:Bitmap = (new curBaseballBat() as Bitmap);
private static const bmLeft:Bitmap = (new curLeft() as Bitmap);
private static const bmForward:Bitmap = (new curForward() as Bitmap);
public static const bmCurBatteries:Bitmap = (new curBatteries() as Bitmap);
private static var inventoryActive:Bitmap = null;
private static var curSaw:Class = Cursor_curSaw;
private static var curBatteries:Class = Cursor_curBatteries;
private static var curOldKey:Class = Cursor_curOldKey;
private static var curScanner:Class = Cursor_curScanner;
private static var currCursor:Bitmap;
private static var curPillBottle:Class = Cursor_curPillBottle;
private static var curRotate:Class = Cursor_curRotate;
private static var curRight:Class = Cursor_curRight;
private static var curBaseballBat:Class = Cursor_curBaseballBat;
private static var curBack:Class = Cursor_curBack;
private static var curInactive:Class = Cursor_curInactive;
private static var curForward:Class = Cursor_curForward;
private static var curLeft:Class = Cursor_curLeft;
private static var curHouseKey:Class = Cursor_curHouseKey;
public function Cursor(){
if (theCursor){
throw (new Error("Tried to instantiate a cursor!"));
};
this.mouseEnabled = false;
draw(bmInactive, 0, 0);
}
private function draw(_arg1:Bitmap, _arg2:int, _arg3:int):void{
graphics.clear();
currCursor = _arg1;
SugarGraphics.drawSprite(graphics, _arg1.bitmapData, -(_arg2), -(_arg3));
}
public static function setForward():void{
theCursor.draw(bmForward, 15, 0);
}
public static function setLeft():void{
theCursor.draw(bmLeft, 0, 11);
}
public static function get currentCursor():Bitmap{
return (currCursor);
}
public static function setInventoryIcon(_arg1:Bitmap):void{
if ((((((((((_arg1 == bmCurScanner)) || ((_arg1 == bmCurOldKey)))) || ((_arg1 == bmCurBaseballBat)))) || ((_arg1 == bmCurHouseKey)))) || ((_arg1 == bmCurSaw)))){
theCursor.draw(_arg1, 0, 0);
} else {
theCursor.draw(_arg1, 16, 16);
};
inventoryActive = _arg1;
}
public static function deactivateInventory():void{
if (currCursor == inventoryActive){
theCursor.draw(bmInactive, 0, 0);
};
inventoryActive = null;
}
public static function setRight():void{
theCursor.draw(bmRight, 21, 11);
}
public static function setRotate():void{
theCursor.draw(bmRotate, 16, 11);
}
public static function setBack():void{
theCursor.draw(bmBack, 12, 27);
}
public static function setInactive():void{
if (inventoryActive){
theCursor.draw(inventoryActive, 0, 0);
} else {
theCursor.draw(bmInactive, 0, 0);
};
}
public static function get activeInventoryCursor():Bitmap{
return (inventoryActive);
}
}
}//package Interface
Section 113
//Cursor_curBack (Interface.Cursor_curBack)
package Interface {
import mx.core.*;
public class Cursor_curBack extends BitmapAsset {
}
}//package Interface
Section 114
//Cursor_curBaseballBat (Interface.Cursor_curBaseballBat)
package Interface {
import mx.core.*;
public class Cursor_curBaseballBat extends BitmapAsset {
}
}//package Interface
Section 115
//Cursor_curBatteries (Interface.Cursor_curBatteries)
package Interface {
import mx.core.*;
public class Cursor_curBatteries extends BitmapAsset {
}
}//package Interface
Section 116
//Cursor_curForward (Interface.Cursor_curForward)
package Interface {
import mx.core.*;
public class Cursor_curForward extends BitmapAsset {
}
}//package Interface
Section 117
//Cursor_curHouseKey (Interface.Cursor_curHouseKey)
package Interface {
import mx.core.*;
public class Cursor_curHouseKey extends BitmapAsset {
}
}//package Interface
Section 118
//Cursor_curInactive (Interface.Cursor_curInactive)
package Interface {
import mx.core.*;
public class Cursor_curInactive extends BitmapAsset {
}
}//package Interface
Section 119
//Cursor_curLeft (Interface.Cursor_curLeft)
package Interface {
import mx.core.*;
public class Cursor_curLeft extends BitmapAsset {
}
}//package Interface
Section 120
//Cursor_curOldKey (Interface.Cursor_curOldKey)
package Interface {
import mx.core.*;
public class Cursor_curOldKey extends BitmapAsset {
}
}//package Interface
Section 121
//Cursor_curPillBottle (Interface.Cursor_curPillBottle)
package Interface {
import mx.core.*;
public class Cursor_curPillBottle extends BitmapAsset {
}
}//package Interface
Section 122
//Cursor_curRight (Interface.Cursor_curRight)
package Interface {
import mx.core.*;
public class Cursor_curRight extends BitmapAsset {
}
}//package Interface
Section 123
//Cursor_curRotate (Interface.Cursor_curRotate)
package Interface {
import mx.core.*;
public class Cursor_curRotate extends BitmapAsset {
}
}//package Interface
Section 124
//Cursor_curSaw (Interface.Cursor_curSaw)
package Interface {
import mx.core.*;
public class Cursor_curSaw extends BitmapAsset {
}
}//package Interface
Section 125
//Cursor_curScanner (Interface.Cursor_curScanner)
package Interface {
import mx.core.*;
public class Cursor_curScanner extends BitmapAsset {
}
}//package Interface
Section 126
//EndScreen (Interface.EndScreen)
package Interface {
import flash.events.*;
import com.kongregate.as3.client.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import Data.*;
import flash.text.*;
import Util.*;
public class EndScreen extends Sprite {
private var barcode:BarcodeHotspot;
private var laserLayer:Sprite;
private var mousePoints:Array;
private var theEnd:TextField;
private var score:TextField;
private var laserTimer:Timer;
private static const LASER_LENGTH:int = 5;
private static var sprEndBarcode:Class = EndScreen_sprEndBarcode;
public function EndScreen(){
super();
graphics.beginFill(0xFFFFFF);
graphics.drawRect(0, 0, Main.STAGE_WIDTH, Main.STAGE_HEIGHT);
graphics.endFill();
theEnd = new TextField();
theEnd.defaultTextFormat = Fonts.BigAndrewCentered;
theEnd.embedFonts = true;
theEnd.mouseEnabled = false;
theEnd.selectable = false;
theEnd.width = Main.STAGE_WIDTH;
theEnd.y = 200;
theEnd.background = true;
theEnd.backgroundColor = 0xFFFFFF;
theEnd.height = 50;
theEnd.text = "THE END";
theEnd.visible = false;
this.addChild(theEnd);
var byMe:TextField = new TextField();
byMe.htmlText = "<a href=\"http://ludusnovus.net\" target=\"_blank\">Developed by Gregory Weir - http://ludusnovus.net</a>";
byMe.x = 0;
byMe.y = 465;
byMe.width = 675;
byMe.setTextFormat(Fonts.AndrewCentered);
byMe.embedFonts = true;
this.addChild(byMe);
byMe.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1:MouseEvent):void{
Cursor.theCursor.visible = false;
});
byMe.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1:MouseEvent):void{
Cursor.theCursor.visible = true;
});
score = new TextField();
score.x = 0;
score.y = 350;
score.width = 675;
score.defaultTextFormat = Fonts.AndrewCentered;
score.text = (((((("Time Elapsed: " + ((Main.endTime - Main.startTime) / 1000)) + " seconds\n") + BarcodeHotspot.barcodesScanned) + "/") + NodeFactory.totalBarcodes) + " barcodes scanned");
score.embedFonts = true;
score.selectable = false;
this.addChild(score);
KongregateAPI.getInstance().scores.submit(((Main.endTime - Main.startTime) / 1000), "CompleteTime");
var replay:TextField = new TextField();
replay.x = 0;
replay.y = 425;
replay.width = 675;
replay.defaultTextFormat = Fonts.AndrewCentered;
replay.text = "Replay?";
replay.embedFonts = true;
replay.selectable = false;
this.addChild(replay);
replay.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
replayClicked();
});
barcode = new BarcodeHotspot(212, 200, "", sprEndBarcode);
barcode.addEventListener("SCANNED", function (_arg1:Event):void{
barcodeScanned();
});
this.addChild(barcode);
Cursor.setInventoryIcon(Cursor.bmCurScanner);
laserLayer = new Sprite();
laserLayer.mouseEnabled = false;
this.addChild(laserLayer);
this.addEventListener(MouseEvent.MOUSE_DOWN, startScan);
this.addEventListener(MouseEvent.MOUSE_MOVE, updateScan);
this.addEventListener(MouseEvent.MOUSE_UP, endScan);
laserTimer = new Timer(50, 0);
laserTimer.addEventListener(TimerEvent.TIMER, fadeLaser);
laserTimer.start();
}
private function drawTrail():void{
var _local1:int;
if (mousePoints == null){
return;
};
laserLayer.graphics.clear();
if (mousePoints.length == 1){
laserLayer.graphics.beginFill(0xFF0000);
laserLayer.graphics.drawCircle(mousePoints[0].x, mousePoints[0].y, 4.5);
} else {
laserLayer.graphics.moveTo(mousePoints[0].x, mousePoints[0].y);
_local1 = 1;
while (_local1 < mousePoints.length) {
laserLayer.graphics.lineStyle(9, 0xFF0000, (Number(_local1) / Number(mousePoints.length)));
laserLayer.graphics.lineTo(mousePoints[_local1].x, mousePoints[_local1].y);
_local1++;
};
};
}
private function updateScan(_arg1:MouseEvent):void{
if (((_arg1.buttonDown) && ((Cursor.activeInventoryCursor == Cursor.bmCurScanner)))){
mousePoints.push(new Point(_arg1.stageX, _arg1.stageY));
if (mousePoints.length > LASER_LENGTH){
mousePoints.splice(0, 1);
};
drawTrail();
};
}
private function fadeLaser(_arg1:Event):void{
if (((mousePoints) && ((mousePoints.length > 1)))){
mousePoints.splice(0, 1);
drawTrail();
};
}
private function barcodeScanned():void{
theEnd.visible = true;
barcode.visible = false;
score.text = (((((("Time Elapsed: " + ((Main.endTime - Main.startTime) / 1000)) + " seconds\n") + BarcodeHotspot.barcodesScanned) + "/") + NodeFactory.totalBarcodes) + " barcodes scanned");
}
private function endScan(_arg1:MouseEvent):void{
laserLayer.graphics.clear();
mousePoints = null;
}
private function replayClicked():void{
Main(parent.parent).replay();
}
private function startScan(_arg1:MouseEvent):void{
if (Cursor.activeInventoryCursor == Cursor.bmCurScanner){
mousePoints = new Array();
mousePoints.push(new Point(_arg1.stageX, _arg1.stageY));
drawTrail();
};
}
}
}//package Interface
Section 127
//EndScreen_sprEndBarcode (Interface.EndScreen_sprEndBarcode)
package Interface {
import mx.core.*;
public class EndScreen_sprEndBarcode extends BitmapAsset {
}
}//package Interface
Section 128
//ForwardButton (Interface.ForwardButton)
package Interface {
public class ForwardButton extends Hotspot {
public function ForwardButton(){
graphics.beginFill(0xFF0000, 0);
graphics.drawRect(0, 0, (Main.STAGE_WIDTH - 200), (Main.STAGE_HEIGHT - 100));
graphics.endFill();
this.x = 100;
this.y = 0;
super();
}
override protected function activeCursor():void{
Cursor.setForward();
}
}
}//package Interface
Section 129
//GenericHotspot (Interface.GenericHotspot)
package Interface {
import flash.display.*;
import Util.*;
public class GenericHotspot extends Hotspot {
public function GenericHotspot(_arg1:int, _arg2:int, _arg3:Class, _arg4:int=-1, _arg5:int=-1){
this.x = _arg1;
this.y = _arg2;
if (_arg3){
SugarGraphics.drawSprite(graphics, (new (_arg3) as Bitmap).bitmapData, 0, 0);
};
if ((((_arg4 > 0)) && ((_arg5 > 0)))){
graphics.beginFill(0xFF0000, 0);
graphics.drawRect(0, 0, _arg4, _arg5);
};
super();
}
}
}//package Interface
Section 130
//Hotspot (Interface.Hotspot)
package Interface {
import flash.events.*;
import flash.display.*;
public class Hotspot extends Sprite {
private var removed:Boolean;// = false
private var draggingOver:Boolean;// = false
private var mouseIsOver:Boolean;// = false
public function Hotspot(){
mouseChildren = false;
this.addEventListener(MouseEvent.MOUSE_MOVE, mouseOver);
this.addEventListener(MouseEvent.MOUSE_OUT, mouseOut);
this.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
}
protected function inactiveCursor():void{
Cursor.setInactive();
}
protected function dragEnter(_arg1:MouseEvent):void{
}
protected function mouseOut(_arg1:MouseEvent):void{
if (((_arg1.buttonDown) && (draggingOver))){
dragLeave(_arg1);
};
mouseIsOver = false;
rolloutDraw();
inactiveCursor();
}
public function remove():void{
removed = true;
visible = false;
}
protected function mouseUp(_arg1:MouseEvent):void{
}
protected function dragLeave(_arg1:MouseEvent):void{
}
protected function rolloverDraw():void{
}
protected function rolloutDraw():void{
}
protected function mouseOver(_arg1:MouseEvent):void{
if (!mouseIsOver){
rolloverDraw();
if (_arg1.buttonDown){
draggingOver = true;
dragEnter(_arg1);
};
};
activeCursor();
mouseIsOver = true;
}
protected function activeCursor():void{
}
public function toggleVisibility(_arg1:Boolean):void{
if (!removed){
this.visible = _arg1;
};
}
}
}//package Interface
Section 131
//InventoryIcon (Interface.InventoryIcon)
package Interface {
import flash.events.*;
import flash.display.*;
import Data.*;
import Util.*;
public class InventoryIcon extends Sprite {
private var active:Boolean;// = false
private var icon:Bitmap;// = null
public function InventoryIcon(_arg1:Bitmap){
this.icon = _arg1;
redraw();
this.addEventListener(MouseEvent.CLICK, onClick);
}
public function get isActive():Boolean{
return (active);
}
public function set isActive(_arg1:Boolean):void{
active = _arg1;
redraw();
}
private function onClick(_arg1:MouseEvent):void{
if (active){
Cursor.deactivateInventory();
NodeFactory.INVENTORY.deactivate();
} else {
Cursor.setInventoryIcon(icon);
NodeFactory.INVENTORY.activate(this);
};
}
private function redraw():void{
graphics.clear();
if (active){
graphics.beginFill(0xCCCCCC);
} else {
graphics.beginFill(0x999999);
};
graphics.drawCircle(16, 16, 16);
graphics.endFill();
SugarGraphics.drawSprite(graphics, icon.bitmapData, ((32 - icon.width) / 2), 0);
}
}
}//package Interface
Section 132
//LeftButton (Interface.LeftButton)
package Interface {
public class LeftButton extends Hotspot {
public function LeftButton(){
graphics.beginFill(0xFF0000, 0);
graphics.drawRect(0, 0, 100, Main.STAGE_HEIGHT);
graphics.endFill();
this.x = 0;
this.y = 0;
super();
}
override protected function activeCursor():void{
Cursor.setLeft();
}
}
}//package Interface
Section 133
//NodeLinkHotspot (Interface.NodeLinkHotspot)
package Interface {
import flash.events.*;
import flash.display.*;
import Util.*;
public class NodeLinkHotspot extends Hotspot {
private var bmMine:Bitmap;
private var myNode:int;
public function NodeLinkHotspot(_arg1:int, _arg2:int, _arg3:int, _arg4:Class=null, _arg5:int=-1, _arg6:int=-1){
this.x = _arg1;
this.y = _arg2;
if (_arg4){
this.bmMine = (new (_arg4) as Bitmap);
SugarGraphics.drawSprite(graphics, bmMine.bitmapData, 0, 0);
};
if ((((_arg5 > 0)) && ((_arg6 > 0)))){
graphics.beginFill(0xFF0000, 0);
graphics.drawRect(0, 0, _arg5, _arg6);
};
super();
myNode = _arg3;
this.addEventListener(MouseEvent.CLICK, onClick);
}
override protected function activeCursor():void{
Cursor.setForward();
}
private function onClick(_arg1:MouseEvent):void{
ViewScreen.currentViewScreen.setNode(myNode);
}
}
}//package Interface
Section 134
//PickupHotspot (Interface.PickupHotspot)
package Interface {
import flash.events.*;
import flash.display.*;
import Data.*;
import Util.*;
public class PickupHotspot extends Hotspot {
private var icon:InventoryIcon;
private var myMessage:String;
public function PickupHotspot(_arg1:int, _arg2:int, _arg3:Class, _arg4:InventoryIcon, _arg5:String){
this.x = _arg1;
this.y = _arg2;
SugarGraphics.drawSprite(graphics, (new (_arg3) as Bitmap).bitmapData, 0, 0);
this.icon = _arg4;
this.addEventListener(MouseEvent.CLICK, pickup);
myMessage = _arg5;
}
private function pickup(_arg1:MouseEvent):void{
this.visible = false;
NodeFactory.INVENTORY.addItem(icon);
ViewScreen.setText(myMessage);
}
}
}//package Interface
Section 135
//RightButton (Interface.RightButton)
package Interface {
public class RightButton extends Hotspot {
public function RightButton(){
graphics.beginFill(0xFF0000, 0);
graphics.drawRect(0, 0, 100, Main.STAGE_HEIGHT);
graphics.endFill();
this.x = (Main.STAGE_WIDTH - 100);
this.y = 0;
super();
}
override protected function activeCursor():void{
Cursor.setRight();
}
}
}//package Interface
Section 136
//RotationalHotspot (Interface.RotationalHotspot)
package Interface {
import flash.events.*;
import flash.display.*;
import Util.*;
public class RotationalHotspot extends Hotspot {
private var currFrame:int;// = 0
private var rotFrames:Array;
public function RotationalHotspot(_arg1:int, _arg2:int, ... _args){
rotFrames = new Array();
this.x = _arg1;
this.y = _arg2;
var _local4:int;
while (_local4 < _args.length) {
rotFrames.push((new (_args[_local4]) as Bitmap));
_local4++;
};
this.addEventListener(MouseEvent.CLICK, rotate);
redraw();
super();
}
public function rotate(_arg1:Event):void{
currFrame++;
if (currFrame == rotFrames.length){
currFrame = 0;
};
redraw();
}
public function get currentFrame():int{
return (currFrame);
}
private function redraw():void{
graphics.clear();
SugarGraphics.drawSprite(graphics, rotFrames[currFrame].bitmapData, 0, 0);
}
override protected function activeCursor():void{
Cursor.setRotate();
}
}
}//package Interface
Section 137
//SceneryHotspot (Interface.SceneryHotspot)
package Interface {
import flash.display.*;
import Util.*;
public class SceneryHotspot extends Hotspot {
private var myBitmap:Bitmap;
public function SceneryHotspot(_arg1:int, _arg2:int, _arg3:Class){
this.x = _arg1;
this.y = _arg2;
myBitmap = (new (_arg3) as Bitmap);
SugarGraphics.drawSprite(graphics, myBitmap.bitmapData, 0, 0);
mouseEnabled = false;
}
public function drawSelf(_arg1:Graphics):void{
SugarGraphics.drawSprite(_arg1, myBitmap.bitmapData, x, y);
}
}
}//package Interface
Section 138
//SpiderHotspot (Interface.SpiderHotspot)
package Interface {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import Util.*;
public class SpiderHotspot extends Hotspot {
private var dead:Boolean;// = false
private var startx:int;
private static var clsSpider:Class = SpiderHotspot_clsSpider;
public function SpiderHotspot(_arg1:int, _arg2:int){
this.x = _arg1;
this.y = _arg2;
this.startx = _arg1;
SugarGraphics.drawSprite(graphics, (new clsSpider() as Bitmap).bitmapData, 0, 0);
var _local3:Timer = new Timer(500);
_local3.addEventListener(TimerEvent.TIMER, twitchLoop);
_local3.start();
this.addEventListener(MouseEvent.CLICK, onClick);
}
public function die():void{
this.dead = true;
this.rotation = 180;
this.x = (this.x + this.width);
this.y = (this.y + this.height);
}
private function twitchLoop(_arg1:Event):void{
if (!dead){
if (this.x == this.startx){
if (Math.random() < 0.5){
x++;
} else {
x--;
};
} else {
this.x = this.startx;
};
};
}
public function onClick(_arg1:MouseEvent):void{
if (dead){
ViewScreen.setText("I think it's dead.");
} else {
ViewScreen.setText("That is one creepy spider.");
};
}
}
}//package Interface
Section 139
//SpiderHotspot_clsSpider (Interface.SpiderHotspot_clsSpider)
package Interface {
import mx.core.*;
public class SpiderHotspot_clsSpider extends BitmapAsset {
}
}//package Interface
Section 140
//TitleScreen (Interface.TitleScreen)
package Interface {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import Util.*;
public class TitleScreen extends Sprite {
private static const bmTitleLogo:Bitmap = new sprTitleLogo();
private static var sprTitleLogo:Class = TitleScreen_sprTitleLogo;
public function TitleScreen(){
super();
bmTitleLogo.x = 187;
bmTitleLogo.y = 100;
this.addChild(bmTitleLogo);
var playButton:TextField = new TextField();
playButton.defaultTextFormat = Fonts.BigAndrewCentered;
playButton.embedFonts = true;
playButton.selectable = false;
playButton.width = 150;
playButton.x = 100;
playButton.y = 375;
playButton.height = 50;
playButton.text = "BEGIN";
this.addChild(playButton);
playButton.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
Main(parent).beginGame();
});
var creditsButton:TextField = new TextField();
creditsButton.defaultTextFormat = Fonts.BigAndrewCentered;
creditsButton.embedFonts = true;
creditsButton.selectable = false;
creditsButton.width = 200;
creditsButton.x = 400;
creditsButton.y = 375;
creditsButton.height = 50;
creditsButton.text = "CREDITS";
this.addChild(creditsButton);
creditsButton.addEventListener(MouseEvent.CLICK, function (_arg1:MouseEvent):void{
Main(parent).showCredits();
});
var byMe:TextField = new TextField();
byMe.htmlText = "<a href=\"http://ludusnovus.net\" target=\"_blank\">Developed by Gregory Weir - http://ludusnovus.net</a>";
byMe.x = 0;
byMe.y = 465;
byMe.width = 675;
byMe.setTextFormat(Fonts.AndrewCentered);
byMe.embedFonts = true;
this.addChild(byMe);
byMe.addEventListener(MouseEvent.MOUSE_OVER, function (_arg1:MouseEvent):void{
Cursor.theCursor.visible = false;
});
byMe.addEventListener(MouseEvent.MOUSE_OUT, function (_arg1:MouseEvent):void{
Cursor.theCursor.visible = true;
});
}
}
}//package Interface
Section 141
//TitleScreen_sprTitleLogo (Interface.TitleScreen_sprTitleLogo)
package Interface {
import mx.core.*;
public class TitleScreen_sprTitleLogo extends BitmapAsset {
}
}//package Interface
Section 142
//ViewScreen (Interface.ViewScreen)
package Interface {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import Data.*;
import flash.text.*;
import Util.*;
public class ViewScreen extends Sprite {
private var backButton:BackButton;
private var textLine:TextField;
private var laserLayer:Sprite;
private var hotspotLayer:Sprite;
private var message2bdisplayed:Boolean;
private var currNode:Node;
private var forwardButton:ForwardButton;
private var leftButton:LeftButton;
private var message1displayed:Boolean;
private var message2adisplayed:Boolean;
private var currFacing:int;
private var mousePoints:Array;
private var inv:Inventory;
private var rightButton:RightButton;
private var laserTimer:Timer;
private static const LASER_LENGTH:int = 5;
public static var currentViewScreen:ViewScreen;
public function ViewScreen(_arg1:int, _arg2:int){
leftButton = new LeftButton();
rightButton = new RightButton();
backButton = new BackButton();
forwardButton = new ForwardButton();
hotspotLayer = new Sprite();
super();
currentViewScreen = this;
this.addChild(backButton);
backButton.addEventListener(MouseEvent.CLICK, moveBack);
this.addChild(leftButton);
leftButton.addEventListener(MouseEvent.CLICK, turnLeft);
this.addChild(rightButton);
rightButton.addEventListener(MouseEvent.CLICK, turnRight);
this.addChild(forwardButton);
forwardButton.addEventListener(MouseEvent.CLICK, moveForward);
this.addChild(hotspotLayer);
laserLayer = new Sprite();
laserLayer.mouseEnabled = false;
this.addChild(laserLayer);
this.addEventListener(MouseEvent.MOUSE_DOWN, startScan);
this.addEventListener(MouseEvent.MOUSE_MOVE, updateScan);
this.addEventListener(MouseEvent.MOUSE_UP, endScan);
laserTimer = new Timer(50, 0);
laserTimer.addEventListener(TimerEvent.TIMER, fadeLaser);
laserTimer.start();
inv = NodeFactory.INVENTORY;
inv.x = 100;
inv.y = 25;
this.addChild(inv);
textLine = new TextField();
textLine.defaultTextFormat = Fonts.AndrewCentered;
textLine.embedFonts = true;
textLine.mouseEnabled = false;
textLine.selectable = false;
textLine.width = Main.STAGE_WIDTH;
textLine.y = (Main.STAGE_HEIGHT - 50);
textLine.background = true;
textLine.backgroundColor = 0xFFFFFF;
textLine.height = 30;
textLine.visible = false;
this.addChild(textLine);
currFacing = _arg2;
Ambiance.startAmbiance(0.5);
setNode(_arg1);
setText("I don't do anything anymore. I used to do things, but now I don't.");
}
public function setNode(_arg1:int):void{
if (_arg1 == 15){
Main(parent).endGame();
return;
};
currNode = NodeFactory.NODES[_arg1];
updateMovementAbility();
redraw();
if ((((_arg1 == 0)) || ((_arg1 == 7)))){
Ambiance.setVolume(0.5);
} else {
if ((((((_arg1 == 1)) || ((_arg1 == 3)))) || ((_arg1 == 10)))){
Ambiance.setVolume(0.25);
} else {
if ((((((_arg1 == 2)) || ((_arg1 == 4)))) || ((_arg1 == 6)))){
Ambiance.setVolume(0.1);
} else {
if ((((((_arg1 == 8)) || ((_arg1 == 9)))) || ((_arg1 == 19)))){
Ambiance.setVolume(1);
} else {
Ambiance.setVolume(0);
};
};
};
};
if (_arg1 == 2){
if (!message2adisplayed){
message2adisplayed = true;
setText("I can't remember the last time I left my apartment.");
};
};
if ((((_arg1 == 1)) && (!(message1displayed)))){
message1displayed = true;
setText("All I do is play computer games and sleep, and I don't know why.");
};
}
private function updateMovementAbility():void{
if ((currNode is NavNode)){
leftButton.visible = true;
rightButton.visible = true;
switch (currFacing){
case Main.NORTH:
backButton.visible = !((NavNode(currNode).nodeSouth == -1));
forwardButton.visible = !((NavNode(currNode).nodeNorth == -1));
break;
case Main.SOUTH:
backButton.visible = !((NavNode(currNode).nodeNorth == -1));
forwardButton.visible = !((NavNode(currNode).nodeSouth == -1));
break;
case Main.EAST:
backButton.visible = !((NavNode(currNode).nodeWest == -1));
forwardButton.visible = !((NavNode(currNode).nodeEast == -1));
break;
case Main.WEST:
backButton.visible = !((NavNode(currNode).nodeEast == -1));
forwardButton.visible = !((NavNode(currNode).nodeWest == -1));
break;
};
} else {
if ((currNode is ZoomNode)){
backButton.visible = true;
leftButton.visible = false;
rightButton.visible = false;
forwardButton.visible = false;
};
};
}
private function turnRight(_arg1:Event):void{
this.currFacing++;
if (this.currFacing == 4){
this.currFacing = 0;
};
updateMovementAbility();
redraw();
if (((((!(message2bdisplayed)) && ((this.currNode == NodeFactory.NODES[2])))) && ((this.currFacing == Main.NORTH)))){
message2bdisplayed = true;
setText("I never get any visitors, or receive any mail.");
};
}
private function turnLeft(_arg1:Event):void{
this.currFacing--;
if (this.currFacing == -1){
this.currFacing = 3;
};
updateMovementAbility();
redraw();
if (((((!(message2bdisplayed)) && ((this.currNode == NodeFactory.NODES[2])))) && ((this.currFacing == Main.NORTH)))){
message2bdisplayed = true;
setText("I never get any visitors, or receive any mail.");
};
}
private function updateScan(_arg1:MouseEvent):void{
if (((_arg1.buttonDown) && ((Cursor.activeInventoryCursor == Cursor.bmCurScanner)))){
mousePoints.push(new Point(_arg1.stageX, _arg1.stageY));
if (mousePoints.length > LASER_LENGTH){
mousePoints.splice(0, 1);
};
drawTrail();
};
}
private function addHotspot(_arg1:Hotspot):void{
if ((_arg1 is SceneryHotspot)){
if (_arg1.visible){
SceneryHotspot(_arg1).drawSelf(graphics);
};
} else {
hotspotLayer.addChild(_arg1);
};
}
private function drawTrail():void{
var _local1:int;
if (mousePoints == null){
return;
};
laserLayer.graphics.clear();
if (mousePoints.length == 1){
laserLayer.graphics.beginFill(0xFF0000);
laserLayer.graphics.drawCircle(mousePoints[0].x, mousePoints[0].y, 4.5);
} else {
laserLayer.graphics.moveTo(mousePoints[0].x, mousePoints[0].y);
_local1 = 1;
while (_local1 < mousePoints.length) {
laserLayer.graphics.lineStyle(9, 0xFF0000, (Number(_local1) / Number(mousePoints.length)));
laserLayer.graphics.lineTo(mousePoints[_local1].x, mousePoints[_local1].y);
_local1++;
};
};
}
private function moveBack(_arg1:Event):void{
var _local2:int;
if ((currNode is NavNode)){
_local2 = ((currFacing + 2) % 4);
if (NavNode(currNode).nodeTo(_local2) == -1){
return;
};
setNode(NavNode(currNode).nodeTo(_local2));
} else {
if ((currNode is ZoomNode)){
setNode(ZoomNode(currNode).backNode);
};
};
}
private function fadeLaser(_arg1:Event):void{
if (((mousePoints) && ((mousePoints.length > 1)))){
mousePoints.splice(0, 1);
drawTrail();
};
}
private function redraw():void{
var _local1:Bitmap;
var _local2:Array;
var _local3:int;
setText("");
graphics.clear();
while (hotspotLayer.numChildren > 0) {
hotspotLayer.removeChildAt(0);
};
if ((currNode is NavNode)){
_local1 = NavNode(currNode).bmTo(currFacing);
} else {
if ((currNode is ZoomNode)){
_local1 = ZoomNode(currNode).bmBackground;
};
};
SugarGraphics.drawSprite(graphics, _local1.bitmapData, 0, 0);
if ((currNode is NavNode)){
_local2 = NavNode(currNode).hotspotsTo(currFacing);
_local3 = 0;
while (_local3 < _local2.length) {
addHotspot(_local2[_local3]);
_local3++;
};
} else {
if ((currNode is ZoomNode)){
_local2 = ZoomNode(currNode).hotspots;
_local3 = 0;
while (_local3 < _local2.length) {
addHotspot(_local2[_local3]);
_local3++;
};
};
};
}
private function endScan(_arg1:MouseEvent):void{
laserLayer.graphics.clear();
mousePoints = null;
}
private function moveForward(_arg1:Event):void{
if (((!((currNode is NavNode))) || ((NavNode(currNode).nodeTo(currFacing) == -1)))){
return;
};
setNode(NavNode(currNode).nodeTo(currFacing));
}
private function startScan(_arg1:MouseEvent):void{
if (Cursor.activeInventoryCursor == Cursor.bmCurScanner){
mousePoints = new Array();
mousePoints.push(new Point(_arg1.stageX, _arg1.stageY));
drawTrail();
};
}
public static function setText(_arg1:String):void{
if (currentViewScreen){
ViewScreen.currentViewScreen.textLine.text = _arg1;
ViewScreen.currentViewScreen.textLine.visible = !((_arg1 == ""));
};
}
}
}//package Interface
Section 143
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 144
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 145
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 146
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 147
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 148
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 149
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 150
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 151
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 152
//Fonts (Util.Fonts)
package Util {
import flash.text.*;
public class Fonts {
public static const AndrewCentered:TextFormat = new TextFormat(ANDREW, 20, null, null, null, null, null, null, TextFormatAlign.CENTER);
private static const POCKETCALCULATOR:String = "PocketCalculator";
public static const BigAndrewCentered:TextFormat = new TextFormat(ANDREW, 45, null, null, null, null, null, null, TextFormatAlign.CENTER);
public static const PocketCalculatorCentered:TextFormat = new TextFormat(POCKETCALCULATOR, 24, null, null, null, null, null, null, TextFormatAlign.CENTER);
private static const ANDREW:String = "Andrew";
private static var Andrew:String = "Fonts_Andrew";
private static var pocketCalculator:String = "Fonts_pocketCalculator";
}
}//package Util
Section 153
//Fonts_Andrew (Util.Fonts_Andrew)
package Util {
import mx.core.*;
public class Fonts_Andrew extends FontAsset {
}
}//package Util
Section 154
//Fonts_pocketCalculator (Util.Fonts_pocketCalculator)
package Util {
import mx.core.*;
public class Fonts_pocketCalculator extends FontAsset {
}
}//package Util
Section 155
//SugarGraphics (Util.SugarGraphics)
package Util {
import flash.display.*;
import flash.geom.*;
public class SugarGraphics {
public static function drawSprite(_arg1:Graphics, _arg2:BitmapData, _arg3:Number, _arg4:Number, _arg5:Matrix=null, _arg6:Number=1):void{
if (_arg5 == null){
_arg5 = new Matrix();
};
_arg5.scale(_arg6, _arg6);
_arg5.translate(_arg3, _arg4);
_arg1.beginBitmapFill(_arg2, _arg5);
_arg1.drawRect(_arg3, _arg4, (_arg2.width * _arg6), (_arg2.height * _arg6));
_arg1.endFill();
}
}
}//package Util
Section 156
//Main (Main)
package {
import flash.events.*;
import Interface.*;
import com.kongregate.as3.client.*;
import flash.display.*;
import flash.utils.*;
import Data.*;
import flash.ui.*;
public dynamic class Main extends MovieClip {
private var creditScreen:CreditScreen;
private var viewScreen:ViewScreen;
private var closingCutscene:ClosingCutscene;
public static const NORTH:int = 0;
public static const STAGE_HEIGHT:int = 500;
public static const STAGE_WIDTH:int = 675;
public static const SOUTH:int = 2;
public static const WEST:int = 3;
public static const EAST:int = 1;
public static var startTime:int;
public static var endTime:int;
public function Main():void{
creditScreen = new CreditScreen();
super();
if (stage){
init();
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
};
}
private function moveCursor(_arg1:MouseEvent):void{
Mouse.hide();
Cursor.theCursor.x = _arg1.stageX;
Cursor.theCursor.y = _arg1.stageY;
}
public function closeCredits():void{
this.removeChild(creditScreen);
}
public function endGame():void{
closingCutscene = new ClosingCutscene();
this.addChildAt(closingCutscene, (numChildren - 1));
this.removeChild(viewScreen);
endTime = getTimer();
}
public function replay():void{
Cursor.deactivateInventory();
this.removeChild(closingCutscene);
BarcodeHotspot.barcodesScanned = 0;
NodeFactory.reset();
}
private function init(_arg1:Event=null):void{
var _local5:String;
var _local6:String;
var _local7:int;
removeEventListener(Event.ADDED_TO_STAGE, init);
MochiBot.track(this, "8cd4381d");
var _local2:KongregateAPI = new KongregateAPI();
this.addChild(_local2);
var _local3:Array = new Array();
var _local4:Boolean;
if (_local3.length > 0){
_local4 = false;
_local5 = stage.loaderInfo.url.split("/")[2];
for (_local6 in _local3) {
_local7 = _local5.indexOf(_local3[_local6]);
if ((((_local7 > -1)) && ((_local7 == (_local5.length - _local3[_local6].length))))){
_local4 = true;
break;
};
};
};
if (!_local4){
this.alpha = 0;
};
graphics.beginFill(0xFFFFFF);
graphics.drawRect(0, 0, STAGE_WIDTH, STAGE_HEIGHT);
graphics.endFill();
this.addChild(new TitleScreen());
this.addChild(Cursor.theCursor);
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveCursor);
}
public function beginGame():void{
viewScreen = new ViewScreen(3, NORTH);
this.addChildAt(viewScreen, (numChildren - 1));
startTime = getTimer();
}
public function showCredits():void{
this.addChildAt(creditScreen, (numChildren - 1));
}
}
}//package
Section 157
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.6");
}
public static function showClickAwayAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
var sendHostProgress:Boolean;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
var _local1:Object = this.parent._mochiad_ctr;
var _local2:Number = (getTimer() - this.started);
var _local3:Boolean;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
var _local3:Object = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
var idx:Number = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(_arg1:Object):MovieClip{
var clip:Object;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
var DEFAULTS:Object = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
var depth:Number = options.depth;
delete options.depth;
var mc:MovieClip = createEmptyMovieClip(clip, "_mochiad", depth);
var wh:Array = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
var lv:URLVariables = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local6:Array;
var _local3:Object = _arg2.getBounds(_arg2.root);
var _local4:Number = 0;
var _local5:Number = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array = _arg2.split(".");
var _local4:Number = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array = _arg2.split(".");
var _local5:Number = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1:Object):void{
var clip:Object;
var mc:MovieClip;
var chk:MovieClip;
var complete:Boolean;
var unloaded:Boolean;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = _arg1;
var DEFAULTS:Object = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
var ad_msec:Number = 11000;
var ad_timeout:Number = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time:Number = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
var fn:Function = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
var wh:Array = MochiAd._getRes(options, clip);
var w:Number = wh[0];
var h:Number = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
var bar:MovieClip = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
var bar_color:Number = options.color;
delete options.color;
var bar_background:Number = options.background;
delete options.background;
var bar_outline:Number = options.outline;
delete options.outline;
var backing_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 1);
var backing:Object = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
var inside_mc:MovieClip = createEmptyMovieClip(bar, "_inside", 2);
var inside:Object = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
var outline_mc:MovieClip = createEmptyMovieClip(bar, "_outline", 3);
var outline:Object = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
var f:Function = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
var _local1:Object = this.parent.parent.root;
var _local2:Object = this.parent._mochiad_ctr;
var _local3:Number = (getTimer() - this.started);
var _local4:Boolean;
var _local5:Number = _local1.loaderInfo.bytesTotal;
var _local6:Number = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
var _local7:Number = ((100 * _local6) / _local5);
var _local8:Number = ((100 * _local3) / chk.ad_msec);
var _local9:Object = this._mochiad_bar._inside;
var _local10:Number = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var mc = _arg1;
var f:Function = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 158
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 159
//Preloader (Preloader)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public dynamic class Preloader extends MovieClip {
private var loadText:TextField;
public static const STAGE_HEIGHT:int = 500;
public static const STAGE_WIDTH:int = 675;
public function Preloader(){
stage.stageWidth = STAGE_WIDTH;
stage.stageHeight = STAGE_HEIGHT;
stage.scaleMode = StageScaleMode.NO_SCALE;
MochiAd.showPreGameAd({clip:root, id:"4ea7c0225428fd30", res:"675x500", ad_started:adStarted, ad_finished:init, no_bg:true, color:0, outline:0, background:0xFFFFFF});
}
private function init():void{
addEventListener(Event.ENTER_FRAME, checkFrame);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, checkProgress);
loadText = new TextField();
loadText.textColor = 0;
loadText.text = "Loading...";
loadText.y = (STAGE_HEIGHT / 2);
loadText.x = ((STAGE_WIDTH - loadText.width) / 2);
this.addChild(loadText);
}
private function checkProgress(_arg1:ProgressEvent):void{
loadText.text = (("Loading... " + int(((_arg1.bytesLoaded / _arg1.bytesTotal) * 100))) + "%");
}
private function checkFrame(_arg1:Event):void{
if (currentFrame == totalFrames){
removeEventListener(Event.ENTER_FRAME, checkFrame);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, checkProgress);
startup();
};
}
private function startup():void{
this.removeChild(loadText);
loadText = null;
stop();
var _local1:Class = (getDefinitionByName("Main") as Class);
addChild((new (_local1) as DisplayObject));
}
public function adStarted():void{
}
}
}//package