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 flash.display.*;
import flash.utils.*;
import com.kongregate.as3.client.services.*;
import flash.system.*;
import com.kongregate.as3.client.events.*;
import flash.net.*;
import flash.errors.*;
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
//DeployConstants (com.zipzapplay.config.DeployConstants)
package com.zipzapplay.config {
public class DeployConstants {
public static const S3_GAMEASSETS_DIR:String = "gameAssets/";
public static const S3_GAMEPIECES_DIR:String = "gamePieces/";
public static const SITE_TITLE:String = "PlayCrafter: Create flash games using a free online game maker";
public static const LOCAL:Boolean = false;
public static const FEATURED_GAMES_URL:String = "http://playcrafter.s3.amazonaws.com/production/pub/welcomeGamesConfig.xml";
public static const S3_URL:String = "http://playcrafter.s3.amazonaws.com/production/V3/";
public static const REAL_STANDALONE_PLAYER_URL:String = "http://playcrafter.s3.amazonaws.com/production/standalone/StandAlonePlayer.swf";
public static const IMAGE_UPLOAD_URL:String = "http://%SERVER_ADDRESS%:88/upload/upload.php";
public static const S3_GAMES_DIR:String = "games/";
public static const S3_USER_DIR:String = "user/";
public static const IMAGE_DOWNLOAD_URL:String = "http://%SERVER_ADDRESS%:88/upload/images";
public static const WEBFRAMEWORK_PATH:String = "production/client/WebFrameWork.swf";
public static const MAIN_SITE_URL:String = "http://www.playcrafter.com/";
public static const S3_GAMESCREENSHOT_DIR:String = "gameScreens/";
public static const RELEASE:Boolean = true;
public static const SWEAR_URL:String = "http://playcrafter.s3.amazonaws.com/production/pub/badwords.txt";
public static const STANDALONE_PLAYER_URL:String = "http://playcrafter.s3.amazonaws.com/production/standalone/EmbeddableLoader.swf";
public static const WEBFRAMEWORK_LOCK_URI:String = "http://playcrafter.s3.amazonaws.com/production/client/";
public static const DEPLOY_DESTINATION:String = "production";
public static const LB_REQUEST_URI:String = "http://www.playcrafter.com/loadBalance/getAvailableServers.php";
public static const OLD_USER_METRICS_ID:int = 108000;
public static const DEBUG:Boolean = false;
public static const LOAD_MODULE_URL:String = "http://playcrafter.s3.amazonaws.com/production/client/";
}
}//package com.zipzapplay.config
Section 14
//GameWonEvent (com.zipzapplay.events.GameWonEvent)
package com.zipzapplay.events {
import flash.events.*;
public class GameWonEvent extends Event {
public static const GAME_WON_EVENT:String = "zzpGameWon";
public function GameWonEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
override public function toString():String{
return (formatToString("GameWonEvent", "type", "bubbles", "cancelable", "eventPhase"));
}
override public function clone():Event{
trace("GameWonEvent inside clone.");
return (new GameWonEvent(type, bubbles, cancelable));
}
}
}//package com.zipzapplay.events
Section 15
//LevelCompletedEvent (com.zipzapplay.events.LevelCompletedEvent)
package com.zipzapplay.events {
import flash.events.*;
public class LevelCompletedEvent extends Event {
public var levelCompleted:int;
public static const LEVEL_COMPLETED_EVENT:String = "zzpLevelCompleted";
public function LevelCompletedEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:int=0){
super(_arg1, _arg2, _arg3);
levelCompleted = _arg4;
}
override public function toString():String{
return (formatToString("LevelCompletedEvent", "type", "bubbles", "cancelable", "eventPhase", "levelCompleted"));
}
override public function clone():Event{
trace("LevelCompletedEvent inside clone.");
return (new LevelCompletedEvent(type, bubbles, cancelable, levelCompleted));
}
}
}//package com.zipzapplay.events
Section 16
//StandAloneEvent (com.zipzapplay.events.StandAloneEvent)
package com.zipzapplay.events {
import flash.events.*;
public class StandAloneEvent extends Event {
public static const AD_SHOWN:String = "zzpAdShown";
public static const HIDE_SHARE_BUTTON:String = "zzpHideShareButton";
public function StandAloneEvent(_arg1:String){
super(_arg1);
}
}
}//package com.zipzapplay.events
Section 17
//TopScoreEvent (com.zipzapplay.events.TopScoreEvent)
package com.zipzapplay.events {
import flash.events.*;
public class TopScoreEvent extends Event {
public var points:int;
public var strokes:int;
public var sortBy:int;
public var time:int;
public static const REPORT_SCORE:String = "zzpReportTopScore";
public function TopScoreEvent(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
super(REPORT_SCORE, false, false);
this.points = _arg1;
this.time = _arg2;
this.strokes = _arg3;
this.sortBy = _arg4;
}
override public function clone():Event{
trace("TopScoreEvent inside clone.");
return (new TopScoreEvent(points, time, strokes, sortBy));
}
override public function toString():String{
return (formatToString("TopScoreEvent", "type", "bubbles", "cancelable", "eventPhase", "points", "time", "strokes", "sortBy"));
}
}
}//package com.zipzapplay.events
Section 18
//AwardType (com.zipzapplay.network.AwardType)
package com.zipzapplay.network {
public class AwardType {
public static const POINTS:int = 1;
public static const STROKE:int = 0;
public static const TIME:int = 2;
}
}//package com.zipzapplay.network
Section 19
//ExportVars (generated.ExportVars)
package generated {
public class ExportVars {
public static const mochiBotID:String = "dd83bb04";
public static const mochiAdsID:String = "";
public static const gameID:String = "21975";
}
}//package generated
Section 20
//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 21
//ByteArrayAsset (mx.core.ByteArrayAsset)
package mx.core {
import flash.utils.*;
public class ByteArrayAsset extends ByteArray implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 22
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 23
//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 24
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 25
//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 26
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 27
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 28
//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 29
//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 30
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
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;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 31
//MovieClipLoaderAsset (mx.core.MovieClipLoaderAsset)
package mx.core {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.system.*;
public class MovieClipLoaderAsset extends MovieClipAsset implements IFlexAsset, IFlexDisplayObject {
protected var initialHeight:Number;// = 0
private var loader:Loader;// = null
private var initialized:Boolean;// = false
protected var initialWidth:Number;// = 0
private var requestedHeight:Number;
private var requestedWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipLoaderAsset(){
var _local1:LoaderContext = new LoaderContext();
_local1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
if (("allowLoadBytesCodeExecution" in _local1)){
_local1["allowLoadBytesCodeExecution"] = true;
};
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
loader.loadBytes(movieClipData, _local1);
addChild(loader);
}
override public function get width():Number{
if (!initialized){
return (initialWidth);
};
return (super.width);
}
override public function set width(_arg1:Number):void{
if (!initialized){
requestedWidth = _arg1;
} else {
loader.width = _arg1;
};
}
override public function get measuredHeight():Number{
return (initialHeight);
}
private function completeHandler(_arg1:Event):void{
initialized = true;
initialWidth = loader.width;
initialHeight = loader.height;
if (!isNaN(requestedWidth)){
loader.width = requestedWidth;
};
if (!isNaN(requestedHeight)){
loader.height = requestedHeight;
};
dispatchEvent(_arg1);
}
override public function set height(_arg1:Number):void{
if (!initialized){
requestedHeight = _arg1;
} else {
loader.height = _arg1;
};
}
override public function get measuredWidth():Number{
return (initialWidth);
}
override public function get height():Number{
if (!initialized){
return (initialHeight);
};
return (super.height);
}
public function get movieClipData():ByteArray{
return (null);
}
}
}//package mx.core
Section 32
//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 33
//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 34
//EasyText (EasyText)
package {
import flash.text.*;
public class EasyText extends TextField {
public function EasyText(_arg1:String, _arg2:Number, _arg3:uint){
var _local4:TextFormat = new TextFormat("CgWesterveldt Light Adj", _arg2, _arg3);
_local4.align = TextFormatAlign.CENTER;
this.embedFonts = true;
this.autoSize = TextFieldAutoSize.CENTER;
this.defaultTextFormat = _local4;
this.text = _arg1;
}
}
}//package
Section 35
//EmbeddableLoader (EmbeddableLoader)
package {
import flash.display.*;
import generated.*;
import flash.text.*;
import com.zipzapplay.config.*;
public class EmbeddableLoader extends Sprite {
private var _gameLoader:StandAloneLoader;
private var _loaderCover:LoaderCover;
private var _shareButtonFreeURIs:Array;
private var _playing:Boolean;// = false
private var topScoreForwarder:TopScoreForwarder;// = null
private var _lockToURIs:Array;
private var _adFreeURIs:Array;
private var _loaderURL:String;
private static const I_EXIST_ONLY_TO_EMBED_A_FONT:String = "EmbeddableLoader_I_EXIST_ONLY_TO_EMBED_A_FONT";
private static const WIDTH:Number = 558;
private static const HEIGHT:Number = 430;
private static var _debugText:String = "";
private static var _debugWindow:TextField;
public function EmbeddableLoader(){
var _local2:String;
var _local3:LoaderWithAd;
_adFreeURIs = ["file:///home/hersh/code/embeddableLoader/bin/NoAd.swf", "http://playcrafter.s3.amazonaws.com/staging/standalone/NoAd.swf", "kongregate.com", "flashgamelicense.com"];
_shareButtonFreeURIs = ["kongregate.com", "playcrafter.s3.amazonaws.com/staging/", "flashgamelicense.com"];
_lockToURIs = [];
super();
_loaderURL = root.loaderInfo.url;
if (shouldLock()){
return;
};
_gameLoader = new StandAloneLoader();
_gameLoader.y = -10000;
addChild(_gameLoader);
topScoreForwarder = new TopScoreForwarder(this, _gameLoader, LoaderInfo(root.loaderInfo));
if (shouldShowAd()){
_local3 = new LoaderWithAd();
addChild(_local3);
_local3.showAd();
_loaderCover = _local3;
_gameLoader.adShown = true;
} else {
_loaderCover = new LoaderWithoutAd();
addChild(_loaderCover);
};
_loaderCover.playGameCallback = playGame;
_gameLoader.progressFunction = _loaderCover.setProgress;
var _local1:Object = getURLParams();
if (ExportVars.gameID == ""){
_local2 = _local1["gameID"];
} else {
_local2 = ExportVars.gameID;
};
if (((!((_local2 == null))) && (!((_local2 == ""))))){
_gameLoader.loadGame(Number(_local2), shouldShowShare());
notifyMochiBot();
};
}
private function shouldShowAd():Boolean{
var _local1:String;
if (ExportVars.mochiAdsID == ""){
return (false);
};
for each (_local1 in _adFreeURIs) {
if (((!((_loaderURL == null))) && (!((_loaderURL.indexOf(_local1) == -1))))){
return (false);
};
};
return (true);
}
private function setupDebug():void{
_debugWindow = new TextField();
_debugWindow.width = 500;
_debugWindow.height = 400;
_debugWindow.text = _debugText;
_debugWindow.mouseEnabled = false;
addChild(_debugWindow);
}
private function playGame():void{
if (!_playing){
_playing = true;
_gameLoader.y = 0;
removeChild(_loaderCover);
stage.frameRate = 99;
};
}
private function stringToObject(_arg1:String):Object{
var _local4:String;
var _local5:Array;
var _local2:Object = new Object();
var _local3:Array = _arg1.split("&");
for each (_local4 in _local3) {
_local5 = _local4.split("=");
if (_local5.length == 2){
_local2[_local5[0]] = _local5[1];
};
};
return (_local2);
}
private function shouldLock():Boolean{
var _local1:String;
if (_lockToURIs.length == 0){
return (false);
};
for each (_local1 in _lockToURIs) {
if (((!((_loaderURL == null))) && (!((_loaderURL.indexOf(_local1) == -1))))){
return (false);
};
};
return (true);
}
private function notifyMochiBot():void{
if ((((DeployConstants.LOCAL == false)) && (!((ExportVars.mochiBotID == ""))))){
MochiBot.track(this, ExportVars.mochiBotID);
};
}
private function shouldShowShare():Boolean{
var _local1:String;
for each (_local1 in _shareButtonFreeURIs) {
if (((!((_loaderURL == null))) && (!((_loaderURL.indexOf(_local1) == -1))))){
return (false);
};
};
return (true);
}
private function getURLParams():Object{
var _local1:int;
if (_loaderURL != null){
_local1 = _loaderURL.indexOf("?");
if (_local1 != -1){
return (stringToObject(_loaderURL.substr((_local1 + 1))));
};
return (new Object());
} else {
};
return (!NULL!);
}
public static function debugWrite(_arg1:String):void{
if (_debugWindow != null){
_debugWindow.appendText((_arg1 + "\n"));
} else {
_debugText = (_debugText + (_arg1 + "\n"));
};
}
}
}//package
Section 36
//EmbeddableLoader_I_EXIST_ONLY_TO_EMBED_A_FONT (EmbeddableLoader_I_EXIST_ONLY_TO_EMBED_A_FONT)
package {
import mx.core.*;
public class EmbeddableLoader_I_EXIST_ONLY_TO_EMBED_A_FONT extends FontAsset {
}
}//package
Section 37
//LoaderCover (LoaderCover)
package {
import flash.display.*;
public class LoaderCover extends Sprite {
public var playGameCallback:Function;
public function setProgress(_arg1:Number):void{
}
}
}//package
Section 38
//LoaderWithAd (LoaderWithAd)
package {
import flash.events.*;
import flash.display.*;
import generated.*;
import com.zipzapplay.config.*;
import flash.net.*;
public class LoaderWithAd extends LoaderCover {
private var _loadingIndicator:LoadingIndicator;
private var _mochiAdArgs:Object;
private var _adHolder:MovieClip;
private static const SignPost:Class = LoaderWithAd_SignPost;
private static const Background:Class = LoaderWithAd_Background;
public function LoaderWithAd(){
var _local1:DisplayObject = new Background();
Bitmap(_local1).smoothing = true;
addChild(_local1);
this.addEventListener(MouseEvent.CLICK, goToMainSite);
_local1.addEventListener(MouseEvent.CLICK, goToMainSite);
var _local2:DisplayObject = new SignPost();
_local2.x = 15;
_local2.y = 170;
addChild(_local2);
_local2.addEventListener(MouseEvent.CLICK, goToMainSite);
_loadingIndicator = new LoadingIndicator(0xFFFFFF);
_loadingIndicator.x = 50;
_loadingIndicator.y = 95;
addChild(_loadingIndicator);
var _local3 = 300;
var _local4 = 250;
_adHolder = new MovieClip();
_adHolder.x = 247;
_adHolder.y = 80;
addChild(_adHolder);
_mochiAdArgs = {clip:_adHolder, id:ExportVars.mochiAdsID, res:((("" + _local3) + "x") + _local4)};
var _local5:Number = 14;
var _local6:EasyText = new EasyText("sponsored by:", _local5, 0xFFFFFF);
addChild(_local6);
_local6.x = ((_adHolder.x + (_local3 / 2)) - (_local6.textWidth / 2));
_local6.y = ((_adHolder.y - _local6.textHeight) - 7);
var _local7:EasyText = new EasyText("PlayCrafter shares ad revenue with creators", _local5, 2583642);
addChild(_local7);
_local7.x = ((_adHolder.x + (_local3 / 2)) - (_local7.textWidth / 2));
_local7.y = ((_adHolder.y + _local4) + 2);
}
public function showAd():void{
MochiAd.showClickAwayAd(_mochiAdArgs);
}
private function showPlayButton():void{
var _local1:PlayButton = new PlayButton();
addChild(_local1);
_local1.x = 30;
_local1.y = 90;
_local1.addEventListener(MouseEvent.CLICK, playClicked);
}
private function playClicked(_arg1:Event):void{
if (playGameCallback != null){
trace("LoaderWithAd PlayClicked");
_arg1.stopPropagation();
playGameCallback();
};
}
private function goToMainSite(_arg1:Event=null):void{
trace("LoaderWithAd goToMainSite");
navigateToURL(new URLRequest(DeployConstants.MAIN_SITE_URL));
}
override public function setProgress(_arg1:Number):void{
if (_arg1 >= 100){
showPlayButton();
};
_loadingIndicator.setProgress(_arg1);
}
}
}//package
Section 39
//LoaderWithAd_Background (LoaderWithAd_Background)
package {
import mx.core.*;
public class LoaderWithAd_Background extends BitmapAsset {
}
}//package
Section 40
//LoaderWithAd_SignPost (LoaderWithAd_SignPost)
package {
import mx.core.*;
import flash.utils.*;
public class LoaderWithAd_SignPost extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function LoaderWithAd_SignPost(){
dataClass = LoaderWithAd_SignPost_dataClass;
super();
initialWidth = (4400 / 20);
initialHeight = (5180 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 41
//LoaderWithAd_SignPost_dataClass (LoaderWithAd_SignPost_dataClass)
package {
import mx.core.*;
public class LoaderWithAd_SignPost_dataClass extends ByteArrayAsset {
}
}//package
Section 42
//LoaderWithoutAd (LoaderWithoutAd)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import com.zipzapplay.config.*;
import flash.net.*;
public class LoaderWithoutAd extends LoaderCover {
private var _loadingIndicator:LoadingIndicator;
private static const SignPost:Class = LoaderWithoutAd_SignPost;
private static const Background:Class = LoaderWithoutAd_Background;
public function LoaderWithoutAd(){
var _local1:DisplayObject = new Background();
Bitmap(_local1).smoothing = true;
addChild(_local1);
this.addEventListener(MouseEvent.CLICK, goToMainSite);
_local1.addEventListener(MouseEvent.CLICK, goToMainSite);
var _local2:DisplayObject = new SignPost();
_local2.x = 127;
_local2.y = 130;
_local2.scaleX = 1.4;
_local2.scaleY = 1.4;
addChild(_local2);
_local2.addEventListener(MouseEvent.CLICK, goToMainSite);
_loadingIndicator = new LoadingIndicator(12644607);
_loadingIndicator.x = 190;
_loadingIndicator.y = 40;
_loadingIndicator.scaleX = 1.2;
_loadingIndicator.scaleY = 1.2;
addChild(_loadingIndicator);
scrollRect = new Rectangle(0, 0, 558, 430);
}
private function goToMainSite(_arg1:Event=null):void{
navigateToURL(new URLRequest(DeployConstants.MAIN_SITE_URL));
}
override public function setProgress(_arg1:Number):void{
if ((((_arg1 >= 100)) && (!((playGameCallback == null))))){
playGameCallback();
};
_loadingIndicator.setProgress(_arg1);
}
}
}//package
Section 43
//LoaderWithoutAd_Background (LoaderWithoutAd_Background)
package {
import mx.core.*;
public class LoaderWithoutAd_Background extends BitmapAsset {
}
}//package
Section 44
//LoaderWithoutAd_SignPost (LoaderWithoutAd_SignPost)
package {
import mx.core.*;
import flash.utils.*;
public class LoaderWithoutAd_SignPost extends MovieClipLoaderAsset {
public var dataClass:Class;
private static var bytes:ByteArray = null;
public function LoaderWithoutAd_SignPost(){
dataClass = LoaderWithoutAd_SignPost_dataClass;
super();
initialWidth = (4400 / 20);
initialHeight = (5180 / 20);
}
override public function get movieClipData():ByteArray{
if (bytes == null){
bytes = ByteArray(new dataClass());
};
return (bytes);
}
}
}//package
Section 45
//LoaderWithoutAd_SignPost_dataClass (LoaderWithoutAd_SignPost_dataClass)
package {
import mx.core.*;
public class LoaderWithoutAd_SignPost_dataClass extends ByteArrayAsset {
}
}//package
Section 46
//LoadingIndicator (LoadingIndicator)
package {
import flash.display.*;
public class LoadingIndicator extends Sprite {
private var _bar:RoundedProgressBar;
private var _label:EasyText;
public function LoadingIndicator(_arg1:uint){
_label = new EasyText("Game Loading...", 25, 0xFFFFFF);
_label.x = 5;
addChild(_label);
_bar = new RoundedProgressBar((_label.width + 10), _arg1);
_bar.x = 0;
_bar.y = (_label.height + 5);
addChild(_bar);
}
public function setProgress(_arg1:Number):void{
_bar.setProgress(_arg1);
}
}
}//package
Section 47
//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.5");
}
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 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();
setTimeout(options.ad_finished, 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 48
//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("core.mochibot.com");
Security.allowInsecureDomain("core.mochibot.com");
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 49
//PlayButton (PlayButton)
package {
import flash.events.*;
import flash.display.*;
import flash.filters.*;
public class PlayButton extends Sprite {
private const _TOP_PAD:Number = 10;
private const _RIGHT_PAD:Number = 20;
private const _LEFT_PAD:Number = 20;
private const _BOTTOM_PAD:Number = 10;
private var _border:Array;
private var _colors:Object;
private var _label:EasyText;
public function PlayButton(){
_colors = {up:{border:13925397, fill:0xFFFFFF}, over:{border:32615, fill:13434870}, down:{border:0xFFFFFF, fill:7058342}};
_border = [[0.5, 0], [70, 3], [99, 0], [98, 70], [100, 100], [40, 98], [0, 99], [1, 60]];
super();
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
addEventListener(MouseEvent.ROLL_OUT, onRollOut);
addEventListener(MouseEvent.ROLL_OVER, onRollOver);
_label = new EasyText("Play Game", 40, _colors.up.border);
addChild(_label);
_label.x = _LEFT_PAD;
_label.y = _TOP_PAD;
draw(_colors.up);
this.filters = [new DropShadowFilter(0, 0, 0, 0.15, 10, 10)];
}
private function strokeBox():void{
var _local4:Array;
var _local1:Number = (((_LEFT_PAD + _label.width) + _RIGHT_PAD) / 100);
var _local2:Number = (((_TOP_PAD + _label.height) + _BOTTOM_PAD) / 100);
var _local3:Array = _border[(_border.length - 1)];
graphics.moveTo((_local3[0] * _local1), (_local3[1] * _local2));
for each (_local4 in _border) {
graphics.lineTo((_local4[0] * _local1), (_local4[1] * _local2));
};
}
private function onMouseUp(_arg1:MouseEvent):void{
draw(_colors.up);
}
private function draw(_arg1:Object):void{
_label.textColor = _arg1.border;
graphics.clear();
graphics.beginFill(_arg1.fill);
strokeBox();
graphics.endFill();
graphics.lineStyle(2, _arg1.border);
strokeBox();
}
private function onMouseDown(_arg1:MouseEvent):void{
draw(_colors.down);
}
private function onRollOver(_arg1:MouseEvent):void{
draw(_colors.over);
}
private function onRollOut(_arg1:MouseEvent):void{
draw(_colors.up);
}
}
}//package
Section 50
//RoundedProgressBar (RoundedProgressBar)
package {
import flash.display.*;
import flash.filters.*;
public class RoundedProgressBar extends Sprite {
private var _totalWidth:Number;// = 100
private var _height:Number;// = 7
private var _borderThickness:Number;// = 1.4
private var _scaledBar:Sprite;
public function RoundedProgressBar(_arg1:Number, _arg2:uint){
_scaledBar = new Sprite();
_scaledBar.graphics.beginFill(0xFFFFFF);
_scaledBar.graphics.drawRect(0, 0, 1, 1);
_scaledBar.scaleY = _height;
_scaledBar.x = (_height / 2);
addChild(_scaledBar);
_totalWidth = _arg1;
graphics.beginFill(0xFFFFFF);
graphics.drawRoundRectComplex(0, 0, (_height / 2), _height, (_height / 2), 0, (_height / 2), 0);
graphics.endFill();
var _local3:Sprite = new Sprite();
_local3.graphics.lineStyle(_borderThickness, _arg2, 1, true);
_local3.graphics.drawRoundRect(0, 0, _totalWidth, _height, _height);
addChild(_local3);
setProgress(0);
this.filters = [new GlowFilter(0xFFFFFF, 0.3)];
}
public function setProgress(_arg1:Number):void{
_scaledBar.scaleX = ((_arg1 / 100) * (_totalWidth - _height));
}
}
}//package
Section 51
//StandAloneLoader (StandAloneLoader)
package {
import flash.events.*;
import flash.display.*;
import com.zipzapplay.config.*;
import com.zipzapplay.events.*;
import flash.system.*;
import flash.net.*;
public class StandAloneLoader extends Loader {
public var shouldShowShareButton:Boolean;
public var progressFunction:Function;
public var adShown:Boolean;// = false
public var buttonShown:Boolean;// = true
private function serverFromURL(_arg1:String):String{
var _local2:Array = _arg1.split("/");
return (_local2[2]);
}
public function onSWFProgress(_arg1:ProgressEvent):void{
if (progressFunction != null){
progressFunction(((50 * _arg1.bytesLoaded) / _arg1.bytesTotal));
};
}
public function onLoadingComplete(_arg1:Event):void{
if (progressFunction != null){
progressFunction(50);
};
}
public function loadGame(_arg1:int, _arg2:Boolean):void{
var _local3:String = serverFromURL(DeployConstants.REAL_STANDALONE_PLAYER_URL);
Security.allowDomain(_local3);
Security.allowInsecureDomain(_local3);
shouldShowShareButton = _arg2;
var _local4:String = ((DeployConstants.REAL_STANDALONE_PLAYER_URL + "?gameID=") + _arg1);
EmbeddableLoader.debugWrite(("loading " + _local4));
this.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onSWFProgress);
this.contentLoaderInfo.sharedEvents.addEventListener(ProgressEvent.PROGRESS, onAssetProgress);
this.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadingComplete);
this.name = "ZZPMiniLoader2";
this.load(new URLRequest(_local4));
}
public function onAssetProgress(_arg1:ProgressEvent):void{
if (((!(shouldShowShareButton)) && (buttonShown))){
buttonShown = false;
trace("Hiding share button.");
this.contentLoaderInfo.sharedEvents.dispatchEvent(new StandAloneEvent(StandAloneEvent.HIDE_SHARE_BUTTON));
};
if (adShown){
adShown = false;
this.contentLoaderInfo.sharedEvents.dispatchEvent(new StandAloneEvent(StandAloneEvent.AD_SHOWN));
};
progressFunction((50 + ((50 * _arg1.bytesLoaded) / _arg1.bytesTotal)));
}
}
}//package
Section 52
//TopScoreForwarder (TopScoreForwarder)
package {
import flash.events.*;
import flash.display.*;
import com.kongregate.as3.client.*;
import com.zipzapplay.events.*;
import com.zipzapplay.network.*;
import flash.net.*;
public class TopScoreForwarder {
private var kongregate:KongregateAPI;
private var rootSprite:Sprite;
private var onKongregate:Boolean;
private var MindJoltAPI:Object;
private var onMindjolt:Boolean;
public function TopScoreForwarder(_arg1:Sprite, _arg2:Loader, _arg3:LoaderInfo){
trace("TopScoreForwarder constructor");
if ((((_arg2 == null)) || ((_arg3 == null)))){
trace("TopScoreForwarder loader/loaderInfo null");
return;
};
rootSprite = _arg1;
setupAPIs(_arg1, _arg3);
if (_arg2.contentLoaderInfo != null){
if (_arg2.contentLoaderInfo.sharedEvents != null){
_arg2.contentLoaderInfo.sharedEvents.addEventListener(TopScoreEvent.REPORT_SCORE, submitTopScore);
_arg2.contentLoaderInfo.sharedEvents.addEventListener(LevelCompletedEvent.LEVEL_COMPLETED_EVENT, submitLevelCompleted);
_arg2.contentLoaderInfo.sharedEvents.addEventListener(GameWonEvent.GAME_WON_EVENT, submitGameWon);
} else {
trace("TopScoreForwarder sharedEvents is null");
};
} else {
trace("TopScoreForwarder contentLoaderInfo is null");
};
}
public function submitGameWon(_arg1:Event):void{
trace("TopScoreForwarder submitGameWon called");
if (onKongregate){
kongregate.stats.submit("GameCompleted", 1);
};
}
public function submitTopScore(_arg1:Event):void{
var _local3:int;
var _local4:int;
trace("TopScoreForwarder submitTopScore called");
var _local2:Object = _arg1;
var _local5 = 50000;
switch (_local2.sortBy){
case AwardType.STROKE:
_local3 = _local2.stroke;
_local4 = (_local5 - _local2.stroke);
break;
case AwardType.TIME:
_local3 = _local2.time;
_local4 = (_local5 - _local2.time);
break;
case AwardType.POINTS:
default:
_local3 = _local2.points;
_local4 = _local2.points;
break;
};
trace(("TopScoreForwarder.as submitTopScore: " + _local3));
if (onKongregate){
kongregate.stats.submit("HighScore-Normal", _local3);
};
if (onMindjolt){
if (MindJoltAPI != null){
trace(("TopScoreForwarder.as submitting mindjolt score:" + _local4.toString()));
MindJoltAPI.service.submitScore(_local3);
};
};
}
private function mindjoltLoadFinished(_arg1:Event):void{
MindJoltAPI = _arg1.currentTarget.content;
MindJoltAPI.service.connect();
trace("[MindJoltAPI] service manually loaded");
}
private function setupAPIs(_arg1:Sprite, _arg2:LoaderInfo):void{
var _local4:Object;
var _local5:Loader;
onKongregate = false;
onMindjolt = false;
var _local3:String = _arg2.url;
if (_local3 != null){
if (_local3.indexOf("kongregate.com") != -1){
onKongregate = true;
};
if (_local3.indexOf("mindjolt") != -1){
onMindjolt = true;
};
};
if (onKongregate){
kongregate = new KongregateAPI();
if (_arg1 != null){
_arg1.addChild(kongregate);
} else {
trace("TopScoreForwarder container is null");
};
};
if (onMindjolt){
_local4 = _arg2.parameters;
_local5 = new Loader();
_local5.contentLoaderInfo.addEventListener(Event.COMPLETE, mindjoltLoadFinished);
_local5.load(new URLRequest(((_local4.mjPath) || ("http://static.mindjolt.com/api/as3/scoreapi_as3_local.swf"))));
_arg1.addChild(_local5);
};
}
public function submitLevelCompleted(_arg1:Event):void{
trace("TopScoreForwarder submitLevelCompleted called");
var _local2:Object = _arg1;
if (_local2.levelCompleted != null){
trace(("TopScoreForwarder.as submitLevelCompleted: " + _local2.levelCompleted));
if (onKongregate){
kongregate.stats.submit("LevelCompleted", _local2.levelCompleted);
};
};
}
}
}//package