Section 1
//CampaignInfo (com.google.analytics.campaign.CampaignInfo)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignInfo {
private var _new:Boolean;
private var _empty:Boolean;
public function CampaignInfo(_arg1:Boolean=true, _arg2:Boolean=false){
_empty = _arg1;
_new = _arg2;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function isNew():Boolean{
return (_new);
}
public function get utmcn():String{
return ("1");
}
public function isEmpty():Boolean{
return (_empty);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
_local1.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
_local1.utmcr = utmcr;
};
return (_local1);
}
public function get utmcr():String{
return ("1");
}
}
}//package com.google.analytics.campaign
Section 2
//CampaignKey (com.google.analytics.campaign.CampaignKey)
package com.google.analytics.campaign {
public class CampaignKey {
public var UCMD:String;// = "utm_medium"
public var UCID:String;// = "utm_id"
public var UCTR:String;// = "utm_term"
public var UCSR:String;// = "utm_source"
public var UCNO:String;// = "utm_nooverride"
public var UCCN:String;// = "utm_campaign"
public var UGCLID:String;// = "gclid"
public var UCCT:String;// = "utm_content"
}
}//package com.google.analytics.campaign
Section 3
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public class CampaignManager {
private var _config:Configuration;
private var _domainHash:Number;
private var _debug:DebugConfiguration;
private var _timeStamp:Number;
private var _referrer:String;
private var _buffer:Buffer;
public static const trackingDelimiter:String = "|";
public function CampaignManager(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Number, _arg5:String, _arg6:Number){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_domainHash = _arg4;
_referrer = _arg5;
_timeStamp = _arg6;
}
public function getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{
var _local4:CampaignTracker;
var _local8:CampaignTracker;
var _local9:int;
var _local3:CampaignInfo = new CampaignInfo();
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (_local3);
};
};
_local4 = getTrackerFromSearchString(_arg1);
if (isValid(_local4)){
_local6 = hasNoOverride(_arg1);
if (((_local6) && (!(_buffer.hasUTMZ())))){
return (_local3);
};
};
if (!isValid(_local4)){
_local4 = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(_local4)))){
return (_local3);
};
};
if (((!(isValid(_local4))) && (_arg2))){
_local4 = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(_local4)))){
return (_local3);
};
};
if (!isValid(_local4)){
if (((!(_buffer.hasUTMZ())) && (_arg2))){
_local4 = getDirectCampaign();
};
};
if (!isValid(_local4)){
return (_local3);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
_local8 = new CampaignTracker();
_local8.fromTrackerString(_buffer.utmz.campaignTracking);
_local5 = (_local8.toTrackerString() == _local4.toTrackerString());
_local7 = _buffer.utmz.responseCount;
};
if (((!(_local5)) || (_arg2))){
_local9 = _buffer.utma.sessionCount;
_local7++;
if (_local9 == 0){
_local9 = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = _local9;
_buffer.utmz.responseCount = _local7;
_buffer.utmz.campaignTracking = _local4.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
_local3 = new CampaignInfo(false, true);
} else {
_local3 = new CampaignInfo(false, false);
};
return (_local3);
}
public function hasNoOverride(_arg1:String):Boolean{
var _local2:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (false);
};
var _local3:Variables = new Variables(_arg1);
var _local4 = "";
if (_local3.hasOwnProperty(_local2.UCNO)){
_local4 = _local3[_local2.UCNO];
switch (_local4){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getTrackerFromSearchString(_arg1:String):CampaignTracker{
var _local2:CampaignTracker = getOrganicCampaign();
var _local3:CampaignTracker = new CampaignTracker();
var _local4:CampaignKey = _config.campaignKey;
if (_arg1 == ""){
return (_local3);
};
var _local5:Variables = new Variables(_arg1);
if (_local5.hasOwnProperty(_local4.UCID)){
_local3.id = _local5[_local4.UCID];
};
if (_local5.hasOwnProperty(_local4.UCSR)){
_local3.source = _local5[_local4.UCSR];
};
if (_local5.hasOwnProperty(_local4.UGCLID)){
_local3.clickId = _local5[_local4.UGCLID];
};
if (_local5.hasOwnProperty(_local4.UCCN)){
_local3.name = _local5[_local4.UCCN];
} else {
_local3.name = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCMD)){
_local3.medium = _local5[_local4.UCMD];
} else {
_local3.medium = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCTR)){
_local3.term = _local5[_local4.UCTR];
} else {
if (((_local2) && (!((_local2.term == ""))))){
_local3.term = _local2.term;
};
};
if (_local5.hasOwnProperty(_local4.UCCT)){
_local3.content = _local5[_local4.UCCT];
};
return (_local3);
}
public function getOrganicCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local4:Array;
var _local5:OrganicReferrer;
var _local6:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3 = "";
if (_local2.hostName != ""){
if (_local2.hostName.indexOf(".") > -1){
_local4 = _local2.hostName.split(".");
switch (_local4.length){
case 2:
_local3 = _local4[0];
break;
case 3:
_local3 = _local4[1];
break;
};
};
};
if (_config.organic.match(_local3)){
_local5 = _config.organic.getReferrerByName(_local3);
_local6 = _config.organic.getKeywordValue(_local5, _local2.search);
_local1 = new CampaignTracker();
_local1.source = _local5.engine;
_local1.name = "(organic)";
_local1.medium = "organic";
_local1.term = _local6;
};
return (_local1);
}
public function getDirectCampaign():CampaignTracker{
var _local1:CampaignTracker = new CampaignTracker();
_local1.source = "(direct)";
_local1.name = "(direct)";
_local1.medium = "(none)";
return (_local1);
}
public function isIgnoredKeyword(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(_arg1.term));
};
return (false);
}
public function isIgnoredReferral(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "referral")))){
return (_config.organic.isIgnoredReferral(_arg1.source));
};
return (false);
}
public function isValid(_arg1:CampaignTracker):Boolean{
if (((_arg1) && (_arg1.isValid()))){
return (true);
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var _local1:CampaignTracker;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
var _local2:URL = new URL(_referrer);
var _local3:String = _local2.hostName;
var _local4:String = _local2.path;
if (_local3.indexOf("www.") == 0){
_local3 = _local3.substr(4);
};
_local1 = new CampaignTracker();
_local1.source = _local3;
_local1.name = "(referral)";
_local1.medium = "referral";
_local1.content = _local4;
return (_local1);
}
public static function isInvalidReferrer(_arg1:String):Boolean{
var _local2:URL;
if ((((((_arg1 == "")) || ((_arg1 == "-")))) || ((_arg1 == "0")))){
return (true);
};
if (_arg1.indexOf("://") > -1){
_local2 = new URL(_arg1);
if ((((_local2.protocol == Protocols.file)) || ((_local2.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(_arg1:String, _arg2:Configuration):Boolean{
var _local3:URL = new URL(_arg1);
if (_local3.hostName.indexOf(_arg2.google) > -1){
if (_local3.search.indexOf((_arg2.googleSearchParam + "=")) > -1){
if (_local3.path == ("/" + _arg2.googleCsePath)){
return (true);
};
};
};
return (false);
}
}
}//package com.google.analytics.campaign
Section 4
//CampaignTracker (com.google.analytics.campaign.CampaignTracker)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignTracker {
public var content:String;
public var source:String;
public var clickId:String;
public var name:String;
public var term:String;
public var medium:String;
public var id:String;
public function CampaignTracker(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:String="", _arg5:String="", _arg6:String="", _arg7:String=""){
this.id = _arg1;
this.source = _arg2;
this.clickId = _arg3;
this.name = _arg4;
this.medium = _arg5;
this.term = _arg6;
this.content = _arg7;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var _local1:Array = [];
_addIfNotEmpty(_local1, "utmcsr=", source);
_addIfNotEmpty(_local1, "utmccn=", name);
_addIfNotEmpty(_local1, "utmcmd=", medium);
_addIfNotEmpty(_local1, "utmctr=", term);
_addIfNotEmpty(_local1, "utmcct=", content);
_addIfNotEmpty(_local1, "utmcid=", id);
_addIfNotEmpty(_local1, "utmgclid=", clickId);
return (_local1.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(_arg1:Array, _arg2:String, _arg3:String):void{
if (_arg3 != ""){
_arg3 = _arg3.split("+").join("%20");
_arg3 = _arg3.split(" ").join("%20");
_arg1.push((_arg2 + _arg3));
};
}
public function fromTrackerString(_arg1:String):void{
var _local2:String = _arg1.split(CampaignManager.trackingDelimiter).join("&");
var _local3:Variables = new Variables(_local2);
if (_local3.hasOwnProperty("utmcid")){
this.id = _local3["utmcid"];
};
if (_local3.hasOwnProperty("utmcsr")){
this.source = _local3["utmcsr"];
};
if (_local3.hasOwnProperty("utmccn")){
this.name = _local3["utmccn"];
};
if (_local3.hasOwnProperty("utmcmd")){
this.medium = _local3["utmcmd"];
};
if (_local3.hasOwnProperty("utmctr")){
this.term = _local3["utmctr"];
};
if (_local3.hasOwnProperty("utmcct")){
this.content = _local3["utmcct"];
};
if (_local3.hasOwnProperty("utmgclid")){
this.clickId = _local3["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 5
//GATrackerLibrary (com.google.analytics.components.GATrackerLibrary)
package com.google.analytics.components {
import com.google.analytics.utils.*;
import flash.display.*;
import com.google.analytics.*;
public class GATrackerLibrary extends MovieClip {
public static var version:Version = API.version;
}
}//package com.google.analytics.components
Section 6
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.utils.*;
import com.google.analytics.v4.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(_arg1:Configuration, _arg2:Environment){
_config = _arg1;
_info = _arg2;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmfl():String{
var _local1:Version;
if (_config.detectFlash){
_local1 = _info.flashVersion;
return (((((_local1.major + ".") + _local1.minor) + " r") + _local1.build));
};
return ("-");
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
_local1.utmcs = utmcs;
_local1.utmsr = utmsr;
_local1.utmsc = utmsc;
_local1.utmul = utmul;
_local1.utmje = utmje;
_local1.utmfl = utmfl;
return (_local1);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 7
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import com.google.analytics.data.*;
public dynamic class Buffer {
private var _SO:SharedObject;
private var _OBJ:Object;
private var _utma:UTMA;
private var _utmb:UTMB;
private var _utmc:UTMC;
private var _debug:DebugConfiguration;
private var _utmk:UTMK;
private var _config:Configuration;
private var _utmv:UTMV;
private var _utmz:UTMZ;
private var _volatile:Boolean;
public function Buffer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Boolean=false, _arg4:Object=null){
var _local5:Boolean;
var _local6:String;
super();
_config = _arg1;
_debug = _arg2;
UTMB.defaultTimespan = _config.sessionTimeout;
UTMZ.defaultTimespan = _config.conversionTimeout;
if (!_arg3){
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
_local5 = false;
if (_SO.data.utma){
if (!hasUTMA()){
_createUMTA();
};
_utma.fromSharedObject(_SO.data.utma);
if (_debug.verbose){
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek);
};
if (_utma.isExpired()){
if (_debug.verbose){
_debug.warning("UTMA has expired", VisualDebugMode.advanced);
};
_clearUTMA();
_local5 = true;
};
};
if (_SO.data.utmb){
if (!hasUTMB()){
_createUMTB();
};
_utmb.fromSharedObject(_SO.data.utmb);
if (_debug.verbose){
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek);
};
if (_utmb.isExpired()){
if (_debug.verbose){
_debug.warning("UTMB has expired", VisualDebugMode.advanced);
};
_clearUTMB();
_local5 = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
_local5 = true;
};
if (_SO.data.utmk){
if (!hasUTMK()){
_createUMTK();
};
_utmk.fromSharedObject(_SO.data.utmk);
if (_debug.verbose){
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek);
};
};
if (_SO.data.utmv){
if (!hasUTMV()){
_createUMTV();
};
_utmv.fromSharedObject(_SO.data.utmv);
if (_debug.verbose){
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek);
};
if (_utmv.isExpired()){
if (_debug.verbose){
_debug.warning("UTMV has expired", VisualDebugMode.advanced);
};
_clearUTMV();
_local5 = true;
};
};
if (_SO.data.utmz){
if (!hasUTMZ()){
_createUMTZ();
};
_utmz.fromSharedObject(_SO.data.utmz);
if (_debug.verbose){
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek);
};
if (_utmz.isExpired()){
if (_debug.verbose){
_debug.warning("UTMZ has expired", VisualDebugMode.advanced);
};
_clearUTMZ();
_local5 = true;
};
};
if (_local5){
save();
};
} else {
_OBJ = new Object();
if (_arg4){
for (_local6 in _arg4) {
_OBJ[_local6] = _arg4[_local6];
};
};
};
_volatile = _arg3;
}
public function clearCookies():void{
utma.reset();
utmb.reset();
utmc.reset();
utmz.reset();
utmv.reset();
utmk.reset();
}
public function save():void{
var flushStatus:String;
if (!isVolatile()){
flushStatus = null;
try {
flushStatus = _SO.flush();
} catch(e:Error) {
_debug.warning("Error...Could not write SharedObject to disk");
};
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_debug.info("Requesting permission to save object...");
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
_debug.info("Value flushed to disk.");
break;
};
};
}
public function get utmv():UTMV{
if (!hasUTMV()){
_createUMTV();
};
return (_utmv);
}
public function get utmz():UTMZ{
if (!hasUTMZ()){
_createUMTZ();
};
return (_utmz);
}
public function hasUTMA():Boolean{
if (_utma){
return (true);
};
return (false);
}
public function hasUTMB():Boolean{
if (_utmb){
return (true);
};
return (false);
}
public function hasUTMC():Boolean{
if (_utmc){
return (true);
};
return (false);
}
public function isGenuine():Boolean{
if (!hasUTMK()){
return (true);
};
return ((utmk.hash == generateCookiesHash()));
}
public function resetCurrentSession():void{
_clearUTMB();
_clearUTMC();
save();
}
public function hasUTMK():Boolean{
if (_utmk){
return (true);
};
return (false);
}
public function generateCookiesHash():Number{
var _local1 = "";
_local1 = (_local1 + utma.valueOf());
_local1 = (_local1 + utmb.valueOf());
_local1 = (_local1 + utmc.valueOf());
_local1 = (_local1 + utmz.valueOf());
_local1 = (_local1 + utmv.valueOf());
return (Utils.generateHash(_local1));
}
private function _createUMTB():void{
_utmb = new UTMB();
_utmb.proxy = this;
}
private function _createUMTC():void{
_utmc = new UTMC();
}
private function _createUMTA():void{
_utma = new UTMA();
_utma.proxy = this;
}
public function hasUTMV():Boolean{
if (_utmv){
return (true);
};
return (false);
}
private function _createUMTK():void{
_utmk = new UTMK();
_utmk.proxy = this;
}
public function hasUTMZ():Boolean{
if (_utmz){
return (true);
};
return (false);
}
private function _createUMTV():void{
_utmv = new UTMV();
_utmv.proxy = this;
}
private function _onFlushStatus(_arg1:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (_arg1.info.code){
case "SharedObject.Flush.Success":
_debug.info("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
_debug.info("User denied permission -- value not saved.");
break;
};
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
}
private function _createUMTZ():void{
_utmz = new UTMZ();
_utmz.proxy = this;
}
public function updateUTMA(_arg1:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + _arg1) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = _arg1;
};
}
private function _clearUTMA():void{
_utma = null;
if (!isVolatile()){
_SO.data.utma = null;
delete _SO.data.utma;
};
}
private function _clearUTMC():void{
_utmc = null;
}
private function _clearUTMB():void{
_utmb = null;
if (!isVolatile()){
_SO.data.utmb = null;
delete _SO.data.utmb;
};
}
public function update(_arg1:String, _arg2):void{
if (isVolatile()){
_OBJ[_arg1] = _arg2;
} else {
_SO.data[_arg1] = _arg2;
};
}
private function _clearUTMZ():void{
_utmz = null;
if (!isVolatile()){
_SO.data.utmz = null;
delete _SO.data.utmz;
};
}
private function _clearUTMV():void{
_utmv = null;
if (!isVolatile()){
_SO.data.utmv = null;
delete _SO.data.utmv;
};
}
public function isVolatile():Boolean{
return (_volatile);
}
public function get utma():UTMA{
if (!hasUTMA()){
_createUMTA();
};
return (_utma);
}
public function get utmb():UTMB{
if (!hasUTMB()){
_createUMTB();
};
return (_utmb);
}
public function get utmc():UTMC{
if (!hasUTMC()){
_createUMTC();
};
return (_utmc);
}
public function get utmk():UTMK{
if (!hasUTMK()){
_createUMTK();
};
return (_utmk);
}
}
}//package com.google.analytics.core
Section 8
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.utils.*;
import com.google.analytics.v4.*;
import com.google.analytics.external.*;
public class DocumentInfo {
private var _pageURL:String;
private var _utmr:String;
private var _config:Configuration;
private var _adSense:AdSenseGlobals;
private var _info:Environment;
public function DocumentInfo(_arg1:Configuration, _arg2:Environment, _arg3:String, _arg4:String=null, _arg5:AdSenseGlobals=null){
_config = _arg1;
_info = _arg2;
_utmr = _arg3;
_pageURL = _arg4;
_adSense = _arg5;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
private function _renderPageURL(_arg1:String=""):String{
var _local2:String = _info.locationPath;
var _local3:String = _info.locationSearch;
if (((!(_arg1)) || ((_arg1 == "")))){
_arg1 = (_local2 + unescape(_local3));
};
return (_arg1);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
public function get utmhid():String{
return (String(_generateHitId()));
}
private function _generateHitId():Number{
var _local1:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
_local1 = Number(_adSense.hid);
} else {
_local1 = Math.round((Math.random() * 2147483647));
_adSense.hid = String(_local1);
};
return (_local1);
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
_local1.utmdt = utmdt;
};
_local1.utmhid = utmhid;
_local1.utmr = utmr;
_local1.utmp = utmp;
return (_local1);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 9
//Domain (com.google.analytics.core.Domain)
package com.google.analytics.core {
import com.google.analytics.debug.*;
public class Domain {
private var _mode:DomainNameMode;
private var _debug:DebugConfiguration;
private var _name:String;
public function Domain(_arg1:DomainNameMode=null, _arg2:String="", _arg3:DebugConfiguration=null){
_debug = _arg3;
if (_arg1 == null){
_arg1 = DomainNameMode.auto;
};
_mode = _arg1;
if (_arg1 == DomainNameMode.custom){
this.name = _arg2;
} else {
_name = _arg2;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(_arg1:DomainNameMode):void{
_mode = _arg1;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(_arg1:String):void{
if (((!((_arg1.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + _arg1), VisualDebugMode.geek);
};
_name = _arg1;
}
}
}//package com.google.analytics.core
Section 10
//DomainNameMode (com.google.analytics.core.DomainNameMode)
package com.google.analytics.core {
public class DomainNameMode {
private var _value:int;
private var _name:String;
public static const custom:DomainNameMode = new DomainNameMode(2, "custom");
;
public static const none:DomainNameMode = new DomainNameMode(0, "none");
;
public static const auto:DomainNameMode = new DomainNameMode(1, "auto");
;
public function DomainNameMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 11
//EventInfo (com.google.analytics.core.EventInfo)
package com.google.analytics.core {
import com.google.analytics.utils.*;
import com.google.analytics.data.*;
public class EventInfo {
private var _ext10:X10;
private var _isEventHit:Boolean;
private var _x10:X10;
public function EventInfo(_arg1:Boolean, _arg2:X10, _arg3:X10=null){
_isEventHit = _arg1;
_x10 = _arg2;
_ext10 = _arg3;
}
public function toURLString():String{
var _local1:Variables = toVariables();
return (_local1.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var _local1:Variables = new Variables();
_local1.URIencode = true;
if (_isEventHit){
_local1.utmt = utmt;
};
_local1.utme = utme;
return (_local1);
}
}
}//package com.google.analytics.core
Section 12
//EventTracker (com.google.analytics.core.EventTracker)
package com.google.analytics.core {
import com.google.analytics.v4.*;
public class EventTracker {
private var _parent:GoogleAnalyticsAPI;
public var name:String;
public function EventTracker(_arg1:String, _arg2:GoogleAnalyticsAPI){
this.name = _arg1;
_parent = _arg2;
}
public function trackEvent(_arg1:String, _arg2:String=null, _arg3:Number=NaN):Boolean{
return (_parent.trackEvent(name, _arg1, _arg2, _arg3));
}
}
}//package com.google.analytics.core
Section 13
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 14
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import com.google.analytics.utils.*;
import flash.display.*;
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import flash.system.*;
public class GIFRequest {
private var _info:Environment;
private var _count:int;
private var _utmac:String;
private var _alertcount:int;
private var _debug:DebugConfiguration;
private var _lastRequest:URLRequest;
private var _buffer:Buffer;
private var _config:Configuration;
private var _requests:Array;
public function GIFRequest(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Environment){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_info = _arg4;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(_arg1:IOErrorEvent):void{
var _local2:String = _lastRequest.url;
var _local3:String = String((_requests.length - 1));
var _local4 = (("Gif Request #" + _local3) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local2.indexOf("?") > -1){
_local2 = _local2.split("?")[0];
};
_local2 = _shortenURL(_local2);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local4 = (_local4 + ((" \"" + _local2) + "\" does not exists or is unreachable"));
};
_debug.failure(_local4);
} else {
_debug.warning(_local4);
};
_removeListeners(_arg1.target);
}
public function send(_arg1:String, _arg2:Variables=null, _arg3:Boolean=false, _arg4:Boolean=false):void{
var _local5:String;
var _local6:URLRequest;
var _local7:URLRequest;
_utmac = _arg1;
if (!_arg2){
_arg2 = new Variables();
};
_arg2.URIencode = false;
_arg2.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
_arg2.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (_arg3))){
if (_arg4){
updateToken();
};
if (((((_arg3) || (!(_arg4)))) || ((_buffer.utmb.token >= 1)))){
if (((!(_arg3)) && (_arg4))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
_arg2.utmwv = utmwv;
_arg2.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
_arg2.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
_arg2.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
_local5 = _info.locationSWFPath;
if (_local5.lastIndexOf("/") > 0){
_local5 = _local5.substring(0, _local5.lastIndexOf("/"));
};
_local6 = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
_local6.url = _config.localGIFpath;
} else {
_local6.url = (_local5 + _config.localGIFpath);
};
_local6.url = (_local6.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local6);
} else {
sendRequest(_local6);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
_local7 = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
_local7.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
_local7.url = _config.remoteGIFpath;
} else {
_local7.url = _config.remoteGIFpath;
};
};
_arg2.utmac = utmac;
_arg2.utmcc = encodeURIComponent(utmcc);
_local7.url = (_local7.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local7);
} else {
sendRequest(_local7);
};
};
};
};
}
public function onSecurityError(_arg1:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(_arg1.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var _local1:Array = [];
if (_buffer.hasUTMA()){
_local1.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
_local1.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
_local1.push((_buffer.utmv.toURLString() + ";"));
};
return (_local1.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(_arg1:URLRequest):void{
var request = _arg1;
var loader:Loader = new Loader();
loader.name = String(_count++);
var context:LoaderContext = new LoaderContext(false);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_lastRequest = request;
_requests[loader.name] = new RequestObject(request);
try {
loader.load(request, context);
} catch(e:Error) {
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
};
}
private function _removeListeners(_arg1:Object):void{
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
_arg1.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var _local2:Number;
var _local1:Number = new Date().getTime();
_local2 = ((_local1 - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + _local2), VisualDebugMode.geek);
};
if (_local2 >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + _local2)), _config.bucketCapacity);
_buffer.utmb.lastTime = _local1;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(_arg1:String):String{
var _local2:Array;
if (_arg1.length > 60){
_local2 = _arg1.split("/");
while (_arg1.length > 60) {
_local2.shift();
_arg1 = ("../" + _local2.join("/"));
};
};
return (_arg1);
}
private function _debugSend(_arg1:URLRequest):void{
var _local3:String;
var _local2 = "";
switch (_debug.mode){
case VisualDebugMode.geek:
_local2 = ((("Gif Request #" + _alertcount) + ":\n") + _arg1.url);
break;
case VisualDebugMode.advanced:
_local3 = _arg1.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
_local2 = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
_local2 = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(_local2, _arg1, this);
_alertcount++;
}
public function onComplete(_arg1:Event):void{
var _local2:String = _arg1.target.loader.name;
_requests[_local2].complete();
var _local3 = (("Gif Request #" + _local2) + " sent");
var _local4:String = _requests[_local2].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local4.indexOf("?") > -1){
_local4 = _local4.split("?")[0];
};
_local4 = _shortenURL(_local4);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local3 = (_local3 + ((" to \"" + _local4) + "\""));
};
_debug.success(_local3);
} else {
_debug.info(_local3);
};
_removeListeners(_arg1.target);
}
}
}//package com.google.analytics.core
Section 15
//IdleTimer (com.google.analytics.core.IdleTimer)
package com.google.analytics.core {
import flash.display.*;
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.utils.*;
public class IdleTimer {
private var _stage:Stage;
private var _loop:Timer;
private var _lastMove:int;
private var _inactivity:Number;
private var _debug:DebugConfiguration;
private var _session:Timer;
private var _buffer:Buffer;
public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){
var _local5:Number = _arg1.idleLoop;
var _local6:Number = _arg1.idleTimeout;
var _local7:Number = _arg1.sessionTimeout;
_loop = new Timer((_local5 * 1000));
_session = new Timer((_local7 * 1000), 1);
_debug = _arg2;
_stage = _arg3.stage;
_buffer = _arg4;
_lastMove = getTimer();
_inactivity = (_local6 * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + _local5) + "sec , inactivity: ") + _local6) + "sec, sessionTimeout: ") + _local7), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(_arg1:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(_arg1:TimerEvent):void{
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_debug.info("session timer end session", VisualDebugMode.geek);
_session.reset();
_buffer.resetCurrentSession();
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
}
public function checkForIdle(_arg1:TimerEvent):void{
var _local2:int = getTimer();
if ((_local2 - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 16
//Organic (com.google.analytics.core.Organic)
package com.google.analytics.core {
import com.google.analytics.utils.*;
public class Organic {
private var _sourcesCache:Array;
private var _sourcesEngine:Array;
private var _ignoredKeywords:Array;
private var _ignoredReferralsCache:Object;
private var _ignoredReferrals:Array;
private var _ignoredKeywordsCache:Object;
private var _sources:Array;
public static var throwErrors:Boolean = false;
public function Organic(){
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function isIgnoredKeyword(_arg1:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{
var _local3:String = _arg1.keyword;
return (getKeywordValueFromPath(_local3, _arg2));
}
public function isIgnoredReferral(_arg1:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function clear():void{
clearEngines();
clearIgnoredReferrals();
clearIgnoredKeywords();
}
public function get count():int{
return (_sources.length);
}
public function get ignoredKeywordsCount():int{
return (_ignoredKeywords.length);
}
public function match(_arg1:String):Boolean{
if (_arg1 == ""){
return (false);
};
_arg1 = _arg1.toLowerCase();
if (_sourcesEngine[_arg1] != undefined){
return (true);
};
return (false);
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function addSource(_arg1:String, _arg2:String):void{
var _local3:OrganicReferrer = new OrganicReferrer(_arg1, _arg2);
if (_sourcesCache[_local3.toString()] == undefined){
_sources.push(_local3);
_sourcesCache[_local3.toString()] = (_sources.length - 1);
if (_sourcesEngine[_local3.engine] == undefined){
_sourcesEngine[_local3.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[_local3.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((_local3.toString() + " already exists, we don't add it.")));
};
};
}
public function clearEngines():void{
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
}
public function get ignoredReferralsCount():int{
return (_ignoredReferrals.length);
}
public function addIgnoredReferral(_arg1:String):void{
if (_ignoredReferralsCache[_arg1] == undefined){
_ignoredReferrals.push(_arg1);
_ignoredReferralsCache[_arg1] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(_arg1:String):OrganicReferrer{
var _local2:int;
if (match(_arg1)){
_local2 = _sourcesEngine[_arg1][0];
return (_sources[_local2]);
};
return (null);
}
public function addIgnoredKeyword(_arg1:String):void{
if (_ignoredKeywordsCache[_arg1] == undefined){
_ignoredKeywords.push(_arg1);
_ignoredKeywordsCache[_arg1] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Variables;
if (_arg2.indexOf((_arg1 + "=")) > -1){
if (_arg2.charAt(0) == "?"){
_arg2 = _arg2.substr(1);
};
_arg2 = _arg2.split("+").join("%20");
_local4 = new Variables(_arg2);
_local3 = _local4[_arg1];
};
return (_local3);
}
}
}//package com.google.analytics.core
Section 17
//OrganicReferrer (com.google.analytics.core.OrganicReferrer)
package com.google.analytics.core {
public class OrganicReferrer {
private var _engine:String;
private var _keyword:String;
public function OrganicReferrer(_arg1:String, _arg2:String){
this.engine = _arg1;
this.keyword = _arg2;
}
public function get keyword():String{
return (_keyword);
}
public function get engine():String{
return (_engine);
}
public function set engine(_arg1:String):void{
_engine = _arg1.toLowerCase();
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function set keyword(_arg1:String):void{
_keyword = _arg1.toLowerCase();
}
}
}//package com.google.analytics.core
Section 18
//RequestObject (com.google.analytics.core.RequestObject)
package com.google.analytics.core {
import flash.net.*;
import flash.utils.*;
public class RequestObject {
public var start:int;
public var end:int;
public var request:URLRequest;
public function RequestObject(_arg1:URLRequest){
start = getTimer();
this.request = _arg1;
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function toString():String{
var _local1:Array = [];
_local1.push((("duration: " + duration) + "ms"));
_local1.push(("url: " + request.url));
return ((("{ " + _local1.join(", ")) + " }"));
}
public function complete():void{
end = getTimer();
}
public function get duration():int{
if (!hasCompleted()){
return (0);
};
return ((end - start));
}
}
}//package com.google.analytics.core
Section 19
//ServerOperationMode (com.google.analytics.core.ServerOperationMode)
package com.google.analytics.core {
public class ServerOperationMode {
private var _value:int;
private var _name:String;
public static const both:ServerOperationMode = new ServerOperationMode(2, "both");
;
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote");
;
public static const local:ServerOperationMode = new ServerOperationMode(0, "local");
;
public function ServerOperationMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 20
//TrackerCache (com.google.analytics.core.TrackerCache)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import flash.errors.*;
public class TrackerCache implements GoogleAnalyticsAPI {
public var tracker:GoogleAnalyticsAPI;
private var _ar:Array;
public static var CACHE_THROW_ERROR:Boolean;
public function TrackerCache(_arg1:GoogleAnalyticsAPI=null){
this.tracker = _arg1;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var _local1:Object;
var _local2:String;
var _local3:Array;
var _local4:int;
var _local5:int;
if (tracker == null){
return;
};
if (size() > 0){
_local4 = _ar.length;
while (_local5 < _local4) {
_local1 = _ar.shift();
_local2 = (_local1.name as String);
_local3 = (_local1.args as Array);
if (((!((_local2 == null))) && ((_local2 in tracker)))){
(tracker[_local2] as Function).apply(tracker, _local3);
};
_local5++;
};
};
}
public function enqueue(_arg1:String, ... _args):Boolean{
if (_arg1 == null){
return (false);
};
_ar.push({name:_arg1, args:_args});
return (true);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
enqueue("link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
enqueue("addOrganic", _arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
enqueue("setAllowLinker", _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
enqueue("trackEvent", _arg1, _arg2, _arg3, _arg4);
return (true);
}
public function getClientInfo():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment."));
};
return (false);
}
public function trackTrans():void{
enqueue("trackTrans");
}
public function trackPageview(_arg1:String=""):void{
enqueue("trackPageview", _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
enqueue("setClientInfo", _arg1);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
enqueue("linkByPost", _arg1, _arg2);
}
public function setCookieTimeout(_arg1:int):void{
enqueue("setCookieTimeout", _arg1);
}
public function isEmpty():Boolean{
return ((_ar.length == 0));
}
public function getDetectTitle():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment."));
};
return (false);
}
public function resetSession():void{
enqueue("resetSession");
}
public function setDetectFlash(_arg1:Boolean):void{
enqueue("setDetectFlash", _arg1);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(_arg1:String):void{
enqueue("setCampNameKey", _arg1);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
enqueue("addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function createEventTracker(_arg1:String):EventTracker{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment."));
};
return (null);
}
public function setVar(_arg1:String):void{
enqueue("setVar", _arg1);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setDomainName(_arg1:String):void{
enqueue("setDomainName", _arg1);
}
public function setCampSourceKey(_arg1:String):void{
enqueue("setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment."));
};
return (null);
}
public function setCampContentKey(_arg1:String):void{
enqueue("setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
enqueue("setLocalServerMode");
}
public function getLocalGifPath():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment."));
};
return ("");
}
public function setAllowAnchor(_arg1:Boolean):void{
enqueue("setAllowAnchor", _arg1);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(_arg1:String):void{
enqueue("setLocalGifPath", _arg1);
}
public function getVersion():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment."));
};
return ("");
}
public function setCookiePath(_arg1:String):void{
enqueue("setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
enqueue("setSampleRate", _arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
enqueue("setDetectTitle", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
enqueue("setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
enqueue("addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
enqueue("setCampNOKey", _arg1);
}
public function getServiceMode():ServerOperationMode{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment."));
};
return (null);
}
public function setLocalRemoteServerMode():void{
enqueue("setLocalRemoteServerMode");
}
public function cookiePathCopy(_arg1:String):void{
enqueue("cookiePathCopy", _arg1);
}
public function getDetectFlash():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment."));
};
return (false);
}
public function setCampaignTrack(_arg1:Boolean):void{
enqueue("setCampaignTrack", _arg1);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
enqueue("setCampTermKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
enqueue("addIgnoredRef", _arg1);
}
public function setCampMediumKey(_arg1:String):void{
enqueue("setCampMediumKey", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
enqueue("setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
enqueue("setRemoteServerMode");
}
public function element(){
return (_ar[0]);
}
public function getAccount():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment."));
};
return ("");
}
}
}//package com.google.analytics.core
Section 21
//TrackerMode (com.google.analytics.core.TrackerMode)
package com.google.analytics.core {
public class TrackerMode {
public static const BRIDGE:String = "Bridge";
public static const AS3:String = "AS3";
}
}//package com.google.analytics.core
Section 22
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public static function trim(_arg1:String, _arg2:Boolean=false):String{
var _local5:int;
var _local6:int;
var _local7:int;
if (_arg1 == ""){
return ("");
};
var _local3:Array = [" ", "\n", "\r", "\t"];
var _local4:String = _arg1;
if (_arg2){
_local5 = 0;
while ((((_local5 < _local3.length)) && ((_local4.indexOf(_local3[_local5]) > -1)))) {
_local4 = _local4.split(_local3[_local5]).join("");
_local5++;
};
} else {
_local6 = 0;
while ((((_local6 < _local4.length)) && ((_local3.indexOf(_local4.charAt(_local6)) > -1)))) {
_local6++;
};
_local4 = _local4.substr(_local6);
_local7 = (_local4.length - 1);
while ((((_local7 >= 0)) && ((_local3.indexOf(_local4.charAt(_local7)) > -1)))) {
_local7--;
};
_local4 = _local4.substring(0, (_local7 + 1));
};
return (_local4);
}
public static function generateHash(_arg1:String):int{
var _local4:int;
var _local5:int;
var _local2 = 1;
var _local3:int;
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
_local2 = 0;
_local4 = (_arg1.length - 1);
while (_local4 >= 0) {
_local5 = _arg1.charCodeAt(_local4);
_local2 = ((((_local2 << 6) & 268435455) + _local5) + (_local5 << 14));
_local3 = (_local2 & 266338304);
if (_local3 != 0){
_local2 = (_local2 ^ (_local3 >> 21));
};
_local4--;
};
};
return (_local2);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(_arg1:String):Boolean{
var _local2:RegExp = /^UA-[0-9]*-[0-9]*$/;
return (_local2.test(_arg1));
}
}
}//package com.google.analytics.core
Section 23
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(_arg1:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(_arg1:Date):void;
function set expiration(_arg1:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 24
//UTMA (com.google.analytics.data.UTMA)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMA extends UTMCookie {
private var _sessionId:Number;
private var _domainHash:Number;
private var _firstTime:Number;
private var _currentTime:Number;
private var _lastTime:Number;
private var _sessionCount:Number;
public function UTMA(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.sessionId = _arg2;
this.firstTime = _arg3;
this.lastTime = _arg4;
this.currentTime = _arg5;
this.sessionCount = _arg6;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function set currentTime(_arg1:Number):void{
_currentTime = _arg1;
update();
}
public function get sessionId():Number{
return (_sessionId);
}
public function get sessionCount():Number{
return (_sessionCount);
}
public function get firstTime():Number{
return (_firstTime);
}
public function get currentTime():Number{
return (_currentTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set sessionId(_arg1:Number):void{
_sessionId = _arg1;
update();
}
public function set sessionCount(_arg1:Number):void{
_sessionCount = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(_arg1:Number):void{
_firstTime = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 25
//UTMB (com.google.analytics.data.UTMB)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMB extends UTMCookie {
private var _trackCount:Number;
private var _lastTime:Number;
private var _domainHash:Number;
private var _token:Number;
public static var defaultTimespan:Number = Timespan.thirtyminutes;
public function UTMB(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.trackCount = _arg2;
this.token = _arg3;
this.lastTime = _arg4;
}
public function set token(_arg1:Number):void{
_token = _arg1;
update();
}
public function set trackCount(_arg1:Number):void{
_trackCount = _arg1;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function get token():Number{
return (_token);
}
public function get trackCount():Number{
return (_trackCount);
}
}
}//package com.google.analytics.data
Section 26
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(_arg1:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = _arg1;
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 27
//UTMCookie (com.google.analytics.data.UTMCookie)
package com.google.analytics.data {
import com.google.analytics.core.*;
public class UTMCookie implements Cookie {
protected var inURL:String;
protected var name:String;
private var _creation:Date;
private var _expiration:Date;
public var proxy:Buffer;
protected var fields:Array;
private var _timespan:Number;
public function UTMCookie(_arg1:String, _arg2:String, _arg3:Array, _arg4:Number=0){
this.name = _arg1;
this.inURL = _arg2;
this.fields = _arg3;
_timestamp(_arg4);
}
public function isEmpty():Boolean{
var _local2:String;
var _local1:int;
var _local3:int;
while (_local3 < fields.length) {
_local2 = fields[_local3];
if ((((this[_local2] is Number)) && (isNaN(this[_local2])))){
_local1++;
} else {
if ((((this[_local2] is String)) && ((this[_local2] == "")))){
_local1++;
};
};
_local3++;
};
if (_local1 == fields.length){
return (true);
};
return (false);
}
public function resetTimestamp(_arg1:Number=NaN):void{
if (!isNaN(_arg1)){
_timespan = _arg1;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function reset():void{
var _local1:String;
var _local2:int;
while (_local2 < fields.length) {
_local1 = fields[_local2];
if ((this[_local1] is Number)){
this[_local1] = NaN;
} else {
if ((this[_local1] is String)){
this[_local1] = "";
};
};
_local2++;
};
resetTimestamp();
update();
}
public function fromSharedObject(_arg1:Object):void{
var _local2:String;
var _local3:int = fields.length;
var _local4:int;
while (_local4 < _local3) {
_local2 = fields[_local4];
if (_arg1[_local2]){
this[_local2] = _arg1[_local2];
};
_local4++;
};
if (_arg1.creation){
this.creation = _arg1.creation;
};
if (_arg1.expiration){
this.expiration = _arg1.expiration;
};
}
private function _timestamp(_arg1:Number):void{
creation = new Date();
_timespan = _arg1;
if (_arg1 > 0){
expiration = new Date((creation.valueOf() + _arg1));
};
}
public function isExpired():Boolean{
var _local1:Date = new Date();
var _local2:Number = (expiration.valueOf() - _local1.valueOf());
if (_local2 <= 0){
return (true);
};
return (false);
}
public function set expiration(_arg1:Date):void{
_expiration = _arg1;
}
public function get creation():Date{
return (_creation);
}
public function valueOf():String{
var _local2:String;
var _local3:*;
var _local1:Array = [];
var _local4:int;
while (_local4 < fields.length) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
if (_local3 == ""){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
} else {
if ((_local3 is Number)){
if (_local3 == 0){
_local1.push(_local3);
} else {
if (isNaN(_local3)){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
};
};
};
_local4++;
};
return (("" + _local1.join(".")));
}
public function toURLString():String{
return (((inURL + "=") + valueOf()));
}
public function get expiration():Date{
if (_expiration){
return (_expiration);
};
return (new Date((new Date().valueOf() + 1000)));
}
public function toSharedObject():Object{
var _local2:String;
var _local3:*;
var _local1:Object = {};
var _local4:int;
for (;_local4 < fields.length;_local4++) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
_local1[_local2] = _local3;
} else {
if (_local3 == 0){
_local1[_local2] = _local3;
} else {
if (isNaN(_local3)){
continue;
} else {
_local1[_local2] = _local3;
};
};
};
};
_local1.creation = creation;
_local1.expiration = expiration;
return (_local1);
}
public function toString(_arg1:Boolean=false):String{
var _local3:String;
var _local4:*;
var _local2:Array = [];
var _local5:int = fields.length;
var _local6:int;
for (;_local6 < _local5;_local6++) {
_local3 = fields[_local6];
_local4 = this[_local3];
if ((_local4 is String)){
_local2.push((((_local3 + ": \"") + _local4) + "\""));
} else {
if (_local4 == 0){
_local2.push(((_local3 + ": ") + _local4));
} else {
if (isNaN(_local4)){
continue;
} else {
_local2.push(((_local3 + ": ") + _local4));
};
};
};
};
var _local7 = (((name.toUpperCase() + " {") + _local2.join(", ")) + "}");
if (_arg1){
_local7 = (_local7 + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (_local7);
}
public function set creation(_arg1:Date):void{
_creation = _arg1;
}
}
}//package com.google.analytics.data
Section 28
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(_arg1:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = _arg1;
}
public function set hash(_arg1:Number):void{
_hash = _arg1;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 29
//UTMV (com.google.analytics.data.UTMV)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMV extends UTMCookie {
private var _domainHash:Number;
private var _value:String;
public function UTMV(_arg1:Number=NaN, _arg2:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.value = _arg2;
}
override public function toURLString():String{
return (((inURL + "=") + encodeURI(valueOf())));
}
public function get value():String{
return (_value);
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set value(_arg1:String):void{
_value = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 30
//UTMZ (com.google.analytics.data.UTMZ)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMZ extends UTMCookie {
private var _campaignTracking:String;
private var _campaignCreation:Number;
private var _responseCount:Number;
private var _domainHash:Number;
private var _campaignSessions:Number;
public static var defaultTimespan:Number = Timespan.sixmonths;
public function UTMZ(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.campaignCreation = _arg2;
this.campaignSessions = _arg3;
this.responseCount = _arg4;
this.campaignTracking = _arg5;
}
public function set responseCount(_arg1:Number):void{
_responseCount = _arg1;
update();
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set campaignCreation(_arg1:Number):void{
_campaignCreation = _arg1;
update();
}
public function get campaignTracking():String{
return (_campaignTracking);
}
public function get campaignSessions():Number{
return (_campaignSessions);
}
public function get domainHash():Number{
return (_domainHash);
}
public function get responseCount():Number{
return (_responseCount);
}
public function get campaignCreation():Number{
return (_campaignCreation);
}
public function set campaignSessions(_arg1:Number):void{
_campaignSessions = _arg1;
update();
}
public function set campaignTracking(_arg1:String):void{
_campaignTracking = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 31
//X10 (com.google.analytics.data.X10)
package com.google.analytics.data {
public class X10 {
private var _delimEnd:String;// = ")"
private var _minimum:int;
private var _delimSet:String;// = "*"
private var _escapeChar:String;// = "'"
private var _delimBegin:String;// = "("
private var _delimNumValue:String;// = "!"
private var _key:String;// = "k"
private var _set:Array;
private var _hasData:int;
private var _escapeCharMap:Object;
private var _projectData:Object;
private var _value:String;// = "v"
public function X10(){
_set = [_key, _value];
super();
_projectData = {};
_escapeCharMap = {};
_escapeCharMap[_escapeChar] = "'0";
_escapeCharMap[_delimEnd] = "'1";
_escapeCharMap[_delimSet] = "'2";
_escapeCharMap[_delimNumValue] = "'3";
_minimum = 1;
}
private function _setInternal(_arg1:Number, _arg2:String, _arg3:Number, _arg4:String):void{
if (!hasProject(_arg1)){
_projectData[_arg1] = {};
};
if (_projectData[_arg1][_arg2] == undefined){
_projectData[_arg1][_arg2] = [];
};
_projectData[_arg1][_arg2][_arg3] = _arg4;
_hasData = (_hasData + 1);
}
private function _renderProject(_arg1:Object):String{
var _local4:int;
var _local5:Array;
var _local2 = "";
var _local3:Boolean;
var _local6:int = _set.length;
_local4 = 0;
while (_local4 < _local6) {
_local5 = _arg1[_set[_local4]];
if (_local5){
if (_local3){
_local2 = (_local2 + _set[_local4]);
};
_local2 = (_local2 + _renderDataType(_local5));
_local3 = false;
} else {
_local3 = true;
};
_local4++;
};
return (_local2);
}
public function hasProject(_arg1:Number):Boolean{
return (_projectData[_arg1]);
}
public function clearKey(_arg1:Number):void{
_clearInternal(_arg1, _key);
}
private function _renderDataType(_arg1:Array):String{
var _local3:String;
var _local4:int;
var _local2:Array = [];
_local4 = 0;
while (_local4 < _arg1.length) {
if (_arg1[_local4] != undefined){
_local3 = "";
if (((!((_local4 == _minimum))) && ((_arg1[(_local4 - 1)] == undefined)))){
_local3 = (_local3 + _local4.toString());
_local3 = (_local3 + _delimNumValue);
};
_local3 = (_local3 + _escapeExtensibleValue(_arg1[_local4]));
_local2.push(_local3);
};
_local4++;
};
return (((_delimBegin + _local2.join(_delimSet)) + _delimEnd));
}
public function getKey(_arg1:Number, _arg2:Number):String{
return ((_getInternal(_arg1, _key, _arg2) as String));
}
public function hasData():Boolean{
return ((_hasData > 0));
}
public function renderMergedUrlString(_arg1:X10=null):String{
var _local3:String;
if (!_arg1){
return (renderUrlString());
};
var _local2:Array = [_arg1.renderUrlString()];
for (_local3 in _projectData) {
if (((hasProject(Number(_local3))) && (!(_arg1.hasProject(Number(_local3)))))){
_local2.push((_local3 + _renderProject(_projectData[_local3])));
};
};
return (_local2.join(""));
}
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
if (((((!((Math.round(_arg3) == _arg3))) || (isNaN(_arg3)))) || ((_arg3 == Infinity)))){
return (false);
};
_setInternal(_arg1, _value, _arg2, _arg3.toString());
return (true);
}
public function renderUrlString():String{
var _local2:String;
var _local1:Array = [];
for (_local2 in _projectData) {
if (hasProject(Number(_local2))){
_local1.push((_local2 + _renderProject(_projectData[_local2])));
};
};
return (_local1.join(""));
}
private function _getInternal(_arg1:Number, _arg2:String, _arg3:Number):Object{
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
return (_projectData[_arg1][_arg2][_arg3]);
};
return (undefined);
}
public function setKey(_arg1:Number, _arg2:Number, _arg3:String):Boolean{
_setInternal(_arg1, _key, _arg2, _arg3);
return (true);
}
public function clearValue(_arg1:Number):void{
_clearInternal(_arg1, _value);
}
private function _clearInternal(_arg1:Number, _arg2:String):void{
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
_projectData[_arg1][_arg2] = undefined;
_local3 = true;
_local5 = _set.length;
_local4 = 0;
while (_local4 < _local5) {
if (_projectData[_arg1][_set[_local4]] != undefined){
_local3 = false;
break;
};
_local4++;
};
if (_local3){
_projectData[_arg1] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function getValue(_arg1:Number, _arg2:Number){
var _local3:* = _getInternal(_arg1, _value, _arg2);
if (_local3 == null){
return (null);
};
return (Number(_local3));
}
private function _escapeExtensibleValue(_arg1:String):String{
var _local3:int;
var _local4:String;
var _local5:String;
var _local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charAt(_local3);
_local5 = _escapeCharMap[_local4];
if (_local5){
_local2 = (_local2 + _local5);
} else {
_local2 = (_local2 + _local4);
};
_local3++;
};
return (_local2);
}
}
}//package com.google.analytics.data
Section 32
//_Style (com.google.analytics.debug._Style)
package com.google.analytics.debug {
import flash.net.*;
import flash.text.*;
public class _Style {
public var failureColor:uint;
public var borderColor:uint;
public var backgroundColor:uint;
private var _sheet:StyleSheet;
public var roundedCorner:uint;
public var warningColor:uint;
public var infoColor:uint;
public var alertColor:uint;
public var successColor:uint;
private var _loader:URLLoader;
private var _defaultSheet:String;
public function _Style(){
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(_arg1:String):void{
_sheet.parseCSS(_arg1);
}
public function get sheet():StyleSheet{
return (_sheet);
}
private function _init():void{
_defaultSheet = "";
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n");
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n");
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + "\n");
roundedCorner = 6;
backgroundColor = 0xCCCCCC;
borderColor = 0x555555;
infoColor = 16777113;
alertColor = 0xFFCC00;
warningColor = 0xCC0000;
successColor = 0xFF00;
failureColor = 0xFF0000;
_parseSheet(_defaultSheet);
}
}
}//package com.google.analytics.debug
Section 33
//Alert (com.google.analytics.debug.Alert)
package com.google.analytics.debug {
import flash.events.*;
public class Alert extends Label {
public var autoClose:Boolean;// = true
public var actionOnNextLine:Boolean;// = true
private var _actions:Array;
public function Alert(_arg1:String, _arg2:Array, _arg3:String="uiAlert", _arg4:uint=0, _arg5:Align=null, _arg6:Boolean=false, _arg7:Boolean=true){
if (_arg4 == 0){
_arg4 = Style.alertColor;
};
if (_arg5 == null){
_arg5 = Align.center;
};
super(_arg1, _arg3, _arg4, _arg5, _arg6);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = _arg7;
_actions = [];
var _local8:int;
while (_local8 < _arg2.length) {
_arg2[_local8].container = this;
_actions.push(_arg2[_local8]);
_local8++;
};
}
private function _defineActions():void{
var _local3:AlertAction;
var _local1 = "";
if (actionOnNextLine){
_local1 = (_local1 + "\n");
} else {
_local1 = (_local1 + " |");
};
_local1 = (_local1 + " ");
var _local2:Array = [];
var _local4:int;
while (_local4 < _actions.length) {
_local3 = _actions[_local4];
_local2.push((((("<a href=\"event:" + _local3.activator) + "\">") + _local3.name) + "</a>"));
_local4++;
};
_local1 = (_local1 + _local2.join(" | "));
appendText(_local1, "uiAlertAction");
}
protected function isValidAction(_arg1:String):Boolean{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (true);
};
_local2++;
};
return (false);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function getAction(_arg1:String):AlertAction{
var _local2:int;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (_actions[_local2]);
};
_local2++;
};
return (null);
}
protected function spaces(_arg1:int):String{
var _local2 = "";
var _local3 = " ";
var _local4:int;
while (_local4 < (_arg1 + 1)) {
_local2 = (_local2 + _local3);
_local4++;
};
return (_local2);
}
override public function onLink(_arg1:TextEvent):void{
var _local2:AlertAction;
if (isValidAction(_arg1.text)){
_local2 = getAction(_arg1.text);
if (_local2){
_local2.execute();
};
};
if (autoClose){
close();
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 34
//AlertAction (com.google.analytics.debug.AlertAction)
package com.google.analytics.debug {
public class AlertAction {
public var container:Alert;
private var _callback;
public var activator:String;
public var name:String;
public function AlertAction(_arg1:String, _arg2:String, _arg3){
this.name = _arg1;
this.activator = _arg2;
_callback = _arg3;
}
public function execute():void{
if (_callback){
if ((_callback is Function)){
(_callback as Function)();
} else {
if ((_callback is String)){
var _local1 = container;
_local1[_callback]();
};
};
};
}
}
}//package com.google.analytics.debug
Section 35
//Align (com.google.analytics.debug.Align)
package com.google.analytics.debug {
public class Align {
private var _value:int;
private var _name:String;
public static const bottomRight:Align = new Align(18, "bottomRight");
;
public static const right:Align = new Align(16, "right");
;
public static const left:Align = new Align(32, "left");
;
public static const topRight:Align = new Align(17, "topRight");
;
public static const bottom:Align = new Align(2, "bottom");
;
public static const bottomLeft:Align = new Align(34, "bottomLeft");
;
public static const topLeft:Align = new Align(33, "topLeft");
;
public static const center:Align = new Align(0x0100, "center");
;
public static const none:Align = new Align(0, "none");
;
public static const top:Align = new Align(1, "top");
;
public function Align(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 36
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public static function drawRounded(_arg1, _arg2:Graphics, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint;
var _local6:uint;
var _local7:uint = Style.roundedCorner;
if ((((_arg3 > 0)) && ((_arg4 > 0)))){
_local5 = _arg3;
_local6 = _arg4;
} else {
_local5 = _arg1.width;
_local6 = _arg1.height;
};
if (((_arg1.stickToEdge) && (!((_arg1.alignement == Align.none))))){
switch (_arg1.alignement){
case Align.top:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, _local7);
break;
case Align.topLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, 0, _local7);
break;
case Align.topRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, 0);
break;
case Align.bottom:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, _local7, 0, 0);
break;
case Align.bottomLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, 0);
break;
case Align.bottomRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, 0, 0);
break;
case Align.left:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, _local7);
break;
case Align.right:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, _local7, 0);
break;
case Align.center:
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
break;
};
} else {
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
};
}
}
}//package com.google.analytics.debug
Section 37
//Debug (com.google.analytics.debug.Debug)
package com.google.analytics.debug {
import flash.events.*;
import flash.ui.*;
public class Debug extends Label {
private var _lines:Array;
private var _preferredForcedWidth:uint;// = 540
private var _linediff:int;// = 0
public var maxLines:uint;// = 16
public static var count:uint = 0;
public function Debug(_arg1:uint=0, _arg2:Align=null, _arg3:Boolean=false){
if (_arg2 == null){
_arg2 = Align.bottom;
};
super("", "uiLabel", _arg1, _arg2, _arg3);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(_arg1:String):void{
write(_arg1, true);
}
private function _getLinesToDisplay(_arg1:int=0):Array{
var _local2:Array;
var _local3:uint;
var _local4:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + _arg1);
} else {
if ((((_linediff > 0)) && ((_arg1 < 0)))){
_linediff = (_linediff + _arg1);
};
};
_local3 = ((_lines.length - maxLines) + _linediff);
_local4 = (_local3 + maxLines);
_local2 = _lines.slice(_local3, _local4);
} else {
_local2 = _lines;
};
return (_local2);
}
private function onKey(_arg1:KeyboardEvent=null):void{
var _local2:Array;
switch (_arg1.keyCode){
case Keyboard.DOWN:
_local2 = _getLinesToDisplay(1);
break;
case Keyboard.UP:
_local2 = _getLinesToDisplay(-1);
break;
default:
_local2 = null;
};
if (_local2 == null){
return;
};
text = _local2.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
//unresolved jump
};
return (super.forcedWidth);
}
public function write(_arg1:String, _arg2:Boolean=false):void{
var _local3:Array;
if (_arg1.indexOf("") > -1){
_local3 = _arg1.split("\n");
} else {
_local3 = [_arg1];
};
var _local4 = "";
var _local5 = "";
if (_arg2){
_local4 = "<b>";
_local5 = "</b>";
};
var _local6:int;
while (_local6 < _local3.length) {
_lines.push(((_local4 + _local3[_local6]) + _local5));
_local6++;
};
var _local7:Array = _getLinesToDisplay();
text = _local7.join("\n");
}
public function close():void{
dispose();
}
override protected function dispose():void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 38
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import com.google.analytics.core.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
public class DebugConfiguration {
public var showHideKey:Number;
private var _mode:VisualDebugMode;
private var _verbose:Boolean;// = false
public var destroyKey:Number;
public var GIFRequests:Boolean;// = false
public var showInfos:Boolean;// = true
public var infoTimeout:Number;// = 1000
public var minimizedOnStart:Boolean;// = false
private var _active:Boolean;// = false
public var traceOutput:Boolean;// = false
public var layout:ILayout;
public var warningTimeout:Number;// = 1500
public var javascript:Boolean;// = false
public var showWarnings:Boolean;// = true
private var _visualInitialized:Boolean;// = false
public function DebugConfiguration(){
_mode = VisualDebugMode.basic;
showHideKey = Keyboard.SPACE;
destroyKey = Keyboard.BACKSPACE;
super();
}
public function get verbose():Boolean{
return (_verbose);
}
public function set verbose(_arg1:Boolean):void{
_verbose = _arg1;
}
public function set mode(_arg1):void{
if ((_arg1 is String)){
switch (_arg1){
case "geek":
_arg1 = VisualDebugMode.geek;
break;
case "advanced":
_arg1 = VisualDebugMode.advanced;
break;
case "basic":
default:
_arg1 = VisualDebugMode.basic;
};
};
_mode = _arg1;
}
public function success(_arg1:String):void{
if (layout){
layout.createSuccessAlert(_arg1);
};
if (traceOutput){
trace((("[+] " + _arg1) + " !!"));
};
}
public function get active():Boolean{
return (_active);
}
private function _initializeVisual():void{
if (layout){
layout.init();
_visualInitialized = true;
};
}
private function _destroyVisual():void{
if (((layout) && (_visualInitialized))){
layout.destroy();
};
}
public function warning(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(_arg1);
};
if (traceOutput){
trace((("## " + _arg1) + " ##"));
};
}
private function _filter(_arg1:VisualDebugMode=null):Boolean{
return (((_arg1) && ((int(_arg1) >= int(this.mode)))));
}
public function failure(_arg1:String):void{
if (layout){
layout.createFailureAlert(_arg1);
};
if (traceOutput){
trace((("[-] " + _arg1) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(_arg1:Boolean):void{
_active = _arg1;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(_arg1:String):void{
var _local7:Array;
var _local8:int;
var _local2:Array = [];
var _local3 = "";
var _local4 = "";
if (this.mode == VisualDebugMode.geek){
_local3 = (getTimer() + " - ");
_local4 = (new Array(_local3.length).join(" ") + " ");
};
if (_arg1.indexOf("\n") > -1){
_local7 = _arg1.split("\n");
_local8 = 0;
while (_local8 < _local7.length) {
if (_local7[_local8] == ""){
} else {
if (_local8 == 0){
_local2.push((_local3 + _local7[_local8]));
} else {
_local2.push((_local4 + _local7[_local8]));
};
};
_local8++;
};
} else {
_local2.push((_local3 + _arg1));
};
var _local5:int = _local2.length;
var _local6:int;
while (_local6 < _local5) {
trace(_local2[_local6]);
_local6++;
};
}
public function alert(_arg1:String):void{
if (layout){
layout.createAlert(_arg1);
};
if (traceOutput){
trace((("!! " + _arg1) + " !!"));
};
}
public function info(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(_arg1);
};
if (traceOutput){
trace(_arg1);
};
}
public function alertGifRequest(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(_arg1, _arg2, _arg3);
};
if (traceOutput){
trace(((">> " + _arg1) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 39
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiFailure", Style.failureColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 40
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(_arg1:String, _arg2:Array){
super(_arg1, _arg2);
}
}
}//package com.google.analytics.debug
Section 41
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import flash.display.*;
import com.google.analytics.core.*;
import flash.net.*;
public interface ILayout {
function createAlert(_arg1:String):void;
function addToStage(_arg1:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createWarning(_arg1:String):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(_arg1:String):void;
function createFailureAlert(_arg1:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(_arg1:String):void;
function createVisualDebug():void;
function destroy():void;
function bringToFront(_arg1:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 42
//Info (com.google.analytics.debug.Info)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Info extends Label {
private var _timer:Timer;
public function Info(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiInfo", Style.infoColor, Align.top, true);
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 43
//Label (com.google.analytics.debug.Label)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Label extends UISprite {
private var _color:uint;
private var _background:Shape;
private var _textField:TextField;
public var stickToEdge:Boolean;
private var _text:String;
protected var selectable:Boolean;
private var _tag:String;
public static var count:uint = 0;
public function Label(_arg1:String="", _arg2:String="uiLabel", _arg3:uint=0, _arg4:Align=null, _arg5:Boolean=false){
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = _arg1;
_tag = _arg2;
if (_arg4 == null){
_arg4 = Align.none;
};
this.alignement = _arg4;
this.stickToEdge = _arg5;
if (_arg3 == 0){
_arg3 = Style.backgroundColor;
};
_color = _arg3;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var _local1:Graphics = _background.graphics;
_local1.clear();
_local1.beginFill(_color);
var _local2:uint = _textField.width;
var _local3:uint = _textField.height;
if (forcedWidth > 0){
_local2 = forcedWidth;
};
Background.drawRounded(this, _local1, _local2, _local3);
_local1.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(_arg1:String, _arg2:String=""):void{
if (_arg1 == ""){
return;
};
if (_arg2 == ""){
_arg2 = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + _arg2) + "\">") + _arg1) + "</span>"));
_text = (_text + _arg1);
_draw();
resize();
}
public function set text(_arg1:String):void{
if (_arg1 == ""){
_arg1 = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + _arg1) + "</span>");
_text = _arg1;
_draw();
resize();
}
override protected function layout():void{
_textField.type = TextFieldType.DYNAMIC;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.background = false;
_textField.selectable = selectable;
_textField.multiline = true;
_textField.styleSheet = Style.sheet;
this.text = _text;
addChild(_background);
addChild(_textField);
}
public function set tag(_arg1:String):void{
_tag = _arg1;
text = "";
}
public function onLink(_arg1:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 44
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
import com.google.analytics.core.*;
import flash.net.*;
import com.google.analytics.*;
public class Layout implements ILayout {
private var _display:DisplayObject;
private var _infoQueue:Array;
private var _maxCharPerLine:int;// = 85
private var _hasInfo:Boolean;
private var _warningQueue:Array;
private var _hasDebug:Boolean;
private var _hasWarning:Boolean;
private var _mainPanel:Panel;
private var _GRAlertQueue:Array;
private var _debug:DebugConfiguration;
public var visualDebug:Debug;
private var _hasGRAlert:Boolean;
public function Layout(_arg1:DebugConfiguration, _arg2:DisplayObject){
_display = _arg2;
_debug = _arg1;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(_arg1:KeyboardEvent=null):void{
switch (_arg1.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(_arg1:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasWarning = true;
var _local2:Warning = new Warning(_arg1, _debug.warningTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function bringToFront(_arg1:DisplayObject):void{
_display.stage.setChildIndex(_arg1, (_display.stage.numChildren - 1));
}
public function createFailureAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new FailureAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function init():void{
var _local1 = 10;
var _local2:uint = (_display.stage.stageWidth - (_local1 * 2));
var _local3:uint = (_display.stage.stageHeight - (_local1 * 2));
var _local4:Panel = new Panel("analytics", _local2, _local3);
_local4.alignement = Align.top;
_local4.stickToEdge = false;
_local4.title = ("Google Analytics v" + GATracker.version);
_mainPanel = _local4;
addToStage(_local4);
bringToFront(_local4);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(_arg1:String, _arg2:DisplayObject):void{
var _local4:Panel;
var _local3:DisplayObject = _display.stage.getChildByName(_arg1);
if (_local3){
_local4 = (_local3 as Panel);
_local4.addData(_arg2);
} else {
trace((("panel \"" + _arg1) + "\" not found"));
};
}
private function _clearInfo(_arg1:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(_arg1:String, _arg2:int=0):String{
var _local6:String;
var _local3 = "\n";
var _local4:Array = [];
var _local5:Array = _arg1.split(_local3);
if (_arg2 == 0){
_arg2 = _maxCharPerLine;
};
var _local7:int;
while (_local7 < _local5.length) {
_local6 = _local5[_local7];
while (_local6.length > _arg2) {
_local4.push(_local6.substr(0, _arg2));
_local6 = _local6.substring(_arg2);
};
_local4.push(_local6);
_local7++;
};
return (_local4.join(_local3));
}
private function _clearGRAlert(_arg1:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new SuccessAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(_arg1:String):void{
_arg1 = _filterMaxChars(_arg1);
var _local2:Alert = new Alert(_arg1, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", _local2);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function createInfo(_arg1:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasInfo = true;
var _local2:Info = new Info(_arg1, _debug.infoTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(_arg1);
};
}
public function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
var message = _arg1;
var request = _arg2;
var ref = _arg3;
if (_hasGRAlert){
_GRAlertQueue.push([message, request, ref]);
return;
};
_hasGRAlert = true;
var f:Function = function ():void{
ref.sendRequest(request);
};
message = _filterMaxChars(message);
var gra:GIFRequestAlert = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]);
addToPanel("analytics", gra);
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.write(message);
};
}
public function createVisualDebug():void{
if (!visualDebug){
visualDebug = new Debug();
visualDebug.alignement = Align.bottom;
visualDebug.stickToEdge = true;
addToPanel("analytics", visualDebug);
_hasDebug = true;
};
}
public function addToStage(_arg1:DisplayObject):void{
_display.stage.addChild(_arg1);
}
private function _clearWarning(_arg1:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void{
var _local4:Panel = new Panel(_arg1, _arg2, _arg3);
_local4.alignement = Align.center;
_local4.stickToEdge = false;
addToStage(_local4);
bringToFront(_local4);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 45
//Margin (com.google.analytics.debug.Margin)
package com.google.analytics.debug {
public class Margin {
public var top:int;
public var left:int;
public var bottom:int;
public var right:int;
public function Margin(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
this.top = _arg1;
this.bottom = _arg2;
this.left = _arg3;
this.right = _arg4;
}
}
}//package com.google.analytics.debug
Section 46
//Panel (com.google.analytics.debug.Panel)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
public class Panel extends UISprite {
private var _savedH:uint;
private var _data:UISprite;
private var _mask:Sprite;
private var _background:Shape;
private var _savedW:uint;
private var _stickToEdge:Boolean;
private var _border:Shape;
private var _borderColor:uint;
protected var baseAlpha:Number;
private var _backgroundColor:uint;
private var _title:Label;
private var _colapsed:Boolean;
private var _name:String;
public function Panel(_arg1:String, _arg2:uint, _arg3:uint, _arg4:uint=0, _arg5:uint=0, _arg6:Number=0.3, _arg7:Align=null, _arg8:Boolean=false){
_name = _arg1;
this.name = _arg1;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = _arg2;
forcedHeight = _arg3;
this.baseAlpha = _arg6;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = _arg2;
_data.forcedHeight = _arg3;
_data.mouseEnabled = false;
_title = new Label(_arg1, "uiLabel", 0xFFFFFF, Align.topLeft, _arg8);
_title.buttonMode = true;
_title.margin.top = 0.6;
_title.margin.left = 0.6;
_title.addEventListener(MouseEvent.CLICK, onToggle);
_title.mouseChildren = false;
_border = new Shape();
_mask = new Sprite();
_mask.useHandCursor = false;
_mask.mouseEnabled = false;
_mask.mouseChildren = false;
if (_arg7 == null){
_arg7 = Align.none;
};
this.alignement = _arg7;
this.stickToEdge = _arg8;
if (_arg4 == 0){
_arg4 = Style.backgroundColor;
};
_backgroundColor = _arg4;
if (_arg5 == 0){
_arg5 = Style.borderColor;
};
_borderColor = _arg5;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(_arg1:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(_arg1:Boolean):void{
_stickToEdge = _arg1;
_title.stickToEdge = _arg1;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var _local1:uint;
var _local2:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
_local1 = forcedWidth;
_local2 = forcedHeight;
} else {
_local1 = _title.width;
_local2 = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = _local1;
forcedHeight = _local2;
};
var _local3:Graphics = _background.graphics;
_local3.clear();
_local3.beginFill(_backgroundColor);
Background.drawRounded(this, _local3, _local1, _local2);
_local3.endFill();
var _local4:Graphics = _data.graphics;
_local4.clear();
_local4.beginFill(_backgroundColor, 0);
Background.drawRounded(this, _local4, _local1, _local2);
_local4.endFill();
var _local5:Graphics = _border.graphics;
_local5.clear();
_local5.lineStyle(0.1, _borderColor);
Background.drawRounded(this, _local5, _local1, _local2);
_local5.endFill();
var _local6:Graphics = _mask.graphics;
_local6.clear();
_local6.beginFill(_backgroundColor);
Background.drawRounded(this, _local6, (_local1 + 1), (_local2 + 1));
_local6.endFill();
}
public function get title():String{
return (_title.text);
}
private function _update():void{
_draw();
if (baseAlpha < 1){
_background.alpha = baseAlpha;
_border.alpha = baseAlpha;
};
}
public function addData(_arg1:DisplayObject):void{
_data.addChild(_arg1);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(_arg1:String):void{
_title.text = _arg1;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 47
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 48
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align = Align.bottomLeft;
var _local5:Boolean;
var _local6:Boolean;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiSuccess", Style.successColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 49
//UISprite (com.google.analytics.debug.UISprite)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
public class UISprite extends Sprite {
private var _forcedWidth:uint;
public var margin:Margin;
protected var alignTarget:DisplayObject;
protected var listenResize:Boolean;
public var alignement:Align;
private var _forcedHeight:uint;
public function UISprite(_arg1:DisplayObject=null){
listenResize = false;
alignement = Align.none;
this.alignTarget = _arg1;
margin = new Margin();
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
}
public function get forcedHeight():uint{
if (_forcedHeight){
return (_forcedHeight);
};
return (height);
}
private function _onAddedToStage(_arg1:Event):void{
layout();
resize();
}
protected function dispose():void{
var _local1:DisplayObject;
var _local2:int;
while (_local2 < numChildren) {
_local1 = getChildAt(_local2);
if (_local1){
removeChild(_local1);
};
_local2++;
};
}
public function set forcedHeight(_arg1:uint):void{
_forcedHeight = _arg1;
}
public function set forcedWidth(_arg1:uint):void{
_forcedWidth = _arg1;
}
protected function layout():void{
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
public function alignTo(_arg1:Align, _arg2:DisplayObject=null):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:UISprite;
if (_arg2 == null){
if ((parent is Stage)){
_arg2 = this.stage;
} else {
_arg2 = parent;
};
};
if (_arg2 == this.stage){
if (this.stage == null){
return;
};
_local3 = this.stage.stageHeight;
_local4 = this.stage.stageWidth;
_local5 = 0;
_local6 = 0;
} else {
_local7 = (_arg2 as UISprite);
if (_local7.forcedHeight){
_local3 = _local7.forcedHeight;
} else {
_local3 = _local7.height;
};
if (_local7.forcedWidth){
_local4 = _local7.forcedWidth;
} else {
_local4 = _local7.width;
};
_local5 = 0;
_local6 = 0;
};
switch (_arg1){
case Align.top:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (_local6 + margin.top);
break;
case Align.bottom:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (_local5 + margin.left);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((_local4 / 2) - (forcedWidth / 2));
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (_local5 + margin.left);
y = (_local6 + margin.top);
break;
case Align.topRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (_local6 + margin.top);
break;
case Align.bottomLeft:
x = (_local5 + margin.left);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((_arg1 == Align.none))))){
_arg2.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = _arg1;
this.alignTarget = _arg2;
}
private function _onRemovedFromStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
dispose();
}
public function resize():void{
if (alignement != Align.none){
alignTo(alignement, alignTarget);
};
}
protected function onResize(_arg1:Event):void{
resize();
}
}
}//package com.google.analytics.debug
Section 50
//Warning (com.google.analytics.debug.Warning)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Warning extends Label {
private var _timer:Timer;
public function Warning(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 51
//VisualDebugMode (com.google.analytics.debug.VisualDebugMode)
package com.google.analytics.debug {
public class VisualDebugMode {
private var _value:int;
private var _name:String;
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced");
;
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek");
;
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic");
;
public function VisualDebugMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 52
//AnalyticsEvent (com.google.analytics.events.AnalyticsEvent)
package com.google.analytics.events {
import flash.events.*;
import com.google.analytics.*;
public class AnalyticsEvent extends Event {
public var tracker:AnalyticsTracker;
public static const READY:String = "ready";
public function AnalyticsEvent(_arg1:String, _arg2:AnalyticsTracker, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.tracker = _arg2;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 53
//AdSenseGlobals (com.google.analytics.external.AdSenseGlobals)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class AdSenseGlobals extends JavascriptProxy {
private var _gaGlobalVerified:Boolean;// = false
public static var gaGlobal_js:XML = <script>
<![CDATA[
function()
{
try
{
gaGlobal
}
catch(e)
{
gaGlobal = {} ;
}
}
]]>
</script>
;
public function AdSenseGlobals(_arg1:DebugConfiguration){
super(_arg1);
}
public function set vid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", _arg1);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function set hid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", _arg1);
}
public function get dh():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.dh"));
}
public function get sid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.sid"));
}
public function get vid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.vid"));
}
private function _verify():void{
if (!_gaGlobalVerified){
executeBlock(gaGlobal_js);
_gaGlobalVerified = true;
};
}
public function set sid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", _arg1);
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
}
}//package com.google.analytics.external
Section 54
//HTMLDOM (com.google.analytics.external.HTMLDOM)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class HTMLDOM extends JavascriptProxy {
private var _referrer:String;
private var _language:String;
private var _host:String;
private var _pathname:String;
private var _location:String;
private var _search:String;
private var _characterSet:String;
private var _title:String;
private var _protocol:String;
private var _colorDepth:String;
public static var cache_properties_js:XML = <script>
<![CDATA[
function()
{
var obj = {};
obj.host = document.location.host;
obj.language = navigator.language ? navigator.language : navigator.browserLanguage;
obj.characterSet = document.characterSet ? document.characterSet : document.charset;
obj.colorDepth = window.screen.colorDepth;
obj.location = document.location.toString();
obj.pathname = document.location.pathname;
obj.protocol = document.location.protocol;
obj.search = document.location.search;
obj.referrer = document.referrer;
obj.title = document.title;
return obj;
}
]]>
</script>
;
public function HTMLDOM(_arg1:DebugConfiguration){
super(_arg1);
}
public function get search():String{
if (_search){
return (_search);
};
if (!isAvailable()){
return (null);
};
_search = getProperty("document.location.search");
return (_search);
}
public function get location():String{
if (_location){
return (_location);
};
if (!isAvailable()){
return (null);
};
_location = getPropertyString("document.location");
return (_location);
}
public function get pathname():String{
if (_pathname){
return (_pathname);
};
if (!isAvailable()){
return (null);
};
_pathname = getProperty("document.location.pathname");
return (_pathname);
}
public function cacheProperties():void{
if (!isAvailable()){
return;
};
var _local1:Object = call(cache_properties_js);
if (_local1){
_host = _local1.host;
_language = _local1.language;
_characterSet = _local1.characterSet;
_colorDepth = _local1.colorDepth;
_location = _local1.location;
_pathname = _local1.pathname;
_protocol = _local1.protocol;
_search = _local1.search;
_referrer = _local1.referrer;
_title = _local1.title;
};
}
public function get language():String{
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("navigator.language");
if (_local1 == null){
_local1 = getProperty("navigator.browserLanguage");
};
_language = _local1;
return (_language);
}
public function get colorDepth():String{
if (_colorDepth){
return (_colorDepth);
};
if (!isAvailable()){
return (null);
};
_colorDepth = getProperty("window.screen.colorDepth");
return (_colorDepth);
}
public function get referrer():String{
if (_referrer){
return (_referrer);
};
if (!isAvailable()){
return (null);
};
_referrer = getProperty("document.referrer");
return (_referrer);
}
public function get protocol():String{
if (_protocol){
return (_protocol);
};
if (!isAvailable()){
return (null);
};
_protocol = getProperty("document.location.protocol");
return (_protocol);
}
public function get host():String{
if (_host){
return (_host);
};
if (!isAvailable()){
return (null);
};
_host = getProperty("document.location.host");
return (_host);
}
public function get characterSet():String{
if (_characterSet){
return (_characterSet);
};
if (!isAvailable()){
return (null);
};
var _local1:String = getProperty("document.characterSet");
if (_local1 == null){
_local1 = getProperty("document.charset");
};
_characterSet = _local1;
return (_characterSet);
}
public function get title():String{
if (_title){
return (_title);
};
if (!isAvailable()){
return (null);
};
_title = getProperty("document.title");
return (_title);
}
}
}//package com.google.analytics.external
Section 55
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import com.google.analytics.debug.*;
import flash.system.*;
import flash.external.*;
public class JavascriptProxy {
private var _notAvailableWarning:Boolean;// = true
private var _debug:DebugConfiguration;
public static var setProperty_js:XML = <script>
<![CDATA[
function( path , value )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
target[ prop ] = value ;
}
]]>
</script>
;
public static var hasProperty_js:XML = <script>
<![CDATA[
function( path )
{
var paths;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
}
else
{
paths = [path];
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
if( target )
{
return true;
}
else
{
return false;
}
}
]]>
</script>
;
public static var setPropertyRef_js:XML = <script>
<![CDATA[
function( path , target )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
alert( "paths:"+paths.length+", prop:"+prop );
var targets;
var name;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
alert( "targets:"+targets.length+", name:"+name );
var root = window;
var len = paths.length;
for( var i = 0 ; i < len ; i++ )
{
root = root[ paths[i] ] ;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
root[ prop ] = ref[name] ;
}
]]>
</script>
;
public function JavascriptProxy(_arg1:DebugConfiguration){
_debug = _arg1;
}
public function getProperty(_arg1:String){
return (call((_arg1 + ".valueOf")));
}
public function hasProperty(_arg1:String):Boolean{
return (call(hasProperty_js, _arg1));
}
public function setProperty(_arg1:String, _arg2):void{
call(setProperty_js, _arg1, _arg2);
}
public function executeBlock(_arg1:String):void{
var data = _arg1;
if (isAvailable()){
try {
ExternalInterface.call(data);
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
}
public function getPropertyString(_arg1:String):String{
return (call((_arg1 + ".toString")));
}
public function setPropertyByReference(_arg1:String, _arg2:String):void{
call(setPropertyRef_js, _arg1, _arg2);
}
public function call(_arg1:String, ... _args){
var output:String;
var functionName = _arg1;
var args = _args;
if (isAvailable()){
try {
if (((_debug.javascript) && (_debug.verbose))){
output = "";
output = ("Flash->JS: " + functionName);
output = (output + "( ");
if (args.length > 0){
output = (output + args.join(","));
};
output = (output + " )");
_debug.info(output);
};
args.unshift(functionName);
return (ExternalInterface.call.apply(ExternalInterface, args));
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
return (null);
}
public function isAvailable():Boolean{
var _local1:Boolean = ExternalInterface.available;
if (((_local1) && ((Capabilities.playerType == "External")))){
_local1 = false;
};
if (((((!(_local1)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (_local1);
}
}
}//package com.google.analytics.external
Section 56
//Environment (com.google.analytics.utils.Environment)
package com.google.analytics.utils {
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import flash.system.*;
public class Environment {
private var _dom:HTMLDOM;
private var _appName:String;
private var _debug:DebugConfiguration;
private var _appVersion:Version;
private var _url:String;
private var _protocol:Protocols;
private var _userAgent:UserAgent;
public function Environment(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:DebugConfiguration=null, _arg5:HTMLDOM=null){
var _local6:Version;
super();
if (_arg2 == ""){
if (isAIR()){
_arg2 = "AIR";
} else {
_arg2 = "Flash";
};
};
if (_arg3 == ""){
_local6 = flashVersion;
} else {
_local6 = Version.fromString(_arg3);
};
_url = _arg1;
_appName = _arg2;
_appVersion = _local6;
_debug = _arg4;
_dom = _arg5;
}
public function isAIR():Boolean{
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application"))));
}
public function get screenWidth():Number{
return (Capabilities.screenResolutionX);
}
public function get playerType():String{
return (Capabilities.playerType);
}
public function get locationSearch():String{
var _local1:String = _dom.search;
if (_local1){
return (_local1);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var _local1:Version = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (_local1);
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
public function get languageEncoding():String{
var _local1:String;
if (System.useCodePage){
_local1 = _dom.characterSet;
if (_local1){
return (_local1);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var _local1:String;
switch (Capabilities.screenColor){
case "bw":
_local1 = "1";
break;
case "gray":
_local1 = "2";
break;
case "color":
default:
_local1 = "24";
};
var _local2:String = _dom.colorDepth;
if (_local2){
_local1 = _local2;
};
return (_local1);
}
private function _findProtocol():void{
var _local4:String;
var _local5:String;
var _local1:Protocols = Protocols.none;
if (_url != ""){
_local4 = _url.toLowerCase();
_local5 = _local4.substr(0, 5);
switch (_local5){
case "file:":
_local1 = Protocols.file;
break;
case "http:":
_local1 = Protocols.HTTP;
break;
case "https":
if (_local4.charAt(5) == ":"){
_local1 = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
var _local2:String = _dom.protocol;
var _local3:String = (_local1.toString() + ":").toLowerCase();
if (((((_local2) && (!((_local2 == _local3))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + _local3) + ", DOM=") + _local2));
};
_protocol = _local1;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var _local1:String = Capabilities.manufacturer;
return (_local1.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(_arg1:String):void{
_appName = _arg1;
userAgent.applicationProduct = _arg1;
}
function set url(_arg1:String):void{
_url = _arg1;
}
public function get referrer():String{
var _local1:String = _dom.referrer;
if (_local1){
return (_local1);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _local1:String = _dom.language;
var _local2:String = Capabilities.language;
if (_local1){
if ((((_local1.length > _local2.length)) && ((_local1.substr(0, _local2.length) == _local2)))){
_local2 = _local1;
};
};
return (_local2);
}
public function get domainName():String{
var _local1:String;
var _local2:String;
var _local3:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
_local1 = _url.toLowerCase();
if (protocol == Protocols.HTTP){
_local2 = _local1.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
_local2 = _local1.split("https://").join("");
};
};
_local3 = _local2.indexOf("/");
if (_local3 > -1){
_local2 = _local2.substring(0, _local3);
};
return (_local2);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(_arg1:UserAgent):void{
_userAgent = _arg1;
}
public function set appVersion(_arg1:Version):void{
_appVersion = _arg1;
userAgent.applicationVersion = _arg1.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _local1:String = _dom.pathname;
if (_local1){
return (_local1);
};
return ("");
}
public function get documentTitle():String{
var _local1:String = _dom.title;
if (_local1){
return (_local1);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 57
//Protocols (com.google.analytics.utils.Protocols)
package com.google.analytics.utils {
public class Protocols {
private var _value:int;
private var _name:String;
public static const none:Protocols = new Protocols(0, "none");
;
public static const HTTPS:Protocols = new Protocols(3, "HTTPS");
;
public static const file:Protocols = new Protocols(1, "file");
;
public static const HTTP:Protocols = new Protocols(2, "HTTP");
;
public function Protocols(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 58
//Timespan (com.google.analytics.utils.Timespan)
package com.google.analytics.utils {
public class Timespan {
public static var sixmonths:Number = 15768000;
public static var twoyears:Number = 63072000;
public static var thirtyminutes:Number = 1800;
}
}//package com.google.analytics.utils
Section 59
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(_arg1:String=""){
_url = _arg1.toLowerCase();
}
public function get domain():String{
var _local1:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
_local1 = hostName.split(".");
switch (_local1.length){
case 2:
return (hostName);
case 3:
if (_local1[1] == "co"){
return (hostName);
};
_local1.shift();
return (_local1.join("."));
case 4:
_local1.shift();
return (_local1.join("."));
};
};
return ("");
}
public function get path():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if (_local1.charAt(0) != "/"){
_local1 = ("/" + _local1);
};
return (_local1);
}
public function get protocol():Protocols{
var _local1:String = _url.split("://")[0];
switch (_local1){
case "file":
return (Protocols.file);
case "http":
return (Protocols.HTTP);
case "https":
return (Protocols.HTTPS);
default:
return (Protocols.none);
};
}
public function get hostName():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf("/") > -1){
_local1 = _local1.split("/")[0];
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (_local1);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[1];
} else {
_local1 = "";
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 60
//UserAgent (com.google.analytics.utils.UserAgent)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import flash.system.*;
public class UserAgent {
private var _localInfo:Environment;
private var _applicationProduct:String;
private var _version:Version;
public static var minimal:Boolean = false;
public function UserAgent(_arg1:Environment, _arg2:String="", _arg3:String=""){
_localInfo = _arg1;
applicationProduct = _arg2;
_version = Version.fromString(_arg3);
}
public function get tamarinProductToken():String{
if (UserAgent.minimal){
return ("");
};
if (System.vmVersion){
return (("Tamarin/" + Utils.trim(System.vmVersion, true)));
};
return ("");
}
public function get applicationVersion():String{
return (_version.toString(2));
}
public function get vendorProductToken():String{
var _local1 = "";
if (_localInfo.isAIR()){
_local1 = (_local1 + "AIR");
} else {
_local1 = (_local1 + "FlashPlayer");
};
_local1 = (_local1 + "/");
_local1 = (_local1 + _version.toString(3));
return (_local1);
}
public function toString():String{
var _local1 = "";
_local1 = (_local1 + applicationProductToken);
if (applicationComment != ""){
_local1 = (_local1 + (" " + applicationComment));
};
if (tamarinProductToken != ""){
_local1 = (_local1 + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
_local1 = (_local1 + (" " + vendorProductToken));
};
return (_local1);
}
public function get applicationComment():String{
var _local1:Array = [];
_local1.push(_localInfo.platform);
_local1.push(_localInfo.playerType);
if (!UserAgent.minimal){
_local1.push(_localInfo.operatingSystem);
_local1.push(_localInfo.language);
};
if (Capabilities.isDebugger){
_local1.push("DEBUG");
};
if (_local1.length > 0){
return ((("(" + _local1.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(_arg1:String):void{
_version = Version.fromString(_arg1);
}
public function get applicationProductToken():String{
var _local1:String = applicationProduct;
if (applicationVersion != ""){
_local1 = (_local1 + ("/" + applicationVersion));
};
return (_local1);
}
public function set applicationProduct(_arg1:String):void{
_applicationProduct = _arg1;
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 61
//Variables (com.google.analytics.utils.Variables)
package com.google.analytics.utils {
import flash.net.*;
public dynamic class Variables {
public var post:Array;
public var URIencode:Boolean;
public var pre:Array;
public var sort:Boolean;// = true
public function Variables(_arg1:String=null, _arg2:Array=null, _arg3:Array=null){
pre = [];
post = [];
super();
if (_arg1){
decode(_arg1);
};
if (_arg2){
this.pre = _arg2;
};
if (_arg3){
this.post = _arg3;
};
}
private function _join(_arg1:Variables):void{
var _local2:String;
if (!_arg1){
return;
};
for (_local2 in _arg1) {
this[_local2] = _arg1[_local2];
};
}
public function join(... _args):void{
var _local2:int = _args.length;
var _local3:int;
while (_local3 < _local2) {
if (!(_args[_local3] is Variables)){
} else {
_join(_args[_local3]);
};
_local3++;
};
}
public function toString():String{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:String;
var _local1:Array = [];
for (_local3 in this) {
_local2 = this[_local3];
if (URIencode){
_local2 = encodeURI(_local2);
};
_local1.push(((_local3 + "=") + _local2));
};
if (sort){
_local1.sort();
};
if (pre.length > 0){
pre.reverse();
_local5 = 0;
while (_local5 < pre.length) {
_local7 = pre[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local7) == 0){
_local1.unshift(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
pre.reverse();
};
if (post.length > 0){
_local5 = 0;
while (_local5 < post.length) {
_local8 = post[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local8) == 0){
_local1.push(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
};
return (_local1.join("&"));
}
public function decode(_arg1:String):void{
var _local2:Array;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Array;
if (_arg1 == ""){
return;
};
if (_arg1.indexOf("&") > -1){
_local2 = _arg1.split("&");
} else {
_local2 = [_arg1];
};
var _local7:int;
while (_local7 < _local2.length) {
_local3 = _local2[_local7];
if (_local3.indexOf("=") > -1){
_local6 = _local3.split("=");
_local4 = _local6[0];
_local5 = decodeURI(_local6[1]);
this[_local4] = _local5;
};
_local7++;
};
}
public function toURLVariables():URLVariables{
var _local2:String;
var _local1:URLVariables = new URLVariables();
for (_local2 in this) {
_local1[_local2] = this[_local2];
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 62
//Version (com.google.analytics.utils.Version)
package com.google.analytics.utils {
public class Version {
private var _revision:uint;
private var _maxBuild:uint;// = 0xFF
private var _maxMinor:uint;// = 15
private var _maxMajor:uint;// = 15
private var _separator:String;// = "."
private var _maxRevision:uint;// = 0xFFFF
private var _build:uint;
private var _major:uint;
private var _minor:uint;
public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){
var _local5:Version;
super();
if ((((((((_arg1 > _maxMajor)) && ((_arg2 == 0)))) && ((_arg3 == 0)))) && ((_arg4 == 0)))){
_local5 = Version.fromNumber(_arg1);
_arg1 = _local5.major;
_arg2 = _local5.minor;
_arg3 = _local5.build;
_arg4 = _local5.revision;
};
this.major = _arg1;
this.minor = _arg2;
this.build = _arg3;
this.revision = _arg4;
}
public function toString(_arg1:int=0):String{
var _local2:Array;
if ((((_arg1 <= 0)) || ((_arg1 > 4)))){
_arg1 = getFields();
};
switch (_arg1){
case 1:
_local2 = [major];
break;
case 2:
_local2 = [major, minor];
break;
case 3:
_local2 = [major, minor, build];
break;
case 4:
default:
_local2 = [major, minor, build, revision];
};
return (_local2.join(_separator));
}
public function set revision(_arg1:uint):void{
_revision = Math.min(_arg1, _maxRevision);
}
public function get revision():uint{
return (_revision);
}
public function set build(_arg1:uint):void{
_build = Math.min(_arg1, _maxBuild);
}
public function set minor(_arg1:uint):void{
_minor = Math.min(_arg1, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(_arg1:uint):void{
_major = Math.min(_arg1, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
private function getFields():int{
var _local1 = 4;
if (revision == 0){
_local1--;
};
if ((((_local1 == 3)) && ((build == 0)))){
_local1--;
};
if ((((_local1 == 2)) && ((minor == 0)))){
_local1--;
};
return (_local1);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function equals(_arg1):Boolean{
if (!(_arg1 is Version)){
return (false);
};
if ((((((((_arg1.major == major)) && ((_arg1.minor == minor)))) && ((_arg1.build == build)))) && ((_arg1.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(_arg1:String="", _arg2:String="."):Version{
var _local4:Array;
var _local3:Version = new (Version);
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (_local3);
};
if (_arg1.indexOf(_arg2) > -1){
_local4 = _arg1.split(_arg2);
_local3.major = parseInt(_local4[0]);
_local3.minor = parseInt(_local4[1]);
_local3.build = parseInt(_local4[2]);
_local3.revision = parseInt(_local4[3]);
} else {
_local3.major = parseInt(_arg1);
};
return (_local3);
}
public static function fromNumber(_arg1:Number=0):Version{
var _local2:Version = new (Version);
if (((((((((((isNaN(_arg1)) || ((_arg1 == 0)))) || ((_arg1 < 0)))) || ((_arg1 == Number.MAX_VALUE)))) || ((_arg1 == Number.POSITIVE_INFINITY)))) || ((_arg1 == Number.NEGATIVE_INFINITY)))){
return (_local2);
};
_local2.major = (_arg1 >>> 28);
_local2.minor = ((_arg1 & 251658240) >>> 24);
_local2.build = ((_arg1 & 0xFF0000) >>> 16);
_local2.revision = (_arg1 & 0xFFFF);
return (_local2);
}
}
}//package com.google.analytics.utils
Section 63
//Bridge (com.google.analytics.v4.Bridge)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Bridge implements GoogleAnalyticsAPI {
private var _debug:DebugConfiguration;
private var _proxy:JavascriptProxy;
private var _jsContainer:String;// = "_GATracker"
private var _hasGATracker:Boolean;// = false
private var _account:String;
private static var _linkTrackingObject_js:XML = <script>
<![CDATA[
function( container , target )
{
var targets ;
var name ;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
window[container][target] = ref[name] ;
}
]]>
</script>
;
private static var _createTrackingObject_js:XML = <script>
<![CDATA[
function( acct )
{
_GATracker[acct] = _gat._getTracker(acct);
}
]]>
</script>
;
private static var _injectTrackingObject_js:XML = <script>
<![CDATA[
function()
{
try
{
_GATracker
}
catch(e)
{
_GATracker = {};
}
}
]]>
</script>
;
private static var _checkGAJS_js:XML = <script>
<![CDATA[
function()
{
if( _gat && _gat._getTracker )
{
return true;
}
return false;
}
]]>
</script>
;
private static var _checkValidTrackingObject_js:XML = <script>
<![CDATA[
function(acct)
{
if( _GATracker[acct] && (_GATracker[acct]._getAccount) )
{
return true ;
}
else
{
return false;
}
}
]]>
</script>
;
public function Bridge(_arg1:String, _arg2:DebugConfiguration, _arg3:JavascriptProxy){
var _local4:String;
var _local5:String;
var _local6:String;
super();
_account = _arg1;
_debug = _arg2;
_proxy = _arg3;
if (!_checkGAJS()){
_local4 = "";
_local4 = (_local4 + "ga.js not found, be sure to check if\n");
_local4 = (_local4 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
_local4 = (_local4 + "is included in the HTML.");
_debug.warning(_local4);
throw (new Error(_local4));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
_local5 = "";
_local5 = (_local5 + "The Google Analytics tracking code was not found on the container page\n");
_local5 = (_local5 + "we create it");
_debug.info(_local5, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(_arg1)){
_createTrackingObject(_arg1);
} else {
if (_checkTrackingObject(_arg1)){
_linkTrackingObject(_arg1);
} else {
_local6 = "";
_local6 = (_local6 + (("JS Object \"" + _arg1) + "\" doesn't exist in DOM\n"));
_local6 = (_local6 + "Bridge object not created.");
_debug.warning(_local6);
throw (new Error(_local6));
};
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.info((((("link( " + _arg1) + ", ") + _arg2) + " )"));
_call("_link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_call("_addOrganic", _arg1);
}
public function setAllowLinker(_arg1:Boolean):void{
_debug.info((("setAllowLinker( " + _arg1) + " )"));
_call("_setAllowLinker", _arg1);
}
private function _linkTrackingObject(_arg1:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5 = 2;
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = 3;
};
if ((((_local5 == 3)) && (!(isNaN(_arg4))))){
_local5 = 4;
};
switch (_local5){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3, _arg4));
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3));
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2));
};
}
public function setClientInfo(_arg1:Boolean):void{
_debug.info((("setClientInfo( " + _arg1) + " )"));
_call("_setClientInfo", _arg1);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function setCookieTimeout(_arg1:int):void{
_debug.info((("setCookieTimeout( " + _arg1) + " )"));
_call("_setCookieTimeout", _arg1);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
_call("_trackPageview", _arg1);
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _checkValidTrackingObject(_arg1:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, _arg1));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((((("linkByPost( " + _arg1) + ", ") + _arg2) + " ) not implemented"));
}
private function _call(_arg1:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + _arg1));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(_arg1:String):Boolean{
var _local2:Boolean = _proxy.hasProperty(_arg1);
var _local3:Boolean = _proxy.hasProperty((_arg1 + "._getAccount"));
return (((_local2) && (_local3)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(_arg1:String):void{
_debug.info((("setCampNameKey( " + _arg1) + " )"));
_call("_setCampNameKey", _arg1);
}
public function setDetectFlash(_arg1:Boolean):void{
_debug.info((("setDetectFlash( " + _arg1) + " )"));
_call("_setDetectFlash", _arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
_call("_addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(_arg1:String):void{
_debug.info((("setVar( " + _arg1) + " )"));
_call("_setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
_debug.info((("setDomainName( " + _arg1) + " )"));
_call("_setDomainName", _arg1);
}
public function hasTrackingAccount(_arg1:String):Boolean{
if (Utils.validateAccount(_arg1)){
return (_checkValidTrackingObject(_arg1));
};
return (_checkTrackingObject(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_debug.info((("setCampSourceKey( " + _arg1) + " )"));
_call("_setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " )"));
_call("_addTrans", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
return (null);
}
public function setCampContentKey(_arg1:String):void{
_debug.info((("setCampContentKey( " + _arg1) + " )"));
_call("_setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
_debug.info("setLocalServerMode()");
_call("_setLocalServerMode");
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_call("_getLocalGifPath"));
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_call("_clearIgnoreRef");
}
public function setAllowAnchor(_arg1:Boolean):void{
_debug.info((("setAllowAnchor( " + _arg1) + " )"));
_call("_setAllowAnchor", _arg1);
}
public function setLocalGifPath(_arg1:String):void{
_debug.info((("setLocalGifPath( " + _arg1) + " )"));
_call("_setLocalGifPath", _arg1);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(_arg1:String):void{
_debug.info((("setCookiePath( " + _arg1) + " )"));
_call("_setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
_debug.info((("setSampleRate( " + _arg1) + " )"));
_call("_setSampleRate", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_debug.info((("setAllowHash( " + _arg1) + " )"));
_call("_setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_call("_addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
_debug.info((("setCampNOKey( " + _arg1) + " )"));
_call("_setCampNOKey", _arg1);
}
public function cookiePathCopy(_arg1:String):void{
_debug.info((("cookiePathCopy( " + _arg1) + " )"));
_call("_cookiePathCopy", _arg1);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(_arg1:Boolean):void{
_debug.info((("setDetectTitle( " + _arg1) + " )"));
_call("_setDetectTitle", _arg1);
}
private function _createTrackingObject(_arg1:String):void{
_proxy.call(_createTrackingObject_js, _arg1);
}
public function setCampaignTrack(_arg1:Boolean):void{
_debug.info((("setCampaignTrack( " + _arg1) + " )"));
_call("_setCampaignTrack", _arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
_debug.info((("setCampTermKey( " + _arg1) + " )"));
_call("_setCampTermKey", _arg1);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(_arg1:String):void{
_debug.info((("setCampMediumKey( " + _arg1) + " )"));
_call("_setCampMediumKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_call("_addIgnoredRef", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
_debug.info((("setSessionTimeout( " + _arg1) + " )"));
_call("_setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
_debug.info("setRemoteServerMode()");
_call("_setRemoteServerMode");
}
public function getAccount():String{
_debug.info("getAccount()");
return (_call("_getAccount"));
}
}
}//package com.google.analytics.v4
Section 64
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.utils.*;
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.campaign.*;
public class Configuration {
public var serverMode:ServerOperationMode;
public var detectFlash:Boolean;// = true
public var hasSiteOverlay:Boolean;// = false
public var allowLocalTracking:Boolean;// = true
public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif"
private var _version:String;// = "4.3as"
public var allowDomainHash:Boolean;// = true
public var detectClientInfo:Boolean;// = true
public var idleLoop:Number;// = 30
public var isTrackOutboundSubdomains:Boolean;// = false
public var cookiePath:String;// = "/"
public var transactionFieldDelim:String;// = "|"
private var _organic:Organic;
private var _cookieName:String;// = "analytics"
public var campaignKey:CampaignKey;
public var google:String;// = "google"
public var googleCsePath:String;// = "cse"
public var bucketCapacity:Number;// = 10
private var _sampleRate:Number;// = 1
public var remoteGIFpath:String;// = "http://www.google-analytics.com/__utm.gif"
public var googleSearchParam:String;// = "q"
public var allowLinker:Boolean;// = false
public var maxOutboundLinkExamined:Number;// = 1000
private var _debug:DebugConfiguration;
public var allowAnchor:Boolean;// = false
private var _domain:Domain;
private var _trackingLimitPerSession:int;// = 500
public var tokenCliff:int;// = 10
public var sessionTimeout:Number;
public var idleTimeout:Number;// = 60
public var campaignTracking:Boolean;// = true
public var domainName:String;// = ""
public var detectTitle:Boolean;// = true
public var tokenRate:Number;// = 0.2
public var conversionTimeout:Number;
public var localGIFpath:String;// = "/__utm.gif"
public function Configuration(_arg1:DebugConfiguration=null){
_organic = new Organic();
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
campaignKey = new CampaignKey();
serverMode = ServerOperationMode.remote;
super();
_debug = _arg1;
_domain = new Domain(DomainNameMode.auto, "", _debug);
serverMode = ServerOperationMode.remote;
_initOrganicSources();
}
public function get organic():Organic{
return (_organic);
}
public function get cookieName():String{
return (_cookieName);
}
public function get trackingLimitPerSession():int{
return (_trackingLimitPerSession);
}
private function _initOrganicSources():void{
addOrganicSource(google, googleSearchParam);
addOrganicSource("yahoo", "p");
addOrganicSource("msn", "q");
addOrganicSource("aol", "query");
addOrganicSource("aol", "encquery");
addOrganicSource("lycos", "query");
addOrganicSource("ask", "q");
addOrganicSource("altavista", "q");
addOrganicSource("netscape", "query");
addOrganicSource("cnn", "query");
addOrganicSource("looksmart", "qt");
addOrganicSource("about", "terms");
addOrganicSource("mamma", "query");
addOrganicSource("alltheweb", "q");
addOrganicSource("gigablast", "q");
addOrganicSource("voila", "rdata");
addOrganicSource("virgilio", "qs");
addOrganicSource("live", "q");
addOrganicSource("baidu", "wd");
addOrganicSource("alice", "qs");
addOrganicSource("yandex", "text");
addOrganicSource("najdi", "q");
addOrganicSource("aol", "q");
addOrganicSource("club-internet", "q");
addOrganicSource("mama", "query");
addOrganicSource("seznam", "q");
addOrganicSource("search", "q");
addOrganicSource("wp", "szukaj");
addOrganicSource("onet", "qt");
addOrganicSource("netsprint", "q");
addOrganicSource("google.interia", "q");
addOrganicSource("szukacz", "q");
addOrganicSource("yam", "k");
addOrganicSource("pchome", "q");
addOrganicSource("kvasir", "searchExpr");
addOrganicSource("sesam", "q");
addOrganicSource("ozu", "q");
addOrganicSource("terra", "query");
addOrganicSource("nostrum", "query");
addOrganicSource("mynet", "q");
addOrganicSource("ekolay", "q");
addOrganicSource("search.ilse", "search_for");
}
public function get sampleRate():Number{
return (_sampleRate);
}
public function addOrganicSource(_arg1:String, _arg2:String):void{
var engine = _arg1;
var keyword = _arg2;
try {
_organic.addSource(engine, keyword);
} catch(e:Error) {
if (((_debug) && (_debug.active))){
_debug.warning(e.message);
};
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(_arg1:Number):void{
if (_arg1 <= 0){
_arg1 = 0.1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = Number(_arg1.toFixed(2));
_sampleRate = _arg1;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 65
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(_arg1:String):void;
function getServiceMode():ServerOperationMode;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(_arg1:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(_arg1:Boolean):void;
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object;
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean;
function setCampTermKey(_arg1:String):void;
function setCampNameKey(_arg1:String):void;
function addIgnoredOrganic(_arg1:String):void;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function setAllowLinker(_arg1:Boolean):void;
function getClientInfo():Boolean;
function getDetectFlash():Boolean;
function setCampaignTrack(_arg1:Boolean):void;
function createEventTracker(_arg1:String):EventTracker;
function setCookieTimeout(_arg1:int):void;
function setAllowAnchor(_arg1:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(_arg1:String=""):void;
function setLocalGifPath(_arg1:String):void;
function getVersion():String;
function getLocalGifPath():String;
function setVar(_arg1:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(_arg1:String):void;
function addIgnoredRef(_arg1:String):void;
function setClientInfo(_arg1:Boolean):void;
function setCookiePath(_arg1:String):void;
function setSampleRate(_arg1:Number):void;
function setSessionTimeout(_arg1:int):void;
function setRemoteServerMode():void;
function clearIgnoredRef():void;
function setDomainName(_arg1:String):void;
function setDetectTitle(_arg1:Boolean):void;
function setAllowHash(_arg1:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(_arg1:String):void;
function setLocalRemoteServerMode():void;
function cookiePathCopy(_arg1:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 66
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import com.google.analytics.utils.*;
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.data.*;
import com.google.analytics.external.*;
import com.google.analytics.campaign.*;
public class Tracker implements GoogleAnalyticsAPI {
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3;
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1;
private const EVENT_TRACKER_PROJECT_ID:int = 5;
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1;
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2;
private var _adSense:AdSenseGlobals;
private var _eventTracker:X10;
private var _noSessionInformation:Boolean;// = false
private var _browserInfo:BrowserInfo;
private var _debug:DebugConfiguration;
private var _isNewVisitor:Boolean;// = false
private var _buffer:Buffer;
private var _config:Configuration;
private var _x10Module:X10;
private var _campaign:CampaignManager;
private var _formatedReferrer:String;
private var _timeStamp:Number;
private var _info:Environment;
private var _domainHash:Number;
private var _campaignInfo:CampaignInfo;
private var _gifRequest:GIFRequest;
private var _hasInitData:Boolean;// = false
private var _account:String;
public function Tracker(_arg1:String, _arg2:Configuration, _arg3:DebugConfiguration, _arg4:Environment, _arg5:Buffer, _arg6:GIFRequest, _arg7:AdSenseGlobals){
var _local8:String;
super();
_account = _arg1;
_config = _arg2;
_debug = _arg3;
_info = _arg4;
_buffer = _arg5;
_gifRequest = _arg6;
_adSense = _arg7;
if (!Utils.validateAccount(_arg1)){
_local8 = (("Account \"" + _arg1) + "\" is not valid.");
_debug.warning(_local8);
throw (new Error(_local8));
};
_initData();
}
private function _doTracking():Boolean{
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){
return (true);
};
if (_config.allowLocalTracking){
return (true);
};
return (false);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_config.organic.addSource(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_config.allowLinker = _arg1;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5:Boolean;
var _local6 = 2;
if (((!((_arg1 == ""))) && (!((_arg2 == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, _arg1);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, _arg2);
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, _arg3);
_local6 = 3;
if (!isNaN(_arg4)){
_local5 = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, _arg4);
_local6 = 4;
};
};
if (_local5){
_debug.info(((("valid event tracking call\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_local5 = false;
};
switch (_local6){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
};
return (_local5);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(_arg1);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + _arg1) + " ) failed"));
};
}
public function setCookieTimeout(_arg1:int):void{
_config.conversionTimeout = _arg1;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
_debug.warning("trackTrans() not implemented");
}
public function setClientInfo(_arg1:Boolean):void{
_config.detectClientInfo = _arg1;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((("linkByPost( " + [_arg1, _arg2].join(", ")) + " ) not implemented"));
}
private function _initData():void{
var _local1:String;
var _local2:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "_initData 0");
_local1 = (_local1 + ("\ndomain name: " + _config.domainName));
_local1 = (_local1 + ("\ndomain hash: " + _domainHash));
_local1 = (_local1 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_doTracking()){
_handleCookie();
};
if (!_hasInitData){
if (_doTracking()){
_formatedReferrer = _formatReferrer();
_browserInfo = new BrowserInfo(_config, _info);
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced);
if (_config.campaignTracking){
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp);
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation);
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced);
};
};
_x10Module = new X10();
_eventTracker = new X10();
_hasInitData = true;
};
if (_config.hasSiteOverlay){
_debug.warning("Site Overlay is not supported");
};
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "_initData (misc)");
_local2 = (_local2 + ("\nflash version: " + _info.flashVersion.toString(4)));
_local2 = (_local2 + ("\nprotocol: " + _info.protocol));
_local2 = (_local2 + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
_local2 = (_local2 + ("\nlanguage: " + _info.language));
_local2 = (_local2 + ("\ndomain hash: " + _getDomainHash()));
_local2 = (_local2 + ("\nuser-agent: " + _info.userAgent));
_debug.info(_local2, VisualDebugMode.geek);
};
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_config.detectTitle);
}
public function resetSession():void{
_debug.info("resetSession()");
_buffer.resetCurrentSession();
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_config.detectClientInfo);
}
private function _sendXEvent(_arg1:X10=null):void{
var _local2:Variables;
var _local3:EventInfo;
var _local4:Variables;
var _local5:Variables;
_initData();
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
_local3 = new EventInfo(true, _x10Module, _arg1);
_local4 = _local3.toVariables();
_local5 = _renderMetricsSearchVariables();
_local2.join(_local4, _local5);
_gifRequest.send(_account, _local2, false, true);
};
}
public function setDetectFlash(_arg1:Boolean):void{
_config.detectFlash = _arg1;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(_arg1:String):void{
_config.campaignKey.UCCN = _arg1;
var _local2 = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCN]"));
} else {
_debug.info(_local2);
};
}
private function _formatReferrer():String{
var _local2:String;
var _local3:URL;
var _local4:URL;
var _local1:String = _info.referrer;
if ((((_local1 == "")) || ((_local1 == "localhost")))){
_local1 = "-";
} else {
_local2 = _info.domainName;
_local3 = new URL(_local1);
_local4 = new URL(("http://" + _local2));
if (_local3.hostName == _local2){
return ("-");
};
if (_local4.domain == _local3.domain){
if (_local4.subDomain != _local3.subDomain){
_local1 = "0";
};
};
if ((((_local1.charAt(0) == "[")) && (_local1.charAt((_local1.length - 1))))){
_local1 = "-";
};
};
_debug.info(("formated referrer: " + _local1), VisualDebugMode.advanced);
return (_local1);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.warning((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " ) not implemented"));
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(_arg1:String):void{
var _local2:Variables;
if (((!((_arg1 == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = _arg1;
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + _arg1) + " )"));
if (_takeSample()){
_local2 = new Variables();
_local2.utmt = "var";
_gifRequest.send(_account, _local2);
};
} else {
_debug.warning((("setVar \"" + _arg1) + "\" is ignored"));
};
}
public function setDomainName(_arg1:String):void{
if (_arg1 == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (_arg1 == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = _arg1;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var _local1:String;
if (_config.domain.mode == DomainNameMode.auto){
_local1 = _info.domainName;
if (_local1.substring(0, 4) == "www."){
_local1 = _local1.substring(4);
};
_config.domain.name = _local1;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
_debug.warning((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " ) not implemented"));
return (null);
}
private function _renderMetricsSearchVariables(_arg1:String=""):Variables{
var _local4:Variables;
var _local2:Variables = new Variables();
_local2.URIencode = true;
var _local3:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, _arg1, _adSense);
_debug.info(("docInfo: " + _local3.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
_local4 = _campaignInfo.toVariables();
};
var _local5:Variables = _browserInfo.toVariables();
_local2.join(_local3.toVariables(), _local5, _local4);
return (_local2);
}
public function setCampContentKey(_arg1:String):void{
_config.campaignKey.UCCT = _arg1;
var _local2 = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCT]"));
} else {
_debug.info(_local2);
};
}
private function _handleCookie():void{
var _local1:String;
var _local2:String;
var _local3:Array;
var _local4:String;
if (_config.allowLinker){
};
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){
_buffer.updateUTMA(_timeStamp);
_noSessionInformation = true;
};
if (_debug.verbose){
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek);
};
} else {
_debug.info("create a new utma", VisualDebugMode.advanced);
_buffer.utma.domainHash = _domainHash;
_buffer.utma.sessionId = _getUniqueSessionId();
_buffer.utma.firstTime = _timeStamp;
_buffer.utma.lastTime = _timeStamp;
_buffer.utma.currentTime = _timeStamp;
_buffer.utma.sessionCount = 1;
if (_debug.verbose){
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek);
};
_noSessionInformation = true;
_isNewVisitor = true;
};
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){
if (_adSense.sid){
_buffer.utma.currentTime = Number(_adSense.sid);
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "AdSense sid found\n");
_local1 = (_local1 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "AdSense sid found (new visitor)\n");
_local2 = (_local2 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local2, VisualDebugMode.geek);
};
};
if (_adSense.vid){
_local3 = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(_local3[0]);
_buffer.utma.firstTime = Number(_local3[1]);
if (_debug.verbose){
_local4 = "";
_local4 = (_local4 + "AdSense vid found (new visitor)\n");
_local4 = (_local4 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(_local3[0])) + ")\n"));
_local4 = (_local4 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(_local3[1])) + ")"));
_debug.info(_local4, VisualDebugMode.geek);
};
};
if (_debug.verbose){
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek);
};
};
};
_buffer.utmb.domainHash = _domainHash;
if (isNaN(_buffer.utmb.trackCount)){
_buffer.utmb.trackCount = 0;
};
if (isNaN(_buffer.utmb.token)){
_buffer.utmb.token = _config.tokenCliff;
};
if (isNaN(_buffer.utmb.lastTime)){
_buffer.utmb.lastTime = _buffer.utma.currentTime;
};
_buffer.utmc.domainHash = _domainHash;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced);
};
}
public function setLocalServerMode():void{
_config.serverMode = ServerOperationMode.local;
_debug.info("setLocalServerMode()");
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_config.organic.clearIgnoredReferrals();
}
public function setCampSourceKey(_arg1:String):void{
_config.campaignKey.UCSR = _arg1;
var _local2 = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCSR]"));
} else {
_debug.info(_local2);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(_arg1:String):void{
_config.localGIFpath = _arg1;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(_arg1:Boolean):void{
_config.allowAnchor = _arg1;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var _local1:String = _config.domainName;
var _local2 = (_local1.indexOf("www.google.") < 0);
var _local3 = (_local1.indexOf(".google.") < 0);
var _local4 = (_local1.indexOf("google.") < 0);
var _local5 = (_local1.indexOf("google.org") > -1);
return (((((((((_local2) || (_local3))) || (_local4))) || (!((_config.cookiePath == "/"))))) || (_local5)));
}
public function setSampleRate(_arg1:Number):void{
if (_arg1 < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = _arg1;
};
_debug.info((("setSampleRate( " + _config.sampleRate) + " )"));
}
private function _takeSample():Boolean{
if (_debug.verbose){
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek);
};
return (((_visitCode() % 10000) < (_config.sampleRate * 10000)));
}
public function setCookiePath(_arg1:String):void{
_config.cookiePath = _arg1;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(_arg1:Boolean):void{
_config.allowDomainHash = _arg1;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var _local1 = "";
_local1 = (_local1 + _info.appName);
_local1 = (_local1 + _info.appVersion);
_local1 = (_local1 + _info.language);
_local1 = (_local1 + _info.platform);
_local1 = (_local1 + _info.userAgent.toString());
_local1 = (_local1 + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
_local1 = (_local1 + _info.referrer);
return (Utils.generateHash(_local1));
}
public function setCampNOKey(_arg1:String):void{
_config.campaignKey.UCNO = _arg1;
var _local2 = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCNO]"));
} else {
_debug.info(_local2);
};
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_config.organic.addIgnoredKeyword(_arg1);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(_arg1:String):void{
_debug.warning((("cookiePathCopy( " + _arg1) + " ) not implemented"));
}
public function setDetectTitle(_arg1:Boolean):void{
_config.detectTitle = _arg1;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(_arg1:String):void{
_config.campaignKey.UCTR = _arg1;
var _local2 = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCTR]"));
} else {
_debug.info(_local2);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(_arg1:String=""):void{
var _local2:Variables;
var _local3:Variables;
var _local4:Variables;
var _local5:EventInfo;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
_local5 = new EventInfo(false, _x10Module);
_local3 = _local5.toVariables();
};
_local4 = _renderMetricsSearchVariables(_arg1);
_local2.join(_local3, _local4);
_gifRequest.send(_account, _local2);
};
}
public function setCampaignTrack(_arg1:Boolean):void{
_config.campaignTracking = _arg1;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_config.organic.addIgnoredReferral(_arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(_arg1:String):void{
_config.campaignKey.UCMD = _arg1;
var _local2 = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCMD]"));
} else {
_debug.info(_local2);
};
}
private function _getUniqueSessionId():Number{
var _local1:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + _local1), VisualDebugMode.geek);
return (_local1);
}
private function _getDomainHash():Number{
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){
_config.domainName = "";
return (1);
};
_updateDomainName();
if (_config.allowDomainHash){
return (Utils.generateHash(_config.domainName));
};
return (1);
}
public function setSessionTimeout(_arg1:int):void{
_config.sessionTimeout = _arg1;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.warning((("link( " + [_arg1, _arg2].join(", ")) + " ) not implemented"));
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 67
//AnalyticsTracker (com.google.analytics.AnalyticsTracker)
package com.google.analytics {
import flash.events.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher {
function set account(_arg1:String):void;
function get config():Configuration;
function get mode():String;
function set config(_arg1:Configuration):void;
function set mode(_arg1:String):void;
function set debug(_arg1:DebugConfiguration):void;
function get visualDebug():Boolean;
function get account():String;
function set visualDebug(_arg1:Boolean):void;
function isReady():Boolean;
function get debug():DebugConfiguration;
}
}//package com.google.analytics
Section 68
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 69
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
import com.google.analytics.utils.*;
import flash.display.*;
import flash.events.*;
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import com.google.analytics.events.*;
public class GATracker implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
private var _visualDebug:Boolean;
private var _idleTimer:IdleTimer;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _config:Configuration;
private var _mode:String;
private var _display:DisplayObject;
private var _jsproxy:JavascriptProxy;
private var _dom:HTMLDOM;
private var _eventDispatcher:EventDispatcher;
private var _ready:Boolean;// = false
private var _gifRequest:GIFRequest;
private var _account:String;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public static var autobuild:Boolean = true;
public function GATracker(_arg1:DisplayObject, _arg2:String, _arg3:String="AS3", _arg4:Boolean=false, _arg5:Configuration=null, _arg6:DebugConfiguration=null){
_display = _arg1;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = _arg2;
this.mode = _arg3;
this.visualDebug = _arg4;
if (!_arg6){
this.debug = new DebugConfiguration();
};
if (!_arg5){
this.config = new Configuration(_arg6);
};
if (autobuild){
_factory();
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_tracker.link(_arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_tracker.addOrganic(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_tracker.setAllowLinker(_arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4));
}
public function setCookieTimeout(_arg1:int):void{
_tracker.setCookieTimeout(_arg1);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function trackPageview(_arg1:String=""):void{
_tracker.trackPageview(_arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_tracker.setClientInfo(_arg1);
}
public function get account():String{
return (_account);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_tracker.linkByPost(_arg1, _arg2);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_eventDispatcher.dispatchEvent(_arg1));
}
public function get config():Configuration{
return (_config);
}
public function set mode(_arg1:String):void{
_mode = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function setDetectFlash(_arg1:Boolean):void{
_tracker.setDetectFlash(_arg1);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(_arg1:String):void{
_tracker.setCampNameKey(_arg1);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function set account(_arg1:String):void{
_account = _arg1;
}
public function setVar(_arg1:String):void{
_tracker.setVar(_arg1);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function setDomainName(_arg1:String):void{
_tracker.setDomainName(_arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
return (_tracker.createEventTracker(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_tracker.setCampSourceKey(_arg1);
}
public function set config(_arg1:Configuration):void{
_config = _arg1;
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
return (_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8));
}
public function setCampContentKey(_arg1:String):void{
_tracker.setCampContentKey(_arg1);
}
public function willTrigger(_arg1:String):Boolean{
return (_eventDispatcher.willTrigger(_arg1));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(_arg1:Boolean):void{
_tracker.setAllowAnchor(_arg1);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function isReady():Boolean{
return (_ready);
}
public function get mode():String{
return (_mode);
}
public function set debug(_arg1:DebugConfiguration):void{
_debug = _arg1;
}
public function setLocalGifPath(_arg1:String):void{
_tracker.setLocalGifPath(_arg1);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(_arg1:Number):void{
_tracker.setSampleRate(_arg1);
}
public function setCookiePath(_arg1:String):void{
_tracker.setCookiePath(_arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_tracker.setAllowHash(_arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_tracker.addIgnoredOrganic(_arg1);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(_arg1:String):void{
_tracker.cookiePathCopy(_arg1);
}
private function _factory():void{
var _local1:GoogleAnalyticsAPI;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
var _local2:TrackerCache = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
_local1 = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
_local1 = _trackerFactory();
};
if (!_local2.isEmpty()){
_local2.tracker = _local1;
_local2.flush();
};
_tracker = _local1;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(_arg1:String):void{
_tracker.setCampTermKey(_arg1);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense));
}
public function setCampNOKey(_arg1:String):void{
_tracker.setCampNOKey(_arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
_tracker.setDetectTitle(_arg1);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(_arg1:Boolean):void{
_tracker.setCampaignTrack(_arg1);
}
public function addIgnoredRef(_arg1:String):void{
_tracker.addIgnoredRef(_arg1);
}
public function set visualDebug(_arg1:Boolean):void{
_visualDebug = _arg1;
}
public function setCampMediumKey(_arg1:String):void{
_tracker.setCampMediumKey(_arg1);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function setSessionTimeout(_arg1:int):void{
_tracker.setSessionTimeout(_arg1);
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 70
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var cpmstarLoader:Loader;
private var contentspotid:String;
public function AdLoader(_arg1:String){
this.contentspotid = _arg1;
addEventListener(Event.ADDED, addedHandler);
}
private function dispatchHandler(_arg1:Event):void{
dispatchEvent(_arg1);
}
private function addedHandler(_arg1:Event):void{
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
var _local2 = "http://server.cpmstar.com/adviewas3.swf";
var _local3:DisplayObjectContainer = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((_local2 + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
}
}//package CPMStar
Section 71
//GameTracker (FGL.GameTracker.GameTracker)
package FGL.GameTracker {
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.external.*;
public class GameTracker extends EventDispatcher {
protected var _passphrase:String;// = ""
protected var _responder:Responder;// = null
protected var _timer:Timer;// = null
protected var _serverVersionMajor:int;// = 0
protected var _conn:NetConnection;// = null
protected var _currentGame:int;// = 1
protected var _msg_queue:Array;
protected var _inGame:Boolean;// = false
protected var _inLevel:Boolean;// = false
protected var _serviceName:String;// = ""
protected var _currentLevel:int;// = 0
protected var _hostUrl:String;// = ""
protected var _sessionID:uint;
protected var _isEnabled:Boolean;// = false
protected var _serverVersionMinor:int;// = 0
public static const GAMETRACKER_SERVER_ERROR:String = "gametracker_server_error";
private static const TIMER_DELAY:int = 15000;
public static const GAMETRACKER_CODING_ERROR:String = "gametracker_coding_error";
public function GameTracker(){
_msg_queue = new Array();
super();
setGlobalConfig();
if (_isEnabled){
_responder = new Responder(onSuccess, onNetworkingError);
_conn = new NetConnection();
_conn.connect(_hostUrl);
_timer = new Timer(TIMER_DELAY);
_timer.addEventListener("timer", onTimer);
_timer.start();
_sessionID = Math.floor((new Date().getTime() / 1000));
addToMsgQueue("begin_app", null, 0, null, null);
};
}
public function beginGame(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
if (_inGame){
endGame(_arg1, _arg2, "AUTO:(this game automatically ended when new game was started)");
};
_currentGame++;
_inGame = true;
addToMsgQueue("begin_game", null, _arg1, _arg2, _arg3);
}
protected function setGlobalConfig():void{
var ret:Array;
_isEnabled = false;
_serverVersionMajor = 0;
_serverVersionMinor = 0;
_hostUrl = "";
_serviceName = "";
_passphrase = "";
try {
if (ExternalInterface.available){
ret = ExternalInterface.call("get_gametracker_info");
_serverVersionMajor = ret[0];
_serverVersionMinor = ret[1];
_hostUrl = ret[2];
_serviceName = ret[3];
_passphrase = ret[4];
_isEnabled = (_serverVersionMajor == 1);
};
} catch(e) {
};
}
public function checkpoint(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
if (!_inGame){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "checkpoint() called before startGame() was called!"));
} else {
addToMsgQueue("checkpoint", null, _arg1, _arg2, _arg3);
};
}
protected function onNetworkingError(_arg1):void{
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_SERVER_ERROR, "Networking error"));
}
protected function submitMsgQueue():void{
var _local1:Object;
if (((_isEnabled) && ((_msg_queue.length > 0)))){
_local1 = new Object();
_local1["actions"] = _msg_queue;
_local1["identifier"] = _passphrase;
_conn.call(_serviceName, _responder, _local1);
_msg_queue = new Array();
};
}
public function customMsg(_arg1:String, _arg2:Number=0, _arg3:String=null, _arg4:String=null):void{
addToMsgQueue("custom", _arg1, _arg2, _arg3, _arg4);
}
public function beginLevel(_arg1:int, _arg2:Number=0, _arg3:String=null, _arg4:String=null):void{
if (!_inGame){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "beginLevel() called before beginGame() was called!"));
} else {
if (_inLevel){
endLevel(_arg2, _arg3, "AUTO:(this level automatically ended when new level was started)");
} else {
_currentLevel = _arg1;
_inLevel = true;
addToMsgQueue("begin_level", null, _arg2, _arg3, _arg4);
};
};
}
public function alert(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
addToMsgQueue("alert", null, _arg1, _arg2, _arg3);
submitMsgQueue();
}
protected function onTimer(_arg1:TimerEvent):void{
submitMsgQueue();
}
public function endLevel(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
if (!_inLevel){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "endLevel() called before beginLevel() was called!"));
} else {
_inLevel = false;
addToMsgQueue("end_level", null, _arg1, _arg2, _arg3);
};
}
protected function onSuccess(_arg1):void{
if (_arg1.toString() != ""){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_SERVER_ERROR, _arg1.toString()));
};
}
protected function addToMsgQueue(_arg1:String, _arg2:String, _arg3:Number, _arg4:String, _arg5:String):void{
var _local6:Object;
if (_isEnabled){
_local6 = new Object();
_local6["action"] = _arg1;
_local6["custom_action"] = _arg2;
_local6["session_id"] = _sessionID;
_local6["game_idx"] = _currentGame;
_local6["level"] = _currentLevel;
_local6["score"] = _arg3;
_local6["game_state"] = _arg4;
_local6["time"] = Math.floor((new Date().getTime() / 1000));
_local6["msg"] = _arg5;
_msg_queue.push(_local6);
};
}
public function endGame(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{
if (!_inGame){
dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "endGame() called before beginGame() was called!"));
} else {
if (_inLevel){
endLevel(_arg1, _arg2, "AUTO:(this level automatically ended when game ended)");
};
addToMsgQueue("end_game", null, _arg1, _arg2, _arg3);
_inGame = false;
submitMsgQueue();
};
}
public function isEnabled():Boolean{
return (_isEnabled);
}
}
}//package FGL.GameTracker
Section 72
//GameTrackerErrorEvent (FGL.GameTracker.GameTrackerErrorEvent)
package FGL.GameTracker {
import flash.events.*;
public class GameTrackerErrorEvent extends Event {
public var _msg:String;
public function GameTrackerErrorEvent(_arg1:String, _arg2:String){
_msg = _arg2;
super(_arg1, false, false);
}
}
}//package FGL.GameTracker
Section 73
//Boats (game.credits.Boats)
package game.credits {
import flash.display.*;
import flash.events.*;
public class Boats extends MovieClip {
public var b:MovieClip;
private var boatNum:int;
private var boatSpeed:Number;
public function Boats(_arg1){
boatNum = _arg1;
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, clean, false, 0, true);
}
private function init(_arg1:Event){
gotoAndStop(boatNum);
if ((((((((boatNum == 1)) || ((boatNum == 3)))) || ((boatNum == 4)))) || ((boatNum == 5)))){
boatSpeed = 0.2;
addEventListener(Event.ENTER_FRAME, moveSlow);
} else {
if (boatNum == 2){
boatSpeed = 1;
addEventListener(Event.ENTER_FRAME, moveBoat1);
};
};
}
private function moveBoat2(_arg1:Event){
if (this.x > 160){
this.x = (this.x - boatSpeed);
} else {
this.x = (this.x - boatSpeed);
boatSpeed = (boatSpeed - 0.05);
if (boatSpeed <= 0){
boatSpeed = 0;
removeEventListener(Event.ENTER_FRAME, moveBoat2);
b.gotoAndPlay("oups");
};
};
}
private function clean(_arg1:Event){
if ((((((((boatNum == 1)) || ((boatNum == 3)))) || ((boatNum == 4)))) || ((boatNum == 5)))){
removeEventListener(Event.ENTER_FRAME, moveSlow);
} else {
if (boatNum == 2){
removeEventListener(Event.ENTER_FRAME, moveBoat1);
};
};
}
private function moveSlow(_arg1:Event){
this.x = (this.x + boatSpeed);
}
private function moveBoat1(_arg1:Event){
if (this.x < 640){
this.x = (this.x + boatSpeed);
} else {
this.scaleX = -1;
this.x = 560;
removeEventListener(Event.ENTER_FRAME, moveBoat1);
addEventListener(Event.ENTER_FRAME, moveBoat2);
};
}
}
}//package game.credits
Section 74
//CreditRoll (game.credits.CreditRoll)
package game.credits {
import flash.display.*;
import flash.events.*;
public class CreditRoll extends MovieClip {
private var frames:int;// = 9
private var fadeSpeed:Number;// = 0.03
public var completed:Boolean;// = false
private var waitCount:int;// = 0
private var waitLength:int;// = 100
public function CreditRoll(){
stop();
this.alpha = 0;
addEventListener(Event.ENTER_FRAME, fadeIn);
}
private function fadeIn(_arg1:Event){
this.alpha = (this.alpha + fadeSpeed);
if (this.alpha >= 1){
this.alpha = 1;
waitCount = 0;
removeEventListener(Event.ENTER_FRAME, fadeIn);
addEventListener(Event.ENTER_FRAME, wait);
};
}
private function wait(_arg1:Event){
if (waitCount == waitLength){
if (currentFrame == frames){
completed = true;
removeEventListener(Event.ENTER_FRAME, wait);
} else {
removeEventListener(Event.ENTER_FRAME, wait);
addEventListener(Event.ENTER_FRAME, fadeOut);
};
};
waitCount++;
}
private function fadeOut(_arg1:Event){
this.alpha = (this.alpha - fadeSpeed);
if (this.alpha <= 0){
this.alpha = 0;
nextFrame();
removeEventListener(Event.ENTER_FRAME, fadeOut);
addEventListener(Event.ENTER_FRAME, fadeIn);
};
}
}
}//package game.credits
Section 75
//Credits (game.credits.Credits)
package game.credits {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import game.*;
public class Credits extends MovieClip {
public var bSkip:SimpleButton;
private var buttonsTimer:Timer;
private var textRoll:CreditRoll;
private var light:Light;
private var animLength:int;// = 1200
private var launcher:launch;
private var submitScore:Boolean;
private var Sounds:SoundManager;
private var count:int;// = 0
private var fadeOut:FinalFade;
public function Credits(_arg1, _arg2, _arg3){
Sounds = SoundManager.getInstance();
buttonsTimer = new Timer(4000, 1);
textRoll = new CreditRoll();
light = new Light();
fadeOut = new FinalFade();
super();
this.submitScore = _arg3;
this.launcher = _arg1;
this.launcher.recordEnding(_arg2);
if (GameData.soundOn){
Sounds.playSound("endCredits", 1, 0, 99999);
Sounds.fadeSound("endCredits", 1, 1);
};
var _local4:Boats = new Boats(_arg2);
addChild(textRoll);
addChild(_local4);
addChild(light);
addEventListener(Event.ENTER_FRAME, waitForEnd);
bSkip.addEventListener(MouseEvent.CLICK, skipAnim);
buttonsTimer.addEventListener("timer", buttonsAppear);
}
private function backToMainMenu(_arg1:MouseEvent){
trace(submitScore);
if (submitScore){
launcher.submitFinalScore();
};
launcher.clearSaveData();
launcher.returnToMainMenu();
}
private function goToSponsor(_arg1:MouseEvent){
GameData.googleTrack("Click Sponsor's link", "SponsorCredits", GameData.weekLeft);
MochiBot.track(this, "82d7307d");
navigateToURL(GameData.SponsorURL);
}
private function skipAnim(_arg1:MouseEvent){
textRoll.completed = true;
}
private function buttonsAppear(_arg1:TimerEvent){
fadeOut.bBack.visible = true;
if (GameData.nonex == false){
fadeOut.bSponsor.visible = true;
};
if (GameData.highestEnding == 5){
fadeOut.TryAgain.visible = false;
} else {
fadeOut.TryAgain.visible = true;
};
}
public function destroy(){
removeEventListener(Event.ENTER_FRAME, waitForEnd);
bSkip.removeEventListener(MouseEvent.CLICK, skipAnim);
fadeOut.bBack.removeEventListener(MouseEvent.CLICK, backToMainMenu);
if (GameData.nonex == false){
fadeOut.bSponsor.removeEventListener(MouseEvent.CLICK, goToSponsor);
};
textRoll = null;
light = null;
fadeOut = null;
var _local1:uint = this.numChildren;
var _local2:uint;
_local2 = 0;
while (_local2 < _local1) {
this.removeChildAt(0);
_local2++;
};
launcher = null;
}
private function waitForEnd(_arg1:Event){
if (textRoll.completed){
removeChild(textRoll);
bSkip.visible = false;
addChild(fadeOut);
fadeOut.bBack.visible = false;
fadeOut.bSponsor.visible = false;
fadeOut.TryAgain.visible = false;
fadeOut.bBack.addEventListener(MouseEvent.CLICK, backToMainMenu);
if (GameData.nonex == false){
fadeOut.bSponsor.addEventListener(MouseEvent.CLICK, goToSponsor);
};
fadeOut.gotoAndPlay(1);
removeEventListener(Event.ENTER_FRAME, waitForEnd);
buttonsTimer.start();
};
count++;
}
}
}//package game.credits
Section 76
//AchievementDisplayer (game.menus.AchievementDisplayer)
package game.menus {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class AchievementDisplayer extends MovieClip {
public var t:TextField;
private var achievement:String;
public function AchievementDisplayer(_arg1:int, _arg2:int, _arg3:String, _arg4:String){
y = (235 + (_arg1 * 25));
achievement = (((((_arg3 + " (") + _arg2) + " ") + _arg4) + ")");
addEventListener(Event.ADDED_TO_STAGE, display);
}
private function display(_arg1:Event):void{
t.text = achievement;
}
}
}//package game.menus
Section 77
//DebriefingMenu (game.menus.DebriefingMenu)
package game.menus {
import flash.display.*;
import flash.events.*;
import game.*;
public class DebriefingMenu extends MovieClip {
private var totalValue:int;// = 0
public var envelope:MovieClip;
public var anim:MovieClip;
var customMsg:String;
private var reachedDepth:int;
private var displayers:Array;
public var tablet:MovieClip;
private var launcher:launch;
public var debriefingPaused:Boolean;// = false
public var skipButton:SimpleButton;
public function DebriefingMenu(_arg1, _arg2, _arg3){
displayers = new Array();
super();
addFrameScript(23, frame24, 78, frame79, 104, frame105, 160, frame161, 168, frame169, 173, frame174, 185, frame186, 213, frame214, 226, frame227);
customMsg = ("End level : " + _arg2);
reachedDepth = _arg3;
this.launcher = _arg1;
this.launcher.hideOptions();
startAnimation(_arg2);
}
function frame161(){
gotoAndPlay("infos");
}
private function startAnimation(_arg1:String){
gotoAndPlay(_arg1);
}
function frame186(){
debriefingPaused = true;
stop();
skipButton.addEventListener(MouseEvent.CLICK, skip);
}
private function closeMenu(){
if (GameData.weekLeft <= 0){
launcher.goToEnding();
launcher = null;
} else {
launcher.goToUpgradeMenu();
launcher = null;
};
}
function frame169(){
gotoAndPlay("infos");
}
function frame79(){
gotoAndPlay("infos");
}
function frame174(){
displayCargo();
}
private function addTreasureDisplayer(_arg1){
displayers[_arg1] = new TreasureDisplayer(_arg1);
displayers[_arg1].x = 40;
displayers[_arg1].y = ((_arg1 * 40) + 20);
displayers[_arg1].graphic.gotoAndStop((_arg1 + 1));
this.tablet.addChild(displayers[_arg1]);
}
private function displayCargo(){
var _local1:int;
while (_local1 <= 5) {
if (GameData.cargoContent[_local1] > 0){
addTreasureDisplayer(_local1);
totalValue = (totalValue + (GameData.cargoContent[_local1] * GameData.treasureValue[_local1]));
};
_local1++;
};
tablet.total.text = totalValue.toString();
}
function frame214(){
debriefingPaused = true;
stop();
envelope.play();
displayRD();
skipButton.addEventListener(MouseEvent.CLICK, skip);
}
function frame105(){
this.anim.play();
}
private function displayRD(){
var _local2:int;
var _local3:int;
var _local1:int;
_local2 = 0;
while (_local2 < GameData.depthAchievements.length) {
if ((((reachedDepth >= GameData.depthAchievements[_local2][0])) && ((GameData.depthAchievementsDone[_local2] == 1)))){
envelope.letter.addChild(new AchievementDisplayer(_local1, GameData.depthAchievements[_local2][0], GameData.depthAchievements[_local2][2], "feet"));
GameData.depthAchievementsDone[_local2] = 2;
_local1++;
};
_local2++;
};
_local2 = 0;
while (_local2 < GameData.treasureAchievements.length) {
if ((((GameData.cargoContent[_local2] >= GameData.treasureAchievements[_local2][0])) && ((GameData.treasureAchievementsDone[_local2] == 1)))){
envelope.letter.addChild(new AchievementDisplayer(_local1, GameData.treasureAchievements[_local2][0], GameData.treasureAchievements[_local2][2], GameData.treasureAchievements[_local2][3]));
GameData.treasureAchievementsDone[_local2] = 2;
_local1++;
};
_local2++;
};
if (reachedDepth > 0){
_local3 = Math.floor((reachedDepth / 5));
envelope.letter.tDepth.text = reachedDepth.toString();
} else {
_local3 = 0;
envelope.letter.tDepth.text = "0";
};
GameData.grants = (GameData.grants + _local3);
totalValue = (totalValue + _local3);
envelope.letter.tAward.text = _local3.toString();
GameData.money = (GameData.money + totalValue);
launcher.kongregate.stats.submit("CoinsCollected", GameData.cargoContent[0]);
launcher.kongregate.stats.submit("ChestsCollected", GameData.cargoContent[1]);
launcher.kongregate.stats.submit("EmeraldsCollected", GameData.cargoContent[2]);
launcher.kongregate.stats.submit("RubiesCollected", GameData.cargoContent[3]);
launcher.kongregate.stats.submit("DiamondsCollected", GameData.cargoContent[4]);
launcher.kongregate.stats.submit("BigDiamondsCollected", GameData.cargoContent[5]);
launcher.kongregate.stats.submit("TotalMoneyCollected", totalValue);
launcher.kongregate.stats.submit("DepthReached", reachedDepth);
GameData.Tracker.endLevel(GameData.money, ((((((((((("Coins: " + GameData.cargoContent[0]) + ", Chests: ") + GameData.cargoContent[1]) + ", Emeralds: ") + GameData.cargoContent[2]) + ", Rubys: ") + GameData.cargoContent[3]) + ", Diamonds: ") + GameData.cargoContent[4]) + ", Big Diamonds: ") + GameData.cargoContent[5]), customMsg);
}
function frame24(){
this.anim.play();
}
function frame227(){
closeMenu();
}
public function destroy(){
var _local1:uint = this.numChildren;
var _local2:uint;
_local2 = 0;
while (_local2 < _local1) {
this.removeChildAt(0);
_local2++;
};
launcher = null;
}
private function skip(_arg1:MouseEvent){
debriefingPaused = false;
play();
}
}
}//package game.menus
Section 78
//Ending (game.menus.Ending)
package game.menus {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import game.*;
public class Ending extends MovieClip {
public var shopKeeper:MovieClip;
public var lady:MovieClip;
public var bubble:MovieClip;
private var currentAction:int;// = 0
public var char:MovieClip;
private var delays:Array;
private var boatID:int;
public var moneyDisplay:MovieClip;
private var Sounds:SoundManager;
private var launcher:launch;
public var tAnims:MovieClip;
var tNum:int;// = 0
public var salesMan:MovieClip;
private var counter:int;// = 0
public function Ending(_arg1){
delays = new Array(60, 20, 20, 50, 70, 30, 20, 5, 15, 70, 60, 25, 35, 20, 80, 75, 40, 60, 35, 30, 30, 30, 30, 30, 80);
Sounds = SoundManager.getInstance();
super();
addFrameScript(0, frame1, 76, frame77, 149, frame150, 200, frame201, 222, frame223, 271, frame272);
this.x = (this.y = 250);
this.launcher = _arg1;
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function prepareToSell(_arg1:Event){
if (counter < 45){
counter++;
} else {
if (tNum < 6){
sell(GameData.depthAchievements[tNum][1]);
} else {
sell(GameData.treasureAchievements[(tNum - 6)][1]);
};
removeEventListener(Event.ENTER_FRAME, prepareToSell);
};
}
function frame1(){
stop();
}
function frame272(){
stop();
}
private function showTrophy(){
trace("Show Trophy");
if (tNum == 12){
trace("TROPHY SELLING IS OVER!!");
counter = 0;
addEventListener(Event.ENTER_FRAME, actions);
} else {
if (tNum < 6){
if (GameData.depthAchievementsDone[tNum] == 2){
tAnims.trophies.d.gotoAndStop((tNum + 1));
tAnims.trophies.d.visible = true;
tAnims.trophies.m.visible = false;
tAnims.visible = true;
tAnims.gotoAndPlay("appear");
shopKeeper.gotoAndPlay("price");
counter = 0;
addEventListener(Event.ENTER_FRAME, evaluatePrice);
} else {
tNum++;
showTrophy();
};
} else {
if (GameData.treasureAchievementsDone[(tNum - 6)] == 2){
tAnims.trophies.m.gotoAndStop(((tNum + 1) - 6));
tAnims.trophies.m.visible = true;
tAnims.trophies.d.visible = false;
tAnims.visible = true;
tAnims.gotoAndPlay("appear");
shopKeeper.gotoAndPlay("price");
counter = 0;
addEventListener(Event.ENTER_FRAME, evaluatePrice);
} else {
tNum++;
showTrophy();
};
};
};
}
private function sell(_arg1){
trace("Sell");
GameData.money = (GameData.money + _arg1);
bubble.visible = false;
tAnims.gotoAndPlay("give");
moneyDisplay.amount.t.text = (GameData.money + "$");
moneyDisplay.play();
counter = 0;
addEventListener(Event.ENTER_FRAME, prepareNextTrophy);
}
private function init(_arg1:Event){
GameData.googleTrack("Game", "EndingReached", GameData.weekLeft);
MochiBot.track(this, "2b256120");
Sounds.playSound("e_gongs");
addEventListener(Event.ENTER_FRAME, actions);
moneyDisplay.visible = false;
tAnims.visible = false;
bubble.visible = false;
}
private function doAction(_arg1){
if (_arg1 == 0){
gotoAndStop("start");
Sounds.playSound("endChoice", 0, 0, 99999);
Sounds.fadeSound("endChoice", 1, 1);
} else {
if (_arg1 == 1){
moneyDisplay.visible = true;
moneyDisplay.bag.gotoAndPlay("appear");
moneyDisplay.amount.t.text = (GameData.money + "$");
moneyDisplay.play();
} else {
if (_arg1 == 2){
char.gotoAndPlay("laugh");
Sounds.playSound("e_charLaugh");
} else {
if (_arg1 == 3){
gotoAndPlay("walk1");
char.gotoAndPlay("startWalk");
} else {
if (_arg1 == 4){
shopKeeper.gotoAndPlay("greet");
Sounds.playSound("e_shopHep");
} else {
if (_arg1 == 5){
char.gotoAndPlay("give");
} else {
if (_arg1 == 6){
counter = 0;
removeEventListener(Event.ENTER_FRAME, actions);
GameData.Tracker.customMsg("report", 0, ("Depth Trophies: " + GameData.depthAchievementsDone));
GameData.Tracker.customMsg("report", 0, ("Treasure Trophies: " + GameData.treasureAchievementsDone));
showTrophy();
} else {
if (_arg1 == 7){
char.gotoAndPlay("endGive");
} else {
if (_arg1 == 8){
gotoAndPlay("walk2");
char.gotoAndPlay("startWalk");
} else {
if (_arg1 == 9){
lady.gotoAndPlay("pay");
} else {
if (_arg1 == 10){
bubble.visible = true;
bubble.t.text = (("-" + GameData.grants) + "$");
} else {
if (_arg1 == 11){
GameData.money = (GameData.money - GameData.grants);
moneyDisplay.amount.t.text = (GameData.money + "$");
moneyDisplay.play();
char.gotoAndPlay("sad");
} else {
if (_arg1 == 12){
bubble.visible = false;
} else {
if (_arg1 == 13){
gotoAndPlay("walk3");
char.gotoAndPlay("startWalk");
lady.gotoAndPlay("outPay");
} else {
if (_arg1 == 14){
char.gotoAndPlay("ask");
} else {
if (_arg1 == 15){
salesMan.gotoAndPlay("evaluate");
} else {
if (_arg1 == 16){
salesMan.bubble.visible = true;
if (GameData.money >= 300000){
boatID = 5;
salesMan.bubble.gotoAndPlay("five");
} else {
if (GameData.money >= 225000){
boatID = 4;
salesMan.bubble.gotoAndPlay("four");
} else {
if (GameData.money >= 150000){
boatID = 3;
salesMan.bubble.gotoAndPlay("three");
} else {
if (GameData.money >= 75000){
boatID = 2;
salesMan.bubble.gotoAndPlay("two");
} else {
boatID = 1;
salesMan.bubble.gotoAndPlay("one");
};
};
};
};
} else {
if (_arg1 == 17){
salesMan.bubble.visible = false;
salesMan.gotoAndPlay("outEvaluate");
} else {
if (_arg1 == 18){
salesMan.gotoAndPlay("laugh");
Sounds.playSound("e_boatLaugh");
salesMan.head.gotoAndStop(2);
} else {
if (_arg1 == 19){
char.gotoAndPlay("laugh");
Sounds.playSound("e_charLaugh");
} else {
if (_arg1 == 20){
salesMan.gotoAndPlay("laugh");
Sounds.playSound("e_boatLaugh");
salesMan.head.gotoAndStop(2);
} else {
if (_arg1 == 21){
char.gotoAndPlay("laugh");
Sounds.playSound("e_charLaugh");
} else {
if (_arg1 == 22){
salesMan.gotoAndPlay("invite");
Sounds.playSound("e_boatLaugh");
salesMan.head.gotoAndStop(2);
} else {
if (_arg1 == 23){
gotoAndPlay("walk4");
char.gotoAndPlay("startWalk");
} else {
if (_arg1 == 24){
if (boatID > GameData.highestEnding){
GameData.highestEnding = boatID;
};
launcher.goToCredits(boatID, true);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
private function sayPrice(){
trace("Say Price");
if (tNum < 6){
bubble.visible = true;
bubble.t.text = (GameData.depthAchievements[tNum][1].toString() + "$");
} else {
bubble.visible = true;
bubble.t.text = (GameData.treasureAchievements[(tNum - 6)][1].toString() + "$");
};
counter = 0;
addEventListener(Event.ENTER_FRAME, prepareToSell);
}
function frame201(){
char.head.gotoAndStop(1);
}
function frame223(){
stop();
char.gotoAndStop(1);
}
function frame77(){
stop();
char.gotoAndStop(1);
}
private function evaluatePrice(_arg1:Event){
if (counter < 30){
counter++;
} else {
sayPrice();
removeEventListener(Event.ENTER_FRAME, evaluatePrice);
Sounds.playSound("e_shopHmm");
};
}
private function prepareNextTrophy(_arg1:Event){
if (counter < 30){
counter++;
} else {
tNum++;
showTrophy();
removeEventListener(Event.ENTER_FRAME, prepareNextTrophy);
};
}
public function destroy(){
var _local1:uint = this.numChildren;
var _local2:uint;
_local2 = 0;
while (_local2 < _local1) {
this.removeChildAt(0);
_local2++;
};
launcher = null;
}
private function actions(_arg1:Event){
if (currentAction < delays.length){
if (counter < delays[currentAction]){
counter++;
} else {
doAction(currentAction);
currentAction++;
counter = 0;
};
} else {
removeEventListener(Event.ENTER_FRAME, actions);
};
}
function frame150(){
stop();
char.gotoAndStop(1);
}
}
}//package game.menus
Section 79
//Introduction (game.menus.Introduction)
package game.menus {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import game.*;
public class Introduction extends MovieClip {
private var launcher:launch;
public var bSkip:SimpleButton;
private var Sounds:SoundManager;
private var from:String;// = ""
public var hero:MovieClip;
public function Introduction(_arg1, _arg2:String){
Sounds = SoundManager.getInstance();
super();
addFrameScript(0, frame1, 380, frame381, 395, frame396, 569, frame570, 576, frame577, 660, frame661, 865, frame866, 910, frame911, 1001, frame1002);
this.launcher = _arg1;
from = _arg2;
this.x = (this.y = 250);
bSkip.addEventListener(MouseEvent.CLICK, skipButton);
addEventListener(Event.ENTER_FRAME, checkAnimEnd);
}
function frame396(){
if (GameData.soundOn){
Sounds.playSound("i_bossLaugh");
};
}
private function checkAnimEnd(_arg1:Event){
if (currentFrame == 990){
autoSkip();
};
}
function frame1(){
if (GameData.soundOn){
Sounds.playSound("i_sea");
};
}
function frame911(){
if (GameData.soundOn){
Sounds.playSound("i_charIdea");
};
}
function frame866(){
if (GameData.soundOn){
Sounds.playSound("i_charInterest");
};
}
private function autoSkip(){
stop();
if (from == "auto"){
launcher.returnToMainMenu();
} else {
if (from == "start"){
launcher.startGame();
};
};
}
function frame577(){
if (GameData.soundOn){
Sounds.playSound("i_newspaper1");
};
}
function frame570(){
if (GameData.soundOn){
Sounds.playSound("i_charAngry");
};
hero.play();
}
private function skipButton(_arg1:MouseEvent){
stop();
if (from == "auto"){
launcher.returnToMainMenu();
} else {
if (from == "start"){
launcher.startGame();
};
};
}
public function destroy(){
launcher = null;
Sounds = null;
bSkip.removeEventListener(MouseEvent.CLICK, skipButton);
removeEventListener(Event.ENTER_FRAME, checkAnimEnd);
var _local1:uint = this.numChildren;
var _local2:uint;
_local2 = 0;
while (_local2 < _local1) {
this.removeChildAt(0);
_local2++;
};
}
function frame1002(){
stop();
}
function frame661(){
if (GameData.soundOn){
Sounds.playSound("i_newspaper2");
};
}
function frame381(){
trace("Plan 2");
}
}
}//package game.menus
Section 80
//MainMenu (game.menus.MainMenu)
package game.menus {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import game.*;
public class MainMenu extends MovieClip {
var bPlayButton:ButtonMode;
public var bClear:MovieClip;
public var bGallery:SimpleButton;
var bInstButton:ButtonMode;
var bClearButton:ButtonMode;
public var bYes:SimpleButton;
private var launcher;
public var bMoreGames:MovieClip;
private var introMusicTimer:Timer;
var bCreditsButton:ButtonMode;
public var bClose:SimpleButton;
public var bPlay:MovieClip;
public var bNo:SimpleButton;
public var bInst:MovieClip;
private var introTimer:Timer;
public var bCredits:MovieClip;
private var Sounds:SoundManager;
public var e2:MovieClip;
public var e3:MovieClip;
public var e4:MovieClip;
public var e5:MovieClip;
public var e1:MovieClip;
var bMoreGamesButton:ButtonMode;
public function MainMenu(_arg1){
Sounds = SoundManager.getInstance();
introTimer = new Timer(60000, 1);
super();
addFrameScript(90, frame91, 94, frame95, 128, frame129);
launcher = _arg1;
if (GameData.nonex){
bMoreGames.visible = false;
bPlay.y = (bPlay.y + 50);
bClear.y = (bClear.y + 50);
bCredits.y = (bCredits.y + 50);
bInst.y = (bInst.y + 50);
};
bPlayButton = new ButtonMode(bPlay);
bClearButton = new ButtonMode(bClear);
bCreditsButton = new ButtonMode(bCredits);
bInstButton = new ButtonMode(bInst);
bMoreGamesButton = new ButtonMode(bMoreGames);
addButtonFunctions();
introTimer.addEventListener(TimerEvent.TIMER, autoStartIntro);
autoIntroTimer();
Sounds.playSound("introTitle", 1, 0, 1);
introMusicTimer = new Timer(Sounds.getSoundDuration("introTitle"), 1);
introMusicTimer.addEventListener(TimerEvent.TIMER, chainTitle);
introMusicTimer.start();
if (GameData.soundOn == false){
Sounds.muteAllSounds();
};
bGallery.visible = false;
if (GameData.highestEnding > 0){
bGallery.visible = true;
};
addGalleryFunctions();
}
public function destroy(){
introTimer.removeEventListener(TimerEvent.TIMER, autoStartIntro);
launcher = null;
Sounds = null;
introMusicTimer = null;
introTimer = null;
removeButtonFunctions();
removeGalleryFunctions();
var _local1:uint = this.numChildren;
var _local2:uint;
_local2 = 0;
while (_local2 < _local1) {
this.removeChildAt(0);
_local2++;
};
bPlayButton = null;
bClearButton = null;
bMoreGamesButton = null;
}
private function closeCredits(_arg1:MouseEvent){
if (GameData.highestEnding > 0){
bGallery.visible = true;
};
bClose.removeEventListener(MouseEvent.CLICK, closeCredits);
autoIntroTimer();
gotoAndStop("main");
addButtonFunctions();
}
private function GalleryButton(_arg1:MouseEvent):void{
bGallery.visible = false;
introTimer.reset();
removeButtonFunctions();
gotoAndStop("creditsGallery");
bClose.addEventListener(MouseEvent.CLICK, bCloseGallery);
}
private function prepareForEnding(_arg1){
if (introMusicTimer.currentCount < introMusicTimer.delay){
introMusicTimer.removeEventListener(TimerEvent.TIMER, chainTitle);
};
removeEndingsFunctions();
launcher.goToCredits(_arg1, false);
}
private function removeGalleryFunctions(){
e1.removeEventListener(MouseEvent.CLICK, ending1);
e2.removeEventListener(MouseEvent.CLICK, ending2);
e3.removeEventListener(MouseEvent.CLICK, ending3);
e4.removeEventListener(MouseEvent.CLICK, ending4);
e5.removeEventListener(MouseEvent.CLICK, ending5);
}
private function ending3(_arg1:MouseEvent){
prepareForEnding(3);
}
private function StartButton(_arg1:MouseEvent):void{
autoIntroTimer();
if (introMusicTimer.currentCount < introMusicTimer.delay){
introMusicTimer.removeEventListener(TimerEvent.TIMER, chainTitle);
};
if (GameData.gameState == "new"){
GameData.gameState = "loaded";
launcher.startAtIntroduction();
} else {
if (GameData.gameState == "loaded"){
launcher.goToUpgradeMenu();
};
};
}
private function instButton(_arg1:MouseEvent){
bGallery.visible = false;
introTimer.reset();
removeButtonFunctions();
gotoAndStop("instructions");
bClose.addEventListener(MouseEvent.CLICK, closeCredits);
}
private function chainTitle(_arg1:TimerEvent):void{
Sounds.playSound("mainTitle", 1, 0, 99999);
if (GameData.soundOn == false){
Sounds.muteAllSounds();
};
}
private function returnToMain(){
bYes.removeEventListener(MouseEvent.CLICK, clearYes);
bNo.removeEventListener(MouseEvent.CLICK, clearNo);
gotoAndStop("main");
addButtonFunctions();
}
private function clearData(){
launcher.clearSaveData();
}
private function addButtonFunctions(){
bPlayButton.addFunctions();
bClearButton.addFunctions();
bCreditsButton.addFunctions();
bInstButton.addFunctions();
bPlay.addEventListener(MouseEvent.CLICK, StartButton);
bClear.addEventListener(MouseEvent.CLICK, ClearButton);
bInst.addEventListener(MouseEvent.CLICK, instButton);
bGallery.addEventListener(MouseEvent.CLICK, GalleryButton);
bCredits.addEventListener(MouseEvent.CLICK, CreditsButton);
if (GameData.nonex == false){
bMoreGamesButton.addFunctions();
bMoreGames.addEventListener(MouseEvent.CLICK, SponsorButton);
};
}
function frame129(){
returnToMain();
}
private function autoStartIntro(_arg1:TimerEvent){
launcher.autoIntroduction();
}
private function bCloseGallery(_arg1:MouseEvent){
bGallery.visible = true;
autoIntroTimer();
removeEndingsFunctions();
gotoAndStop("main");
addButtonFunctions();
}
private function ClearButton(_arg1:MouseEvent):void{
introTimer.reset();
removeButtonFunctions();
gotoAndStop("clear");
bYes.addEventListener(MouseEvent.CLICK, clearYes);
bNo.addEventListener(MouseEvent.CLICK, clearNo);
}
private function addGalleryFunctions(){
if (GameData.highestEnding >= 1){
e1.gotoAndStop(2);
e1.addEventListener(MouseEvent.CLICK, ending1);
};
if (GameData.highestEnding >= 2){
e2.gotoAndStop(2);
e2.addEventListener(MouseEvent.CLICK, ending2);
};
if (GameData.highestEnding >= 3){
e3.gotoAndStop(2);
e3.addEventListener(MouseEvent.CLICK, ending3);
};
if (GameData.highestEnding >= 4){
e4.gotoAndStop(2);
e4.addEventListener(MouseEvent.CLICK, ending4);
};
if (GameData.highestEnding >= 5){
e5.gotoAndStop(2);
e5.addEventListener(MouseEvent.CLICK, ending5);
};
}
function frame91(){
stop();
}
function frame95(){
clearData();
}
private function CreditsButton(_arg1:MouseEvent):void{
bGallery.visible = false;
introTimer.reset();
removeButtonFunctions();
gotoAndStop("gameCredits");
bClose.addEventListener(MouseEvent.CLICK, closeCredits);
}
private function autoIntroTimer(){
introTimer.reset();
introTimer.start();
}
private function SponsorButton(_arg1:MouseEvent){
GameData.googleTrack("Click Sponsor's link", "SponsorMainMenu", GameData.weekLeft);
MochiBot.track(this, "fadd2914");
navigateToURL(GameData.SponsorURL);
}
private function clearYes(_arg1:MouseEvent){
autoIntroTimer();
play();
}
private function removeButtonFunctions(){
bPlayButton.removeFunctions();
bClearButton.removeFunctions();
bCreditsButton.removeFunctions();
bInstButton.removeFunctions();
bPlay.removeEventListener(MouseEvent.CLICK, StartButton);
bClear.removeEventListener(MouseEvent.CLICK, ClearButton);
bGallery.removeEventListener(MouseEvent.CLICK, GalleryButton);
bCredits.removeEventListener(MouseEvent.CLICK, CreditsButton);
if (GameData.nonex == false){
bMoreGamesButton.removeFunctions();
bMoreGames.removeEventListener(MouseEvent.CLICK, SponsorButton);
};
}
private function ending1(_arg1:MouseEvent){
prepareForEnding(1);
}
private function ending2(_arg1:MouseEvent){
prepareForEnding(2);
}
private function ending4(_arg1:MouseEvent){
prepareForEnding(4);
}
private function clearNo(_arg1:MouseEvent){
autoIntroTimer();
returnToMain();
}
private function removeEndingsFunctions(){
e1.removeEventListener(MouseEvent.CLICK, ending1);
e2.removeEventListener(MouseEvent.CLICK, ending2);
e3.removeEventListener(MouseEvent.CLICK, ending3);
e4.removeEventListener(MouseEvent.CLICK, ending4);
e5.removeEventListener(MouseEvent.CLICK, ending5);
bClose.removeEventListener(MouseEvent.CLICK, bCloseGallery);
}
private function ending5(_arg1:MouseEvent){
prepareForEnding(5);
}
}
}//package game.menus
Section 81
//MomLetter (game.menus.MomLetter)
package game.menus {
import flash.display.*;
public dynamic class MomLetter extends MovieClip {
public var skipButton:SimpleButton;
public function MomLetter(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package game.menus
Section 82
//OptionsMenu (game.menus.OptionsMenu)
package game.menus {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
import game.*;
import flash.ui.*;
public class OptionsMenu extends MovieClip {
public var t:TextField;
private var launcher:launch;
private var instructions:Instructions;
public var bClose:SimpleButton;
public var bControls:MovieClip;
public var bQuality:SimpleButton;
public var bHelp:SimpleButton;
public var BG:MovieClip;
private var currentMode:String;// = "main"
public var bSound:MovieClip;
public var bSponsor:SimpleButton;
public var bMenu:SimpleButton;
private var Sounds:SoundManager;
public var bMisc:MovieClip;
public function OptionsMenu(_arg1){
Sounds = SoundManager.getInstance();
super();
this.launcher = _arg1;
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function laugh(_arg1:MouseEvent){
var _local2:int = new int((Math.random() * 3));
if (GameData.soundOn){
if (_local2 == 0){
Sounds.playSound("i_charIdea");
} else {
if (_local2 == 1){
Sounds.playSound("e_charLaugh");
} else {
Sounds.playSound("a_charBoost2");
};
};
};
}
private function overQuality(_arg1:MouseEvent){
displayQualityInfo();
}
private function overLaugh(_arg1:MouseEvent){
t.text = "Laugh!!!";
}
private function init(_arg1:Event){
if ((((GameData.GameWideLogo == true)) && ((GameData.nonex == false)))){
bSponsor.visible = true;
} else {
bSponsor.visible = false;
};
mainMenuMode();
doCloseMenu();
updateSoundDisplay();
if (GameData.inverted){
bControls.natural.visible = false;
bControls.inverted.visible = true;
} else {
bControls.natural.visible = true;
bControls.inverted.visible = false;
};
bMisc.bLaugh.addEventListener(MouseEvent.CLICK, laugh);
bMisc.bSurface.addEventListener(MouseEvent.CLICK, goToSurface);
bMisc.bMainMenu.addEventListener(MouseEvent.CLICK, returnToMainMenu);
bControls.natural.addEventListener(MouseEvent.CLICK, controlsToInverted);
bControls.inverted.addEventListener(MouseEvent.CLICK, controlsToNatural);
bSound.ON.addEventListener(MouseEvent.CLICK, turnSoundOff);
bSound.OFF.addEventListener(MouseEvent.CLICK, turnSoundOn);
bHelp.addEventListener(MouseEvent.CLICK, showHelp);
bQuality.addEventListener(MouseEvent.CLICK, changeQuality);
bMisc.bLaugh.addEventListener(MouseEvent.ROLL_OVER, overLaugh);
bMisc.bSurface.addEventListener(MouseEvent.ROLL_OVER, overSurface);
bMisc.bMainMenu.addEventListener(MouseEvent.ROLL_OVER, overMainMenu);
bControls.natural.addEventListener(MouseEvent.ROLL_OVER, overNatural);
bControls.inverted.addEventListener(MouseEvent.ROLL_OVER, overInverted);
bSound.ON.addEventListener(MouseEvent.ROLL_OVER, overSoundON);
bSound.OFF.addEventListener(MouseEvent.ROLL_OVER, overSoundOFF);
bHelp.addEventListener(MouseEvent.ROLL_OVER, overHelp);
bQuality.addEventListener(MouseEvent.ROLL_OVER, overQuality);
bMisc.bLaugh.addEventListener(MouseEvent.ROLL_OUT, clearText);
bMisc.bSurface.addEventListener(MouseEvent.ROLL_OUT, clearText);
bMisc.bMainMenu.addEventListener(MouseEvent.ROLL_OUT, clearText);
bControls.natural.addEventListener(MouseEvent.ROLL_OUT, clearText);
bControls.inverted.addEventListener(MouseEvent.ROLL_OUT, clearText);
bSound.ON.addEventListener(MouseEvent.ROLL_OUT, clearText);
bSound.OFF.addEventListener(MouseEvent.ROLL_OUT, clearText);
bHelp.addEventListener(MouseEvent.ROLL_OUT, clearText);
bQuality.addEventListener(MouseEvent.ROLL_OUT, clearText);
bClose.addEventListener(MouseEvent.CLICK, closeMenu);
bMenu.addEventListener(MouseEvent.CLICK, openMenu);
bSponsor.addEventListener(MouseEvent.CLICK, goToSponsor);
}
private function turnSoundOn(_arg1:MouseEvent){
GameData.soundOn = true;
Sounds.unmuteAllSounds();
updateSoundDisplay();
}
private function goToSponsor(_arg1:MouseEvent){
GameData.googleTrack("Click Sponsor's link", "SponsorGameWide", GameData.weekLeft);
MochiBot.track(this, "3416a326");
navigateToURL(GameData.SponsorURL);
}
private function controlsToNatural(_arg1:MouseEvent){
GameData.Tracker.alert(0, "CONTROLS ARE NOW : NATURAL");
bControls.natural.visible = true;
bControls.inverted.visible = false;
GameData.inverted = false;
}
private function updateSoundDisplay(){
if (GameData.soundOn){
bSound.ON.visible = true;
bSound.OFF.visible = false;
} else {
bSound.ON.visible = false;
bSound.OFF.visible = true;
};
}
private function clearText(_arg1:MouseEvent){
t.text = "";
}
private function returnToMainMenu(_arg1:MouseEvent){
doCloseMenu();
launcher.returnToMainMenu();
}
public function tellNotStartedYet(){
doOpenMenu();
gotoAndPlay("message1");
}
private function goToSurface(_arg1:MouseEvent){
doCloseMenu();
launcher.forceEndLevel();
}
private function displayQualityInfo(){
if (stage.quality == "HIGH"){
t.text = "Quality : HIGH";
} else {
if (stage.quality == "MEDIUM"){
t.text = "Quality : MEDIUM";
} else {
if (stage.quality == "LOW"){
t.text = "Quality : LOW";
};
};
};
}
private function overMainMenu(_arg1:MouseEvent){
t.text = "Return to Main Menu";
}
private function changeQuality(_arg1:MouseEvent){
if (stage.quality == "HIGH"){
GameData.Quality = "MEDIUM";
this.setGameQuality("MEDIUM");
} else {
if (stage.quality == "MEDIUM"){
GameData.Quality = "LOW";
this.setGameQuality("LOW");
} else {
if (stage.quality == "LOW"){
GameData.Quality = "HIGH";
this.setGameQuality("HIGH");
};
};
};
displayQualityInfo();
}
private function overNatural(_arg1:MouseEvent){
t.text = "Controls mode : Natural";
}
private function overSurface(_arg1:MouseEvent){
t.text = "Return to the surface";
}
private function overSoundON(_arg1:MouseEvent){
t.text = "Turn sound OFF";
}
private function doCloseMenu(){
if ((((GameData.mole > 0)) && ((currentMode == "game")))){
Mouse.hide();
};
if (GameData.inTutorial == false){
GameData.inPause = false;
};
bMenu.visible = true;
BG.visible = false;
bClose.visible = false;
bMisc.visible = false;
bSound.visible = false;
bHelp.visible = false;
bQuality.visible = false;
bControls.visible = false;
t.visible = false;
}
private function overHelp(_arg1:MouseEvent){
t.text = "Controls and Instructions";
}
public function gameMode(){
currentMode = "game";
bMisc.bLaugh.visible = false;
bMisc.bSurface.visible = true;
bMisc.bMainMenu.visible = false;
if (((GameData.GameWideLogo) && ((GameData.nonex == false)))){
bSponsor.visible = true;
};
}
private function openMenu(_arg1:MouseEvent){
GameData.Tracker.alert(0, "OPENING MENU (Pause)");
doOpenMenu();
}
private function overSoundOFF(_arg1:MouseEvent){
t.text = "Turn sound ON";
}
private function closeHelp(_arg1:MouseEvent){
removeChild(instructions);
instructions = null;
}
public function upgradeMenuMode(){
currentMode = "upgrade";
bMisc.bLaugh.visible = false;
bMisc.bSurface.visible = false;
bMisc.bMainMenu.visible = true;
if (((GameData.GameWideLogo) && ((GameData.nonex == false)))){
bSponsor.visible = true;
};
}
private function showHelp(_arg1:MouseEvent){
instructions = new Instructions();
addChild(instructions);
instructions.skipButton.addEventListener(MouseEvent.CLICK, closeHelp);
}
private function controlsToInverted(_arg1:MouseEvent){
GameData.Tracker.alert(0, "CONTROLS ARE NOW : INVERTED");
bControls.natural.visible = false;
bControls.inverted.visible = true;
GameData.inverted = true;
}
private function overInverted(_arg1:MouseEvent){
t.text = "Controls mode : Inverted";
}
public function setGameQuality(_arg1:String){
if (_arg1 == "HIGH"){
stage.quality = StageQuality.HIGH;
} else {
if (_arg1 == "MEDIUM"){
stage.quality = StageQuality.MEDIUM;
} else {
if (_arg1 == "LOW"){
stage.quality = StageQuality.LOW;
};
};
};
}
private function doOpenMenu(){
Mouse.show();
GameData.inPause = true;
bMenu.visible = false;
BG.visible = true;
bClose.visible = true;
bMisc.visible = true;
bSound.visible = true;
bHelp.visible = true;
bQuality.visible = true;
bControls.visible = true;
t.visible = true;
}
private function closeMenu(_arg1:MouseEvent){
GameData.Tracker.alert(0, "CLOSING MENU (Return to Game)");
doCloseMenu();
}
public function mainMenuMode(){
currentMode = "main";
bMisc.bLaugh.visible = true;
bMisc.bSurface.visible = false;
bMisc.bMainMenu.visible = false;
if (GameData.GameWideLogo){
bSponsor.visible = false;
};
}
private function turnSoundOff(_arg1:MouseEvent){
GameData.soundOn = false;
Sounds.muteAllSounds();
updateSoundDisplay();
}
}
}//package game.menus
Section 83
//Sponsor (game.menus.Sponsor)
package game.menus {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import game.*;
public class Sponsor extends MovieClip {
public var confirm:MovieClip;
public var bBack:SimpleButton;
private var star2:Star;
public var bSponsor:SimpleButton;
private var star1:Star;
public function Sponsor(){
star1 = new Star();
star2 = new Star();
super();
bBack.useHandCursor = false;
addEventListener(Event.ADDED_TO_STAGE, init);
}
public function clean(){
removeEventListener(Event.ENTER_FRAME, moveStars);
bBack.removeEventListener(MouseEvent.CLICK, back);
bSponsor.removeEventListener(MouseEvent.CLICK, openConfirm);
confirm.bYes.removeEventListener(MouseEvent, navigateToSponsor);
confirm.bNo.removeEventListener(MouseEvent, closeConfirm);
star1 = null;
star2 = null;
}
private function moveStars(_arg1:Event){
if (star1.currentFrame == 25){
star1.x = ((Math.random() * 428) + 36);
star1.y = ((Math.random() * 229) + 172);
star1.gotoAndPlay("shine");
};
if (star2.currentFrame == 25){
star2.x = ((Math.random() * 428) + 36);
star2.y = ((Math.random() * 229) + 172);
star2.gotoAndPlay("shine");
};
}
private function closeConfirm(_arg1:MouseEvent){
confirm.x = 500;
}
private function back(_arg1:MouseEvent){
removeEventListener(Event.ENTER_FRAME, moveStars);
bBack.removeEventListener(MouseEvent.CLICK, back);
bSponsor.removeEventListener(MouseEvent.CLICK, navigateToSponsor);
removeChild(star1);
removeChild(star2);
this.parent.removeChild(this);
}
private function navigateToSponsor(_arg1:MouseEvent){
GameData.googleTrack("Click Sponsor's link", "SponsorTrophyRoom", GameData.weekLeft);
MochiBot.track(this, "5334514b");
navigateToURL(GameData.SponsorURL);
}
private function openConfirm(_arg1:MouseEvent){
confirm.x = 0;
}
private function init(_arg1:Event){
addChild(star1);
addChild(star2);
star1.gotoAndPlay("shine");
star2.gotoAndPlay("half");
addEventListener(Event.ENTER_FRAME, moveStars);
bBack.addEventListener(MouseEvent.CLICK, back);
bSponsor.addEventListener(MouseEvent.CLICK, openConfirm, false, 0, true);
confirm.bYes.addEventListener(MouseEvent.CLICK, navigateToSponsor, false, 0, true);
confirm.bNo.addEventListener(MouseEvent.CLICK, closeConfirm, false, 0, true);
}
}
}//package game.menus
Section 84
//TakeVacation (game.menus.TakeVacation)
package game.menus {
import flash.display.*;
import flash.events.*;
public class TakeVacation extends MovieClip {
public var bNo:SimpleButton;
public var bYes:SimpleButton;
private var hostMenu:UpgradeMenu;
public function TakeVacation(_arg1){
hostMenu = _arg1;
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(_arg1:Event){
bNo.addEventListener(MouseEvent.CLICK, remove);
bYes.addEventListener(MouseEvent.CLICK, endGame);
addEventListener(Event.REMOVED_FROM_STAGE, clean);
}
private function remove(_arg1:MouseEvent){
this.parent.removeChild(this);
}
public function clean(_arg1:Event){
bNo.removeEventListener(MouseEvent.CLICK, remove);
bYes.removeEventListener(MouseEvent.CLICK, endGame);
removeEventListener(Event.ADDED_TO_STAGE, init);
removeEventListener(Event.REMOVED_FROM_STAGE, clean);
}
private function endGame(_arg1:MouseEvent){
this.parent.removeChild(this);
hostMenu.endGame();
}
}
}//package game.menus
Section 85
//TreasureDisplayer (game.menus.TreasureDisplayer)
package game.menus {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import game.*;
public class TreasureDisplayer extends MovieClip {
public var value:TextField;
public var total:TextField;
public var graphic:MovieClip;
public var amount:TextField;
private var index:int;
public function TreasureDisplayer(_arg1){
index = _arg1;
addEventListener(Event.ADDED_TO_STAGE, display);
}
private function display(_arg1:Event):void{
amount.text = GameData.cargoContent[index];
value.text = GameData.treasureValue[index];
total.text = (GameData.cargoContent[index] * GameData.treasureValue[index]).toString();
}
}
}//package game.menus
Section 86
//TrophyCloseUp (game.menus.TrophyCloseUp)
package game.menus {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class TrophyCloseUp extends MovieClip {
public var aName:TextField;
public var aWorth:TextField;
public var aDesc:TextField;
public var dTrophies:MovieClip;
public var mTrophies:MovieClip;
public function TrophyCloseUp(){
addEventListener(Event.ADDED_TO_STAGE, init);
}
public function clean(){
removeEventListener(MouseEvent.CLICK, remove);
}
private function init(_arg1:Event){
addEventListener(MouseEvent.CLICK, remove);
}
private function remove(_arg1:MouseEvent){
this.parent.removeChild(this);
}
}
}//package game.menus
Section 87
//TrophyRoom (game.menus.TrophyRoom)
package game.menus {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import game.*;
public class TrophyRoom extends MovieClip {
private var CloseUp:TrophyCloseUp;
private var launcher:launch;
public var bHonor:SimpleButton;
public var d1:MovieClip;
public var d2:MovieClip;
public var d3:MovieClip;
public var d5:MovieClip;
public var d0:MovieClip;
public var d4:MovieClip;
public var bUpgrades:MovieClip;
private var SponsorCloseUp:Sponsor;
public var m0:MovieClip;
public var m1:MovieClip;
public var m2:MovieClip;
public var m3:MovieClip;
public var m4:MovieClip;
public var m5:MovieClip;
public function TrophyRoom(_arg1){
CloseUp = new TrophyCloseUp();
SponsorCloseUp = new Sponsor();
super();
this.launcher = _arg1;
var _local2:ButtonMode = new ButtonMode(bUpgrades);
bUpgrades.addEventListener(MouseEvent.CLICK, switchToUprades);
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true);
}
private function d2CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.mTrophies.visible = false;
CloseUp.dTrophies.visible = true;
CloseUp.dTrophies.gotoAndStop(3);
if (GameData.depthAchievementsDone[2] == 0){
CloseUp.dTrophies.visible = false;
};
CloseUp.aName.text = GameData.depthAchievements[2][2];
CloseUp.aDesc.text = (("Reached a depth of " + GameData.depthAchievements[2][0]) + " feet");
CloseUp.aWorth.text = (("Worth : " + GameData.depthAchievements[2][1]) + "$");
}
private function m2CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.dTrophies.visible = false;
CloseUp.mTrophies.visible = true;
CloseUp.mTrophies.gotoAndStop(3);
if (GameData.treasureAchievementsDone[2] == 0){
CloseUp.mTrophies.visible = false;
};
CloseUp.aName.text = GameData.treasureAchievements[2][2];
CloseUp.aDesc.text = ((("Collected " + GameData.treasureAchievements[2][0]) + " ") + GameData.treasureAchievements[2][3]);
CloseUp.aWorth.text = (("Worth : " + GameData.treasureAchievements[2][1]) + "$");
}
private function init(_arg1:Event){
updateDisplay();
m0.addEventListener(MouseEvent.CLICK, m0CloseUp);
m1.addEventListener(MouseEvent.CLICK, m1CloseUp);
m2.addEventListener(MouseEvent.CLICK, m2CloseUp);
m3.addEventListener(MouseEvent.CLICK, m3CloseUp);
m4.addEventListener(MouseEvent.CLICK, m4CloseUp);
m5.addEventListener(MouseEvent.CLICK, m5CloseUp);
d0.addEventListener(MouseEvent.CLICK, d0CloseUp);
d1.addEventListener(MouseEvent.CLICK, d1CloseUp);
d2.addEventListener(MouseEvent.CLICK, d2CloseUp);
d3.addEventListener(MouseEvent.CLICK, d3CloseUp);
d4.addEventListener(MouseEvent.CLICK, d4CloseUp);
d5.addEventListener(MouseEvent.CLICK, d5CloseUp);
if (GameData.nonex == false){
bHonor.addEventListener(MouseEvent.CLICK, gotoSponsor);
} else {
bHonor.visible = false;
};
}
private function d5CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.mTrophies.visible = false;
CloseUp.dTrophies.visible = true;
CloseUp.dTrophies.gotoAndStop(6);
if (GameData.depthAchievementsDone[5] == 0){
CloseUp.dTrophies.visible = false;
};
CloseUp.aName.text = GameData.depthAchievements[5][2];
CloseUp.aDesc.text = (("Reached a depth of " + GameData.depthAchievements[5][0]) + " feet");
CloseUp.aWorth.text = (("Worth : " + GameData.depthAchievements[5][1]) + "$");
}
private function m5CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.dTrophies.visible = false;
CloseUp.mTrophies.visible = true;
CloseUp.mTrophies.gotoAndStop(6);
if (GameData.treasureAchievementsDone[5] == 0){
CloseUp.mTrophies.visible = false;
};
CloseUp.aName.text = GameData.treasureAchievements[5][2];
CloseUp.aDesc.text = ((("Collected " + GameData.treasureAchievements[5][0]) + " ") + GameData.treasureAchievements[5][3]);
CloseUp.aWorth.text = (("Worth : " + GameData.treasureAchievements[5][1]) + "$");
}
private function d1CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.mTrophies.visible = false;
CloseUp.dTrophies.visible = true;
CloseUp.dTrophies.gotoAndStop(2);
if (GameData.depthAchievementsDone[1] == 0){
CloseUp.dTrophies.visible = false;
};
CloseUp.aName.text = GameData.depthAchievements[1][2];
CloseUp.aDesc.text = (("Reached a depth of " + GameData.depthAchievements[1][0]) + " feet");
CloseUp.aWorth.text = (("Worth : " + GameData.depthAchievements[1][1]) + "$");
}
private function m1CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.dTrophies.visible = false;
CloseUp.mTrophies.visible = true;
CloseUp.mTrophies.gotoAndStop(2);
if (GameData.treasureAchievementsDone[1] == 0){
CloseUp.mTrophies.visible = false;
};
CloseUp.aName.text = GameData.treasureAchievements[1][2];
CloseUp.aDesc.text = ((("Collected " + GameData.treasureAchievements[1][0]) + " ") + GameData.treasureAchievements[1][3]);
CloseUp.aWorth.text = (("Worth : " + GameData.treasureAchievements[1][1]) + "$");
}
private function gotoSponsor(_arg1:MouseEvent){
addChild(SponsorCloseUp);
}
private function d4CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.mTrophies.visible = false;
CloseUp.dTrophies.visible = true;
CloseUp.dTrophies.gotoAndStop(5);
if (GameData.depthAchievementsDone[4] == 0){
CloseUp.dTrophies.visible = false;
};
CloseUp.aName.text = GameData.depthAchievements[4][2];
CloseUp.aDesc.text = (("Reached a depth of " + GameData.depthAchievements[4][0]) + " feet");
CloseUp.aWorth.text = (("Worth : " + GameData.depthAchievements[4][1]) + "$");
}
private function d0CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.mTrophies.visible = false;
CloseUp.dTrophies.visible = true;
CloseUp.dTrophies.gotoAndStop(1);
if (GameData.depthAchievementsDone[0] == 0){
CloseUp.dTrophies.visible = false;
};
CloseUp.aName.text = GameData.depthAchievements[0][2];
CloseUp.aDesc.text = (("Reached a depth of " + GameData.depthAchievements[0][0]) + " feet");
CloseUp.aWorth.text = (("Worth : " + GameData.depthAchievements[0][1]) + "$");
}
private function m0CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.dTrophies.visible = false;
CloseUp.mTrophies.visible = true;
CloseUp.mTrophies.gotoAndStop(1);
if (GameData.treasureAchievementsDone[0] == 0){
CloseUp.mTrophies.visible = false;
};
CloseUp.aName.text = GameData.treasureAchievements[0][2];
CloseUp.aDesc.text = ((("Collected " + GameData.treasureAchievements[0][0]) + " ") + GameData.treasureAchievements[0][3]);
CloseUp.aWorth.text = (("Worth : " + GameData.treasureAchievements[0][1]) + "$");
}
private function m4CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.dTrophies.visible = false;
CloseUp.mTrophies.visible = true;
CloseUp.mTrophies.gotoAndStop(5);
if (GameData.treasureAchievementsDone[4] == 0){
CloseUp.mTrophies.visible = false;
};
CloseUp.aName.text = GameData.treasureAchievements[4][2];
CloseUp.aDesc.text = ((("Collected " + GameData.treasureAchievements[4][0]) + " ") + GameData.treasureAchievements[4][3]);
CloseUp.aWorth.text = (("Worth : " + GameData.treasureAchievements[4][1]) + "$");
}
private function d3CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.mTrophies.visible = false;
CloseUp.dTrophies.visible = true;
CloseUp.dTrophies.gotoAndStop(4);
if (GameData.depthAchievementsDone[3] == 0){
CloseUp.dTrophies.visible = false;
};
CloseUp.aName.text = GameData.depthAchievements[3][2];
CloseUp.aDesc.text = (("Reached a depth of " + GameData.depthAchievements[3][0]) + " feet");
CloseUp.aWorth.text = (("Worth : " + GameData.depthAchievements[3][1]) + "$");
}
private function m3CloseUp(_arg1:MouseEvent){
addChild(CloseUp);
CloseUp.dTrophies.visible = false;
CloseUp.mTrophies.visible = true;
CloseUp.mTrophies.gotoAndStop(4);
if (GameData.treasureAchievementsDone[3] == 0){
CloseUp.mTrophies.visible = false;
};
CloseUp.aName.text = GameData.treasureAchievements[3][2];
CloseUp.aDesc.text = ((("Collected " + GameData.treasureAchievements[3][0]) + " ") + GameData.treasureAchievements[3][3]);
CloseUp.aWorth.text = (("Worth : " + GameData.treasureAchievements[3][1]) + "$");
}
private function updateDisplay(){
if (GameData.treasureAchievementsDone[0] == 0){
m0.alpha = 0;
};
if (GameData.treasureAchievementsDone[1] == 0){
m1.alpha = 0;
};
if (GameData.treasureAchievementsDone[2] == 0){
m2.alpha = 0;
};
if (GameData.treasureAchievementsDone[3] == 0){
m3.alpha = 0;
};
if (GameData.treasureAchievementsDone[4] == 0){
m4.alpha = 0;
};
if (GameData.treasureAchievementsDone[5] == 0){
m5.alpha = 0;
};
if (GameData.depthAchievementsDone[0] == 0){
d0.alpha = 0;
};
if (GameData.depthAchievementsDone[1] == 0){
d1.alpha = 0;
};
if (GameData.depthAchievementsDone[2] == 0){
d2.alpha = 0;
};
if (GameData.depthAchievementsDone[3] == 0){
d3.alpha = 0;
};
if (GameData.depthAchievementsDone[4] == 0){
d4.alpha = 0;
};
if (GameData.depthAchievementsDone[5] == 0){
d5.alpha = 0;
};
}
private function switchToUprades(_arg1:MouseEvent){
launcher.switchToUprades();
}
public function destroy(){
m0.removeEventListener(MouseEvent.CLICK, m0CloseUp);
m1.removeEventListener(MouseEvent.CLICK, m1CloseUp);
m2.removeEventListener(MouseEvent.CLICK, m2CloseUp);
m3.removeEventListener(MouseEvent.CLICK, m3CloseUp);
m4.removeEventListener(MouseEvent.CLICK, m4CloseUp);
m5.removeEventListener(MouseEvent.CLICK, m5CloseUp);
d0.removeEventListener(MouseEvent.CLICK, d0CloseUp);
d1.removeEventListener(MouseEvent.CLICK, d1CloseUp);
d2.removeEventListener(MouseEvent.CLICK, d2CloseUp);
d3.removeEventListener(MouseEvent.CLICK, d3CloseUp);
d4.removeEventListener(MouseEvent.CLICK, d4CloseUp);
d5.removeEventListener(MouseEvent.CLICK, d5CloseUp);
if (GameData.nonex == false){
bHonor.removeEventListener(MouseEvent.CLICK, gotoSponsor);
};
SponsorCloseUp.clean();
SponsorCloseUp = null;
bUpgrades.removeEventListener(MouseEvent.CLICK, switchToUprades);
var _local1:uint = this.numChildren;
var _local2:uint;
_local2 = 0;
while (_local2 < _local1) {
this.removeChildAt(0);
_local2++;
};
launcher = null;
}
}
}//package game.menus
Section 88
//UpgradeMenu (game.menus.UpgradeMenu)
package game.menus {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
import game.*;
public class UpgradeMenu extends MovieClip {
public var bSkip:MovieClip;
private var nitroCost:Array;
private var upgradeCost:Array;
public var lNitro:MovieClip;
private var moleCost:Array;
public var bDrill:MovieClip;
public var bMole:MovieClip;
private var submenu;
private var launcher:launch;
private var fuelCost:Array;
public var tMoney:TextField;
public var lMole:MovieClip;
public var bWheel:MovieClip;
public var bFuel:MovieClip;
public var lFuel:MovieClip;
public var bRadar:MovieClip;
public var bHull:MovieClip;
public var bTrophies:MovieClip;
public var bNitro:MovieClip;
public var lWheel:MovieClip;
public var lHull:MovieClip;
public var lDrill:MovieClip;
public var bVacation:MovieClip;
public var tCost:TextField;
public var tDescription:TextField;
private var radarCost:Array;
public var lRadar:MovieClip;
public function UpgradeMenu(_arg1){
upgradeCost = new Array(15, 35, 65, 110, 190, 280, 450, 800, 1300, 1900);
fuelCost = new Array(10, 30, 55, 140, 220, 330, 575, 1000, 1750, 2300);
radarCost = new Array(10, 20, 40, 75, 110, 175, 350, 650, 1100, 1600);
nitroCost = new Array(200, 350, 500, 750);
moleCost = new Array(500, 750, 1500, 2500);
super();
this.launcher = _arg1;
displayNoCost();
update();
var _local2:ButtonMode = new ButtonMode(bSkip);
var _local3:ButtonMode = new ButtonMode(bTrophies);
var _local4:ButtonMode = new ButtonMode(bVacation);
bSkip.addEventListener(MouseEvent.CLICK, skip);
bTrophies.addEventListener(MouseEvent.CLICK, switchToTrophies);
bVacation.addEventListener(MouseEvent.CLICK, askVacation);
var _local5:ButtonMode = new ButtonMode(bFuel);
var _local6:ButtonMode = new ButtonMode(bWheel);
var _local7:ButtonMode = new ButtonMode(bDrill);
var _local8:ButtonMode = new ButtonMode(bHull);
var _local9:ButtonMode = new ButtonMode(bRadar);
var _local10:ButtonMode = new ButtonMode(bNitro);
var _local11:ButtonMode = new ButtonMode(bMole);
bFuel.addEventListener(MouseEvent.CLICK, upgradeFuel);
bWheel.addEventListener(MouseEvent.CLICK, upgradeWheel);
bDrill.addEventListener(MouseEvent.CLICK, upgradeDrill);
bHull.addEventListener(MouseEvent.CLICK, upgradeHull);
bRadar.addEventListener(MouseEvent.CLICK, upgradeRadar);
bNitro.addEventListener(MouseEvent.CLICK, upgradeNitro);
bMole.addEventListener(MouseEvent.CLICK, upgradeMole);
bFuel.addEventListener(MouseEvent.ROLL_OVER, fuelOver);
bWheel.addEventListener(MouseEvent.ROLL_OVER, wheelOver);
bDrill.addEventListener(MouseEvent.ROLL_OVER, drillOver);
bHull.addEventListener(MouseEvent.ROLL_OVER, hullOver);
bRadar.addEventListener(MouseEvent.ROLL_OVER, radarOver);
bNitro.addEventListener(MouseEvent.ROLL_OVER, nitroOver);
bMole.addEventListener(MouseEvent.ROLL_OVER, moleOver);
bFuel.addEventListener(MouseEvent.ROLL_OUT, costOut);
bWheel.addEventListener(MouseEvent.ROLL_OUT, costOut);
bDrill.addEventListener(MouseEvent.ROLL_OUT, costOut);
bHull.addEventListener(MouseEvent.ROLL_OUT, costOut);
bRadar.addEventListener(MouseEvent.ROLL_OUT, costOut);
bNitro.addEventListener(MouseEvent.ROLL_OUT, costOut);
bMole.addEventListener(MouseEvent.ROLL_OUT, costOut);
displayTutorials();
displayMoney();
}
private function displayFuelCost(){
if (GameData.fuel < GameData.maxLevel){
tCost.text = fuelCost[GameData.fuel];
tDescription.text = "Drive that MegaDrill for longer with a bigger fuel tank.";
} else {
displayNoCost();
};
}
private function nitroOver(_arg1:MouseEvent){
displayNitroCost();
}
private function moleOver(_arg1:MouseEvent){
displayMoleCost();
}
private function displayNoCost(){
tCost.text = "0";
tDescription.text = "";
}
private function upgradeHull(_arg1:MouseEvent){
if ((((GameData.hull < GameData.maxLevel)) && ((GameData.money >= upgradeCost[GameData.hull])))){
GameData.money = (GameData.money - upgradeCost[GameData.hull]);
GameData.hull++;
displayHullCost();
update();
};
}
private function displayHullCost(){
if (GameData.hull < GameData.maxLevel){
tCost.text = upgradeCost[GameData.hull];
tDescription.text = "A stronger hull will support more pressure.";
} else {
displayNoCost();
};
}
private function displayWheelCost(){
if (GameData.wheel < GameData.maxLevel){
tCost.text = upgradeCost[GameData.wheel];
tDescription.text = "Turn faster with a better driving wheel.";
} else {
displayNoCost();
};
}
private function fuelOver(_arg1:MouseEvent){
displayFuelCost();
}
private function displayDrillCost(){
if (GameData.drill < GameData.maxLevel){
tCost.text = upgradeCost[GameData.drill];
tDescription.text = "Drill faster with a stronger MegaDrill bit.";
} else {
displayNoCost();
};
}
private function displayMoney(){
tMoney.text = GameData.money.toString();
}
private function upgradeWheel(_arg1:MouseEvent){
if ((((GameData.wheel < GameData.maxLevel)) && ((GameData.money >= upgradeCost[GameData.wheel])))){
GameData.money = (GameData.money - upgradeCost[GameData.wheel]);
GameData.wheel++;
displayWheelCost();
update();
};
}
private function switchToTrophies(_arg1:MouseEvent){
launcher.switchToTrophies();
}
private function costOut(_arg1:MouseEvent){
displayNoCost();
}
private function upgradeRadar(_arg1:MouseEvent){
if ((((GameData.radar < GameData.maxLevel)) && ((GameData.money >= radarCost[GameData.radar])))){
GameData.money = (GameData.money - radarCost[GameData.radar]);
GameData.radar++;
displayRadarCost();
update();
};
}
private function displayTutorials(){
var addTutorial:Function = function (){
addChild(submenu);
submenu.skipButton.addEventListener(MouseEvent.CLICK, closeTutorial);
};
if (GameData.fullyUpgraded == false){
bVacation.visible = false;
if ((((((((((((((GameData.fuel == GameData.maxLevel)) && ((GameData.wheel == GameData.maxLevel)))) && ((GameData.drill == GameData.maxLevel)))) && ((GameData.hull == GameData.maxLevel)))) && ((GameData.radar == GameData.maxLevel)))) && ((GameData.mole == 4)))) && ((GameData.nitro == 4)))){
bVacation.visible = true;
GameData.fullyUpgraded = true;
GameData.googleTrack("Game", ("Full Upgrade : " + GameData.weekLeft), GameData.money);
submenu = new MomLetter();
addTutorial();
launcher.kongregate.stats.submit("FullyUpgraded", GameData.weekLeft);
} else {
if ((((GameData.weekLeft == 12)) && ((GameData.tutoTrophies == true)))){
GameData.tutoTrophies = false;
submenu = new tutorialTrophies();
addTutorial();
};
};
};
}
private function upgradeDrill(_arg1:MouseEvent){
if ((((GameData.drill < GameData.maxLevel)) && ((GameData.money >= upgradeCost[GameData.drill])))){
GameData.money = (GameData.money - upgradeCost[GameData.drill]);
GameData.drill++;
displayDrillCost();
update();
};
}
private function displayRadarCost(){
if (GameData.radar < GameData.maxLevel){
tCost.text = radarCost[GameData.radar];
tDescription.text = "Find riches through the rocks with this money-radar.";
} else {
displayNoCost();
};
}
private function upgradeNitro(_arg1:MouseEvent){
if ((((GameData.nitro < 4)) && ((GameData.money >= nitroCost[GameData.nitro])))){
GameData.money = (GameData.money - nitroCost[GameData.nitro]);
GameData.nitro++;
displayNitroCost();
update();
};
}
private function radarOver(_arg1:MouseEvent){
displayRadarCost();
}
private function hullOver(_arg1:MouseEvent){
displayHullCost();
}
private function wheelOver(_arg1:MouseEvent){
displayWheelCost();
}
private function displayMoleCost(){
if (GameData.mole < 4){
tCost.text = moleCost[GameData.mole];
tDescription.text = "The Mechanical Mole will dig up far away treasures for you.";
} else {
displayNoCost();
};
}
private function update(){
lFuel.gotoAndStop((GameData.fuel + 1));
lWheel.gotoAndStop((GameData.wheel + 1));
lDrill.gotoAndStop((GameData.drill + 1));
lHull.gotoAndStop((GameData.hull + 1));
lRadar.gotoAndStop((GameData.radar + 1));
lNitro.gotoAndStop((GameData.nitro + 1));
lMole.gotoAndStop((GameData.mole + 1));
if ((((GameData.money < fuelCost[GameData.fuel])) || ((GameData.fuel == GameData.maxLevel)))){
bFuel.alpha = 0.2;
} else {
bFuel.alpha = 1;
};
if ((((GameData.money < upgradeCost[GameData.wheel])) || ((GameData.wheel == GameData.maxLevel)))){
bWheel.alpha = 0.2;
} else {
bWheel.alpha = 1;
};
if ((((GameData.money < upgradeCost[GameData.drill])) || ((GameData.drill == GameData.maxLevel)))){
bDrill.alpha = 0.2;
} else {
bDrill.alpha = 1;
};
if ((((GameData.money < upgradeCost[GameData.hull])) || ((GameData.hull == GameData.maxLevel)))){
bHull.alpha = 0.2;
} else {
bHull.alpha = 1;
};
if ((((GameData.money < radarCost[GameData.radar])) || ((GameData.radar == GameData.maxLevel)))){
bRadar.alpha = 0.2;
} else {
bRadar.alpha = 1;
};
if ((((GameData.money < nitroCost[GameData.nitro])) || ((GameData.nitro == 4)))){
bNitro.alpha = 0.2;
} else {
bNitro.alpha = 1;
};
if ((((GameData.money < moleCost[GameData.mole])) || ((GameData.mole == 4)))){
bMole.alpha = 0.2;
} else {
bMole.alpha = 1;
};
displayMoney();
}
public function endGame(){
launcher.goToEnding();
}
private function upgradeMole(_arg1:MouseEvent){
if ((((GameData.mole < 4)) && ((GameData.money >= moleCost[GameData.mole])))){
GameData.money = (GameData.money - moleCost[GameData.mole]);
GameData.mole++;
displayMoleCost();
update();
};
}
private function drillOver(_arg1:MouseEvent){
displayDrillCost();
}
private function upgradeFuel(_arg1:MouseEvent){
if ((((GameData.fuel < GameData.maxLevel)) && ((GameData.money >= fuelCost[GameData.fuel])))){
GameData.money = (GameData.money - fuelCost[GameData.fuel]);
GameData.fuel++;
displayFuelCost();
update();
};
}
private function closeTutorial(_arg1:MouseEvent){
submenu.skipButton.removeEventListener(MouseEvent.CLICK, closeTutorial);
removeChild(submenu);
submenu = null;
displayTutorials();
}
private function displayNitroCost(){
if (GameData.nitro < 4){
tCost.text = nitroCost[GameData.nitro];
tDescription.text = "These powerful fuels will burn throught the hardest rocks at the press of a button.";
} else {
displayNoCost();
};
}
private function askVacation(_arg1:MouseEvent){
submenu = new TakeVacation(this);
addChild(submenu);
}
public function destroy(){
bSkip.removeEventListener(MouseEvent.CLICK, skip);
bTrophies.removeEventListener(MouseEvent.CLICK, switchToTrophies);
var _local1:uint = this.numChildren;
var _local2:uint;
_local2 = 0;
while (_local2 < _local1) {
this.removeChildAt(0);
_local2++;
};
launcher = null;
submenu = null;
}
private function skip(_arg1:MouseEvent){
launcher.startGame();
}
}
}//package game.menus
Section 89
//bg0 (game.tiles.bg0)
package game.tiles {
import flash.display.*;
public dynamic class bg0 extends MovieClip {
}
}//package game.tiles
Section 90
//bg1 (game.tiles.bg1)
package game.tiles {
import flash.display.*;
public dynamic class bg1 extends MovieClip {
}
}//package game.tiles
Section 91
//bg2 (game.tiles.bg2)
package game.tiles {
import flash.display.*;
public dynamic class bg2 extends MovieClip {
}
}//package game.tiles
Section 92
//empty (game.tiles.empty)
package game.tiles {
import flash.display.*;
public class empty extends MovieClip {
public var type:String;// = "empty"
}
}//package game.tiles
Section 93
//g0 (game.tiles.g0)
package game.tiles {
import flash.display.*;
public class g0 extends Ground {
private var _resistance:int;// = 40
private var tile:Class;
private var graphic:Bitmap;
public function g0(){
tile = g0_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 94
//g0_tile (game.tiles.g0_tile)
package game.tiles {
import mx.core.*;
public class g0_tile extends BitmapAsset {
}
}//package game.tiles
Section 95
//g0a (game.tiles.g0a)
package game.tiles {
import flash.display.*;
public class g0a extends Ground {
private var _resistance:int;// = 40
private var tile:Class;
private var graphic:Bitmap;
public function g0a(){
tile = g0a_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 96
//g0a_tile (game.tiles.g0a_tile)
package game.tiles {
import mx.core.*;
public class g0a_tile extends BitmapAsset {
}
}//package game.tiles
Section 97
//g1 (game.tiles.g1)
package game.tiles {
import flash.display.*;
public class g1 extends Ground {
private var _resistance:int;// = 60
private var tile:Class;
private var graphic:Bitmap;
public function g1(){
tile = g1_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 98
//g1_tile (game.tiles.g1_tile)
package game.tiles {
import mx.core.*;
public class g1_tile extends BitmapAsset {
}
}//package game.tiles
Section 99
//g10 (game.tiles.g10)
package game.tiles {
import flash.display.*;
public class g10 extends Ground {
private var _resistance:int;// = 390
private var tile:Class;
private var graphic:Bitmap;
public function g10(){
tile = g10_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 100
//g10_tile (game.tiles.g10_tile)
package game.tiles {
import mx.core.*;
public class g10_tile extends BitmapAsset {
}
}//package game.tiles
Section 101
//g11 (game.tiles.g11)
package game.tiles {
import flash.display.*;
public class g11 extends Ground {
private var _resistance:int;// = 440
private var tile:Class;
private var graphic:Bitmap;
public function g11(){
tile = g11_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 102
//g11_tile (game.tiles.g11_tile)
package game.tiles {
import mx.core.*;
public class g11_tile extends BitmapAsset {
}
}//package game.tiles
Section 103
//g2 (game.tiles.g2)
package game.tiles {
import flash.display.*;
public class g2 extends Ground {
private var _resistance:int;// = 90
private var tile:Class;
private var graphic:Bitmap;
public function g2(){
tile = g2_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 104
//g2_tile (game.tiles.g2_tile)
package game.tiles {
import mx.core.*;
public class g2_tile extends BitmapAsset {
}
}//package game.tiles
Section 105
//g3 (game.tiles.g3)
package game.tiles {
import flash.display.*;
public class g3 extends Ground {
private var _resistance:int;// = 120
private var tile:Class;
private var graphic:Bitmap;
public function g3(){
tile = g3_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 106
//g3_tile (game.tiles.g3_tile)
package game.tiles {
import mx.core.*;
public class g3_tile extends BitmapAsset {
}
}//package game.tiles
Section 107
//g4 (game.tiles.g4)
package game.tiles {
import flash.display.*;
public class g4 extends Ground {
private var _resistance:int;// = 150
private var tile:Class;
private var graphic:Bitmap;
public function g4(){
tile = g4_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 108
//g4_tile (game.tiles.g4_tile)
package game.tiles {
import mx.core.*;
public class g4_tile extends BitmapAsset {
}
}//package game.tiles
Section 109
//g5 (game.tiles.g5)
package game.tiles {
import flash.display.*;
public class g5 extends Ground {
private var _resistance:int;// = 180
private var tile:Class;
private var graphic:Bitmap;
public function g5(){
tile = g5_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 110
//g5_tile (game.tiles.g5_tile)
package game.tiles {
import mx.core.*;
public class g5_tile extends BitmapAsset {
}
}//package game.tiles
Section 111
//g6 (game.tiles.g6)
package game.tiles {
import flash.display.*;
public class g6 extends Ground {
private var _resistance:int;// = 220
private var tile:Class;
private var graphic:Bitmap;
public function g6(){
tile = g6_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 112
//g6_tile (game.tiles.g6_tile)
package game.tiles {
import mx.core.*;
public class g6_tile extends BitmapAsset {
}
}//package game.tiles
Section 113
//g7 (game.tiles.g7)
package game.tiles {
import flash.display.*;
public class g7 extends Ground {
private var _resistance:int;// = 260
private var tile:Class;
private var graphic:Bitmap;
public function g7(){
tile = g7_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 114
//g7_tile (game.tiles.g7_tile)
package game.tiles {
import mx.core.*;
public class g7_tile extends BitmapAsset {
}
}//package game.tiles
Section 115
//g8 (game.tiles.g8)
package game.tiles {
import flash.display.*;
public class g8 extends Ground {
private var _resistance:int;// = 300
private var tile:Class;
private var graphic:Bitmap;
public function g8(){
tile = g8_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 116
//g8_tile (game.tiles.g8_tile)
package game.tiles {
import mx.core.*;
public class g8_tile extends BitmapAsset {
}
}//package game.tiles
Section 117
//g9 (game.tiles.g9)
package game.tiles {
import flash.display.*;
public class g9 extends Ground {
private var _resistance:int;// = 340
private var tile:Class;
private var graphic:Bitmap;
public function g9(){
tile = g9_tile;
super();
graphic = new tile();
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 118
//g9_tile (game.tiles.g9_tile)
package game.tiles {
import mx.core.*;
public class g9_tile extends BitmapAsset {
}
}//package game.tiles
Section 119
//Ground (game.tiles.Ground)
package game.tiles {
import flash.display.*;
public class Ground extends Sprite {
public var style:int;// = 1
private var _resistance:int;// = 10
public var type:String;// = "ground"
public function shake(_arg1:Bitmap){
scaleX = 1.1;
scaleY = 1.1;
_arg1.x = (((Math.random() * 2) - 1) - 12.5);
_arg1.y = (((Math.random() * 2) - 1) - 12.5);
}
public function explode(){
this.y = -1000;
}
}
}//package game.tiles
Section 120
//Money (game.tiles.Money)
package game.tiles {
import flash.display.*;
public class Money extends Sprite {
public var type:String;// = "money"
}
}//package game.tiles
Section 121
//money1 (game.tiles.money1)
package game.tiles {
import flash.display.*;
public class money1 extends Money {
public var value:int;// = 1
public var nature:int;// = 0
private var graphic:Bitmap;
private var tile:Class;
public function money1(){
tile = money1_tile;
super();
graphic = new tile();
graphic.x = (-(graphic.width) * 0.5);
graphic.y = (-(graphic.height) * 0.5);
addChild(graphic);
}
}
}//package game.tiles
Section 122
//money1_tile (game.tiles.money1_tile)
package game.tiles {
import mx.core.*;
public class money1_tile extends BitmapAsset {
}
}//package game.tiles
Section 123
//money2 (game.tiles.money2)
package game.tiles {
import flash.display.*;
public class money2 extends Money {
public var value:int;// = 3
public var nature:int;// = 0
private var graphic:Bitmap;
private var tile:Class;
public function money2(){
tile = money2_tile;
super();
graphic = new tile();
graphic.x = (-(graphic.width) * 0.5);
graphic.y = (-(graphic.height) * 0.5);
addChild(graphic);
}
}
}//package game.tiles
Section 124
//money2_tile (game.tiles.money2_tile)
package game.tiles {
import mx.core.*;
public class money2_tile extends BitmapAsset {
}
}//package game.tiles
Section 125
//money3 (game.tiles.money3)
package game.tiles {
import flash.display.*;
public class money3 extends Money {
public var value:int;// = 5
public var nature:int;// = 0
private var graphic:Bitmap;
private var tile:Class;
public function money3(){
tile = money3_tile;
super();
graphic = new tile();
graphic.x = (-(graphic.width) * 0.5);
graphic.y = (-(graphic.height) * 0.5);
addChild(graphic);
}
}
}//package game.tiles
Section 126
//money3_tile (game.tiles.money3_tile)
package game.tiles {
import mx.core.*;
public class money3_tile extends BitmapAsset {
}
}//package game.tiles
Section 127
//money4 (game.tiles.money4)
package game.tiles {
import flash.display.*;
public class money4 extends Money {
public var value:int;// = 10
public var nature:int;// = 0
private var graphic:Bitmap;
private var tile:Class;
public function money4(){
tile = money4_tile;
super();
graphic = new tile();
graphic.x = (-(graphic.width) * 0.5);
graphic.y = (-(graphic.height) * 0.5);
addChild(graphic);
}
}
}//package game.tiles
Section 128
//money4_tile (game.tiles.money4_tile)
package game.tiles {
import mx.core.*;
public class money4_tile extends BitmapAsset {
}
}//package game.tiles
Section 129
//money5 (game.tiles.money5)
package game.tiles {
import flash.display.*;
public class money5 extends Money {
public var nature:int;// = 1
public var weight:int;// = 10
private var tile:Class;
private var graphic:Bitmap;
public function money5(){
tile = money5_tile;
super();
graphic = new tile();
graphic.x = (-(graphic.width) * 0.5);
graphic.y = (-(graphic.height) * 0.5);
addChild(graphic);
}
}
}//package game.tiles
Section 130
//money5_tile (game.tiles.money5_tile)
package game.tiles {
import mx.core.*;
public class money5_tile extends BitmapAsset {
}
}//package game.tiles
Section 131
//money6 (game.tiles.money6)
package game.tiles {
import flash.display.*;
public class money6 extends Money {
public var nature:int;// = 2
public var weight:int;// = 5
private var tile:Class;
private var graphic:Bitmap;
public function money6(){
tile = money6_tile;
super();
graphic = new tile();
graphic.x = (-(graphic.width) * 0.5);
graphic.y = (-(graphic.height) * 0.5);
addChild(graphic);
}
}
}//package game.tiles
Section 132
//money6_tile (game.tiles.money6_tile)
package game.tiles {
import mx.core.*;
public class money6_tile extends BitmapAsset {
}
}//package game.tiles
Section 133
//money7 (game.tiles.money7)
package game.tiles {
import flash.display.*;
public class money7 extends Money {
public var nature:int;// = 3
public var weight:int;// = 5
private var tile:Class;
private var graphic:Bitmap;
public function money7(){
tile = money7_tile;
super();
graphic = new tile();
graphic.x = (-(graphic.width) * 0.5);
graphic.y = (-(graphic.height) * 0.5);
addChild(graphic);
}
}
}//package game.tiles
Section 134
//money7_tile (game.tiles.money7_tile)
package game.tiles {
import mx.core.*;
public class money7_tile extends BitmapAsset {
}
}//package game.tiles
Section 135
//money8 (game.tiles.money8)
package game.tiles {
import flash.display.*;
public class money8 extends Money {
public var nature:int;// = 4
public var weight:int;// = 10
private var tile:Class;
private var graphic:Bitmap;
public function money8(){
tile = money8_tile;
super();
graphic = new tile();
graphic.x = (-(graphic.width) * 0.5);
graphic.y = (-(graphic.height) * 0.5);
addChild(graphic);
}
}
}//package game.tiles
Section 136
//money8_tile (game.tiles.money8_tile)
package game.tiles {
import mx.core.*;
public class money8_tile extends BitmapAsset {
}
}//package game.tiles
Section 137
//money9 (game.tiles.money9)
package game.tiles {
import flash.display.*;
public class money9 extends Money {
public var nature:int;// = 5
public var weight:int;// = 25
private var tile:Class;
private var graphic:Bitmap;
public function money9(){
tile = money9_tile;
super();
graphic = new tile();
graphic.x = (-(graphic.width) * 0.5);
graphic.y = (-(graphic.height) * 0.5);
addChild(graphic);
}
}
}//package game.tiles
Section 138
//money9_tile (game.tiles.money9_tile)
package game.tiles {
import mx.core.*;
public class money9_tile extends BitmapAsset {
}
}//package game.tiles
Section 139
//Rock1 (game.tiles.Rock1)
package game.tiles {
import flash.display.*;
public class Rock1 extends Ground {
private var tile1:Class;
private var tile2:Class;
private var tile3:Class;
private var graphic:Bitmap;
public var _resistance:int;// = 250
public function Rock1(){
tile1 = Rock1_tile1;
tile2 = Rock1_tile2;
tile3 = Rock1_tile3;
super();
type = "Rock";
var _local1:int = Math.ceil((Math.random() * 3));
if (_local1 == 1){
graphic = new tile1();
} else {
if (_local1 == 2){
graphic = new tile2();
} else {
if (_local1 == 3){
graphic = new tile3();
};
};
};
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 140
//Rock1_tile1 (game.tiles.Rock1_tile1)
package game.tiles {
import mx.core.*;
public class Rock1_tile1 extends BitmapAsset {
}
}//package game.tiles
Section 141
//Rock1_tile2 (game.tiles.Rock1_tile2)
package game.tiles {
import mx.core.*;
public class Rock1_tile2 extends BitmapAsset {
}
}//package game.tiles
Section 142
//Rock1_tile3 (game.tiles.Rock1_tile3)
package game.tiles {
import mx.core.*;
public class Rock1_tile3 extends BitmapAsset {
}
}//package game.tiles
Section 143
//Rock2 (game.tiles.Rock2)
package game.tiles {
import flash.display.*;
public class Rock2 extends Ground {
private var tile1:Class;
private var tile2:Class;
private var graphic:Bitmap;
public var _resistance:int;// = 750
public function Rock2(){
tile1 = Rock2_tile1;
tile2 = Rock2_tile2;
super();
type = "Rock";
var _local1:int = Math.ceil((Math.random() * 2));
if (_local1 == 1){
graphic = new tile1();
} else {
if (_local1 == 2){
graphic = new tile2();
};
};
graphic.x = (graphic.y = -12.5);
addChild(graphic);
}
public function drill(_arg1){
_resistance = (_resistance - _arg1);
if (_resistance > 0){
super.shake(this.graphic);
} else {
super.explode();
};
}
}
}//package game.tiles
Section 144
//Rock2_tile1 (game.tiles.Rock2_tile1)
package game.tiles {
import mx.core.*;
public class Rock2_tile1 extends BitmapAsset {
}
}//package game.tiles
Section 145
//Rock2_tile2 (game.tiles.Rock2_tile2)
package game.tiles {
import mx.core.*;
public class Rock2_tile2 extends BitmapAsset {
}
}//package game.tiles
Section 146
//sky (game.tiles.sky)
package game.tiles {
import flash.display.*;
public dynamic class sky extends MovieClip {
}
}//package game.tiles
Section 147
//HUD (game.UI.HUD)
package game.UI {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import game.*;
public class HUD extends MovieClip {
public var nitroGauge:MovieClip;
private var daSpeed:int;// = 0
private var faRing:int;// = 30
private var faSpeed:int;// = 0
private var daCount:int;// = 0
private var faCount:int;// = 0
private var drill:Drill;
private var daRing:int;// = 30
public var fuelGauge:MovieClip;
private var Sounds:SoundManager;
public var pressureGauge:MovieClip;
public var fuelAlarm:MovieClip;
public var depthGauge:MovieClip;
public function HUD(_arg1){
Sounds = SoundManager.getInstance();
super();
this.drill = _arg1;
this.depthGauge.tUnder.text = "8888";
addEventListener(Event.ENTER_FRAME, update);
addEventListener(Event.REMOVED_FROM_STAGE, clean);
}
private function soundAlarm(){
faCount = (faCount + faSpeed);
if ((((faCount >= faRing)) && ((drill.levelEnded == false)))){
if (GameData.soundOn){
Sounds.playSound("a_alarmFuel", 0.7);
};
fuelAlarm.gotoAndPlay(2);
faCount = 0;
};
daCount = (daCount + daSpeed);
if (daCount >= daRing){
daCount = 0;
};
}
private function update(_arg1:Event){
displayDepth();
displayFuel();
displayPressure();
displayNitro();
soundAlarm();
}
private function clean(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, update);
drill = null;
Sounds = null;
}
private function displayFuel(){
var _local1:int = Math.floor(((drill.fuel / drill.maxFuel) * 100));
fuelGauge.gotoAndStop((_local1 + 1));
if (drill.fuel <= 0){
faSpeed = 0;
faCount = 0;
} else {
if (drill.fuel < 75){
faSpeed = 2;
} else {
if (drill.fuel < 175){
faSpeed = 1;
};
};
};
}
private function displayDepth(){
if (drill.depth < 0){
this.depthGauge.tDepth.text = 0.toString();
} else {
this.depthGauge.tDepth.text = drill.depth.toString();
};
}
private function displayPressure(){
pressureGauge.gotoAndStop((drill.pressure + 1));
}
private function displayNitro(){
nitroGauge.gotoAndStop((drill.nitroNum + 1));
}
}
}//package game.UI
Section 148
//ActivityMonitor (game.utils.ActivityMonitor)
package game.utils {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.system.*;
public class ActivityMonitor extends Sprite {
private var sizeWidth:uint;// = 100
private var cornerRadius:uint;// = 9
private var sizeHeight:uint;// = 30
private var backGround:Shape;
private var zoneText:TextField;
private var gutter:uint;// = 5
private var bgColor:uint;// = 0xFFCC00
public function ActivityMonitor(){
zoneText = new TextField();
zoneText.name = "zoneTexte";
zoneText.selectable = false;
this.mouseChildren = false;
this.addEventListener(Event.ENTER_FRAME, refreshInfos);
this.addEventListener(MouseEvent.MOUSE_DOWN, grab);
this.addEventListener(MouseEvent.MOUSE_UP, letGo);
doDrawRoundRect();
addChild(zoneText);
}
private function traceDisplayList(_arg1:DisplayObjectContainer, _arg2:String=""):void{
var _local3:DisplayObject;
var _local4:uint;
while (_local4 < _arg1.numChildren) {
_local3 = _arg1.getChildAt(_local4);
trace(_arg2, _local3, _local3.name);
if ((_arg1.getChildAt(_local4) is DisplayObjectContainer)){
traceDisplayList(DisplayObjectContainer(_local3), (_arg2 + " "));
};
_local4++;
};
}
private function doDrawRoundRect():void{
var _local1:Shape = new Shape();
_local1.graphics.beginFill(bgColor);
_local1.graphics.drawRoundRect(0, 0, sizeWidth, sizeHeight, cornerRadius);
_local1.graphics.endFill();
_local1.name = "carreJaune";
addChild(_local1);
}
private function grab(_arg1:MouseEvent){
_arg1.target.startDrag();
}
private function refreshInfos(_arg1:Event){
zoneText.text = (("RAM used : " + Math.round(((System.totalMemory / 0x0400) / 0x0400))) + " mg");
}
private function letGo(_arg1:MouseEvent){
_arg1.target.stopDrag();
traceDisplayList(stage);
}
}
}//package game.utils
Section 149
//ButtonMode (game.utils.ButtonMode)
package game.utils {
import flash.events.*;
public class ButtonMode {
private var target;
public function ButtonMode(_arg1){
this.target = _arg1;
this.target.stop();
addFunctions();
}
private function over(_arg1:MouseEvent){
_arg1.target.gotoAndStop(2);
}
public function removeFunctions(){
target.buttonMode = false;
target.useHandCursor = false;
target.removeEventListener(MouseEvent.ROLL_OVER, over);
target.removeEventListener(MouseEvent.ROLL_OUT, out);
}
public function addFunctions(){
target.gotoAndStop(1);
target.buttonMode = true;
target.useHandCursor = true;
target.addEventListener(MouseEvent.ROLL_OVER, over);
target.addEventListener(MouseEvent.ROLL_OUT, out);
}
private function out(_arg1:MouseEvent){
_arg1.target.gotoAndStop(1);
}
}
}//package game.utils
Section 150
//FPSCounter (game.utils.FPSCounter)
package game.utils {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class FPSCounter extends Sprite {
private var tf:TextField;
private var ticks:uint;// = 0
private var last:uint;
public function FPSCounter(_arg1:int=0, _arg2:int=0, _arg3:uint=0xFFFFFF, _arg4:Boolean=false, _arg5:uint=0){
last = getTimer();
super();
x = _arg1;
y = _arg2;
tf = new TextField();
tf.textColor = _arg3;
tf.text = "----- fps";
tf.selectable = false;
tf.background = _arg4;
tf.backgroundColor = _arg5;
tf.autoSize = TextFieldAutoSize.LEFT;
addChild(tf);
width = tf.textWidth;
height = tf.textHeight;
addEventListener(Event.ENTER_FRAME, tick);
}
public function tick(_arg1:Event):void{
var _local4:Number;
ticks++;
var _local2:uint = getTimer();
var _local3:uint = (_local2 - last);
if (_local3 >= 1000){
_local4 = ((ticks / _local3) * 1000);
tf.text = (_local4.toFixed(1) + " fps");
ticks = 0;
last = _local2;
};
}
}
}//package game.utils
Section 151
//Key (game.utils.Key)
package game.utils {
import flash.display.*;
import flash.events.*;
public class Key {
private var initialized:Boolean;// = false
private var keysDown:Object;
public function Key(){
keysDown = new Object();
super();
}
public function initialize(_arg1:Stage){
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys);
initialized = true;
};
}
private function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
private function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
public function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
}
}//package game.utils
Section 152
//ObjectCreator (game.utils.ObjectCreator)
package game.utils {
import flash.display.*;
import flash.utils.*;
public class ObjectCreator {
public function create(_arg1:String, _arg2:DisplayObjectContainer, _arg3:int=0){
var _local4:Class = (getDefinitionByName(_arg1) as Class);
var _local5:* = new (_local4);
_arg2.addChild(_local5);
if (_arg3 != 0){
_local5.width = _arg3;
_local5.height = _arg3;
};
return (_local5);
}
}
}//package game.utils
Section 153
//SoundManager (game.utils.SoundManager)
package game.utils {
import flash.media.*;
import gs.*;
import flash.net.*;
import flash.utils.*;
public class SoundManager {
private var _sounds:Array;
private var _soundsDict:Dictionary;
private static var _instance:SoundManager;
private static var _allowInstance:Boolean;
public function SoundManager(){
this._soundsDict = new Dictionary(true);
this._sounds = new Array();
if (!SoundManager._allowInstance){
throw (new Error("Error: Use SoundManager.getInstance() instead of the new keyword."));
};
}
public function pauseSound(_arg1:String):void{
var _local2:Object = this._soundsDict[_arg1];
_local2.paused = true;
_local2.position = _local2.channel.position;
_local2.channel.stop();
}
public function fadeSound(_arg1:String, _arg2:Number=0, _arg3:Number=1):void{
var _local4:SoundChannel = this._soundsDict[_arg1].channel;
TweenLite.to(_local4, _arg3, {volume:_arg2});
}
public function get sounds():Array{
return (this._sounds);
}
public function setSoundVolume(_arg1:String, _arg2:Number):void{
var _local3:Object = this._soundsDict[_arg1];
var _local4:SoundTransform = _local3.channel.soundTransform;
_local4.volume = _arg2;
_local3.channel.soundTransform = _local4;
}
public function getSoundDuration(_arg1:String):Number{
return (this._soundsDict[_arg1].sound.length);
}
public function toString():String{
return (getQualifiedClassName(this));
}
public function getSoundVolume(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.soundTransform.volume);
}
public function addLibrarySound(_arg1, _arg2:String):Boolean{
var _local3:int;
while (_local3 < this._sounds.length) {
if (this._sounds[_local3].name == _arg2){
return (false);
};
_local3++;
};
var _local4:Object = new Object();
var _local5:Sound = new (_arg1);
_local4.name = _arg2;
_local4.sound = _local5;
_local4.channel = new SoundChannel();
_local4.position = 0;
_local4.paused = true;
_local4.volume = 1;
_local4.startTime = 0;
_local4.loops = 0;
_local4.pausedByAll = false;
this._soundsDict[_arg2] = _local4;
this._sounds.push(_local4);
return (true);
}
public function isSoundPaused(_arg1:String):Boolean{
return (this._soundsDict[_arg1].paused);
}
public function removeAllSounds():void{
var _local1:int;
while (_local1 < this._sounds.length) {
this._sounds[_local1] = null;
_local1++;
};
this._sounds = new Array();
this._soundsDict = new Dictionary(true);
}
public function getSoundPosition(_arg1:String):Number{
return (this._soundsDict[_arg1].channel.position);
}
public function stopAllSounds(_arg1:Boolean=true):void{
var _local3:String;
var _local2:int;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.stopSound(_local3);
};
} else {
this.stopSound(_local3);
};
_local2++;
};
}
public function removeSound(_arg1:String):void{
var _local2:int;
while (_local2 < this._sounds.length) {
if (this._sounds[_local2].name == _arg1){
this._sounds[_local2] = null;
this._sounds.splice(_local2, 1);
};
_local2++;
};
delete this._soundsDict[_arg1];
}
public function muteAllSounds():void{
var _local2:String;
var _local1:int;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
this.setSoundVolume(_local2, 0);
_local1++;
};
}
public function stopSound(_arg1:String):void{
var _local2:Object = this._soundsDict[_arg1];
_local2.paused = true;
_local2.channel.stop();
_local2.position = _local2.channel.position;
}
public function pauseAllSounds(_arg1:Boolean=true):void{
var _local3:String;
var _local2:int;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (!this._soundsDict[_local3].paused){
this._soundsDict[_local3].pausedByAll = true;
this.pauseSound(_local3);
};
} else {
this.pauseSound(_local3);
};
_local2++;
};
}
public function playAllSounds(_arg1:Boolean=false):void{
var _local3:String;
var _local2:int;
while (_local2 < this._sounds.length) {
_local3 = this._sounds[_local2].name;
if (_arg1){
if (this._soundsDict[_local3].pausedByAll){
this._soundsDict[_local3].pausedByAll = false;
this.playSound(_local3);
};
} else {
this.playSound(_local3);
};
_local2++;
};
}
public function addExternalSound(_arg1:String, _arg2:String, _arg3:Number=1000, _arg4:Boolean=false):Boolean{
var _local5:int;
while (_local5 < this._sounds.length) {
if (this._sounds[_local5].name == _arg2){
return (false);
};
_local5++;
};
var _local6:Object = new Object();
var _local7:Sound = new Sound(new URLRequest(_arg1), new SoundLoaderContext(_arg3, _arg4));
_local6.name = _arg2;
_local6.sound = _local7;
_local6.channel = new SoundChannel();
_local6.position = 0;
_local6.paused = true;
_local6.volume = 1;
_local6.startTime = 0;
_local6.loops = 0;
_local6.pausedByAll = false;
this._soundsDict[_arg2] = _local6;
this._sounds.push(_local6);
return (true);
}
public function unmuteAllSounds():void{
var _local2:String;
var _local3:Object;
var _local4:SoundTransform;
var _local1:int;
while (_local1 < this._sounds.length) {
_local2 = this._sounds[_local1].name;
_local3 = this._soundsDict[_local2];
_local4 = _local3.channel.soundTransform;
_local4.volume = _local3.volume;
_local3.channel.soundTransform = _local4;
_local1++;
};
}
public function isSoundPausedByAll(_arg1:String):Boolean{
return (this._soundsDict[_arg1].pausedByAll);
}
public function getSoundObject(_arg1:String):Sound{
return (this._soundsDict[_arg1].sound);
}
public function playSound(_arg1:String, _arg2:Number=1, _arg3:Number=0, _arg4:int=0):void{
var _local5:Object = this._soundsDict[_arg1];
_local5.volume = _arg2;
_local5.startTime = _arg3;
_local5.loops = _arg4;
if (_local5.paused){
_local5.channel = _local5.sound.play(_local5.position, _local5.loops, new SoundTransform(_local5.volume));
} else {
_local5.channel = _local5.sound.play(_arg3, _local5.loops, new SoundTransform(_local5.volume));
};
_local5.paused = false;
}
public static function getInstance():SoundManager{
if (SoundManager._instance == null){
SoundManager._allowInstance = true;
SoundManager._instance = new (SoundManager);
SoundManager._allowInstance = false;
};
return (SoundManager._instance);
}
}
}//package game.utils
Section 154
//TargetTracker (game.utils.TargetTracker)
package game.utils {
public class TargetTracker {
private var ang:Number;
private var dx:Number;
private var dy:Number;
private var rad:Number;
public function findDistance(_arg1, _arg2){
var _local3:Number = ((_arg1.x - _arg2.x) * (_arg1.x - _arg2.x));
var _local4:Number = ((_arg1.y - _arg2.y) * (_arg1.y - _arg2.y));
var _local5:Number = Math.sqrt((_local3 + _local4));
return (_local5);
}
public function findCoordDistance(_arg1, _arg2, _arg3, _arg4){
var _local5:Number = ((_arg1 - _arg3) * (_arg1 - _arg3));
var _local6:Number = ((_arg2 - _arg4) * (_arg2 - _arg4));
var _local7:Number = Math.sqrt((_local5 + _local6));
return (_local7);
}
public function findCoordAngle(_arg1, _arg2, _arg3, _arg4){
dx = (_arg1 - _arg3);
dy = (_arg2 - _arg4);
rad = (Math.atan2(dy, dx) + Math.PI);
ang = ((rad * 180) / Math.PI);
ang = (ang % 360);
return (ang);
}
public function findAngle(_arg1, _arg2){
dx = (_arg1.x - _arg2.x);
dy = (_arg1.y - _arg2.y);
rad = (Math.atan2(dy, dx) + Math.PI);
ang = ((rad * 180) / Math.PI);
ang = (ang % 360);
return ((ang + 90));
}
}
}//package game.utils
Section 155
//TileLayer (game.utils.TileLayer)
package game.utils {
import flash.display.*;
import flash.events.*;
import game.tiles.*;
public class TileLayer extends MovieClip {
private var loopFirstLine:int;
private var tileResize:int;
private var firstRow:int;
private var layerData:Array;
private var loopLastRow:int;
private var loopH:Boolean;// = false
private var host:DisplayObject;
private var lastLine:int;
private var creator:ObjectCreator;
private var ldWidth:int;
private var loopV:Boolean;// = false
public var objList:Array;
private var ldHeight:int;
private var firstLine:int;
private var rowNum:int;
private var loopFirstRow:int;
private var tileSize:int;
private var tileOffset:int;
private var screenH:int;
private var loopLastLine:int;
private var screenW:int;
private var lastRow:int;
private var layerPosX:int;
private var layerPosY:int;
private var lineNum:int;
private var tilePath:String;
public function TileLayer(_arg1:Array, _arg2, _arg3:int, _arg4:int, _arg5:int, _arg6:Boolean=true, _arg7:DisplayObject=null, _arg8:int=0, _arg9:int=0, _arg10:Boolean=true, _arg11:Boolean=true, _arg12:int=1){
objList = new Array();
creator = new ObjectCreator();
super();
tilePath = _arg2;
loopH = _arg10;
loopV = _arg11;
firstLine = _arg9;
firstRow = _arg8;
tileOffset = _arg12;
layerData = _arg1;
if (_arg7 == null){
host = this;
} else {
host = _arg7;
};
this.tileSize = _arg5;
if (_arg6){
this.tileResize = _arg5;
} else {
this.tileResize = 0;
};
screenW = _arg3;
screenH = _arg4;
}
private function addLineAtStart(){
var _local1:String;
firstLine--;
updateCount();
objList.unshift(new Array());
var _local2:int;
while (_local2 < rowNum) {
if ((((((firstLine < 0)) && ((loopV == false)))) || ((((firstLine >= ldHeight)) && ((loopV == false)))))){
_local1 = "empty";
} else {
if (((((_local2 + firstRow) < 0)) && ((loopH == true)))){
if (((_local2 + firstRow) - loopFirstRow) >= ldWidth){
_local1 = layerData[int((firstLine - loopFirstLine))][int((((_local2 + firstRow) - loopFirstRow) - ldWidth))];
} else {
_local1 = layerData[int((firstLine - loopFirstLine))][int(((_local2 + firstRow) - loopFirstRow))];
};
} else {
if (((((_local2 + firstRow) >= ldWidth)) && ((loopH == true)))){
if (((_local2 + firstRow) - loopLastRow) < 0){
_local1 = layerData[int((firstLine - loopFirstLine))][int((((_local2 + firstRow) - loopLastRow) + ldWidth))];
} else {
_local1 = layerData[int((firstLine - loopFirstLine))][int(((_local2 + firstRow) - loopLastRow))];
};
} else {
if (((((firstRow + _local2) >= 0)) && (((firstRow + _local2) < ldWidth)))){
_local1 = layerData[int((firstLine - loopFirstLine))][int((_local2 + firstRow))];
} else {
_local1 = "empty";
};
};
};
};
objList[0][_local2] = creator.create((tilePath + _local1), this, tileResize);
objList[0][_local2].x = ((_local2 + firstRow) * tileSize);
objList[0][_local2].y = (firstLine * tileSize);
_local2++;
};
}
public function destroy(){
var _local1:String;
var _local2:String;
removeEventListener(Event.ENTER_FRAME, updateLayer);
for (_local1 in objList) {
for (_local2 in objList[_local1]) {
removeChild(objList[_local1][_local2]);
};
};
objList = null;
host = null;
creator = null;
}
private function addLineAtEnd(){
var _local1:String;
objList[int(objList.length)] = new Array();
var _local2:int;
while (_local2 < rowNum) {
if ((((((lastLine >= ldHeight)) && ((loopV == false)))) || ((((lastLine < 0)) && ((loopV == false)))))){
_local1 = "empty";
} else {
if (((((firstRow + _local2) < 0)) && ((loopH == true)))){
if (((_local2 + firstRow) - loopFirstRow) >= ldWidth){
_local1 = layerData[int((lastLine - loopLastLine))][int((((_local2 + firstRow) - loopFirstRow) - ldWidth))];
} else {
_local1 = layerData[int((lastLine - loopLastLine))][int(((_local2 + firstRow) - loopFirstRow))];
};
} else {
if (((((firstRow + _local2) >= ldWidth)) && ((loopH == true)))){
if (((_local2 + firstRow) - loopLastRow) < 0){
_local1 = layerData[int((lastLine - loopLastLine))][int((((_local2 + firstRow) - loopLastRow) + ldWidth))];
} else {
_local1 = layerData[int((lastLine - loopLastLine))][int(((_local2 + firstRow) - loopLastRow))];
};
} else {
if (((((firstRow + _local2) >= 0)) && (((firstRow + _local2) < ldWidth)))){
_local1 = layerData[int((lastLine - loopLastLine))][int((_local2 + firstRow))];
} else {
_local1 = "empty";
};
};
};
};
objList[(objList.length - 1)][_local2] = creator.create((tilePath + _local1), this, tileResize);
objList[(objList.length - 1)][_local2].x = ((_local2 + firstRow) * tileSize);
objList[(objList.length - 1)][_local2].y = (lastLine * tileSize);
_local2++;
};
lastLine++;
updateCount();
}
private function updateLayer(_arg1:Event):void{
layerPosY = Math.floor((host.y / tileSize));
if ((layerPosY + lastLine) < (Math.floor((screenH / tileSize)) + tileOffset)){
addLineAtEnd();
removeLineAtStart();
} else {
if ((layerPosY + firstLine) > (0 - tileOffset)){
addLineAtStart();
removeLineAtEnd();
};
};
layerPosX = Math.floor((host.x / tileSize));
if ((layerPosX + lastRow) < (Math.floor((screenW / tileSize)) + tileOffset)){
addRowAtEnd();
removeRowAtStart();
} else {
if ((layerPosX + firstRow) > (0 - tileOffset)){
addRowAtStart();
removeRowAtEnd();
};
};
}
private function removeRowAtEnd(){
lastRow--;
updateCount();
var _local1:int = objList.length;
var _local2:int;
while (_local2 < _local1) {
removeChild(objList[_local2][int((objList[_local2].length - 1))]);
objList[_local2].pop();
_local2++;
};
}
private function addRowAtEnd(){
var _local1:String;
var _local2:int;
while (_local2 < lineNum) {
if ((((((lastRow >= ldWidth)) && ((loopH == false)))) || ((((lastRow < 0)) && ((loopH == false)))))){
_local1 = "empty";
} else {
if (((((firstLine + _local2) < 0)) && ((loopV == true)))){
if (((_local2 + firstLine) - loopFirstLine) >= ldHeight){
_local1 = layerData[int((((_local2 + firstLine) - loopFirstLine) - ldHeight))][int((lastRow - loopLastRow))];
} else {
_local1 = layerData[int(((_local2 + firstLine) - loopFirstLine))][int((lastRow - loopLastRow))];
};
} else {
if (((((firstLine + _local2) >= ldHeight)) && ((loopV == true)))){
if (((_local2 + firstLine) - loopLastLine) < 0){
_local1 = layerData[int((((_local2 + firstLine) - loopLastLine) + ldHeight))][int((lastRow - loopLastRow))];
} else {
_local1 = layerData[int(((_local2 + firstLine) - loopLastLine))][int((lastRow - loopLastRow))];
};
} else {
if (((((firstLine + _local2) >= 0)) && (((firstLine + _local2) < ldHeight)))){
_local1 = layerData[int((_local2 + firstLine))][int((lastRow - loopLastRow))];
} else {
_local1 = "empty";
};
};
};
};
objList[_local2].push(creator.create((tilePath + _local1), this, tileResize));
objList[_local2][(objList[_local2].length - 1)].x = (lastRow * tileSize);
objList[_local2][(objList[_local2].length - 1)].y = ((firstLine + _local2) * tileSize);
_local2++;
};
lastRow++;
updateCount();
}
private function removeLineAtStart(){
var _local1:String;
for (_local1 in objList[0]) {
removeChild(objList[0][_local1]);
};
objList.shift();
firstLine++;
updateCount();
}
private function addRowAtStart(){
var _local1:String;
firstRow--;
updateCount();
var _local2:int = objList.length;
var _local3:int;
while (_local3 < _local2) {
if ((((((firstRow < 0)) && ((loopH == false)))) || ((((firstRow >= ldHeight)) && ((loopH == false)))))){
_local1 = "empty";
} else {
if (((((firstLine + _local3) < 0)) && ((loopV == true)))){
if (((_local3 + firstLine) - loopFirstLine) >= ldHeight){
_local1 = layerData[int((((_local3 + firstLine) - loopFirstLine) - ldHeight))][int((firstRow - loopFirstRow))];
} else {
_local1 = layerData[int(((_local3 + firstLine) - loopFirstLine))][int((firstRow - loopFirstRow))];
};
} else {
if (((((firstLine + _local3) >= ldHeight)) && ((loopV == true)))){
if (((_local3 + firstLine) - loopLastLine) < 0){
_local1 = layerData[int((((_local3 + firstLine) - loopLastLine) + ldHeight))][int((firstRow - loopFirstRow))];
} else {
_local1 = layerData[int(((_local3 + firstLine) - loopLastLine))][int((firstRow - loopFirstRow))];
};
} else {
if (((((firstLine + _local3) >= 0)) && (((firstLine + _local3) < ldHeight)))){
_local1 = layerData[int((_local3 + firstLine))][int((firstRow - loopFirstRow))];
} else {
_local1 = "empty";
};
};
};
};
objList[_local3].unshift(creator.create((tilePath + _local1), this, tileResize));
objList[_local3][0].x = (firstRow * tileSize);
objList[_local3][0].y = ((_local3 + firstLine) * tileSize);
_local3++;
};
}
private function updateCount(){
lineNum = (lastLine - firstLine);
rowNum = (lastRow - firstRow);
loopFirstLine = (Math.floor((firstLine / ldHeight)) * ldHeight);
loopLastLine = (Math.floor((lastLine / ldHeight)) * ldHeight);
loopFirstRow = (Math.floor((firstRow / ldWidth)) * ldWidth);
loopLastRow = (Math.floor((lastRow / ldWidth)) * ldWidth);
}
private function removeRowAtStart(){
var _local1:int = objList.length;
var _local2:int;
while (_local2 < _local1) {
removeChild(objList[_local2][0]);
objList[_local2].shift();
_local2++;
};
firstRow++;
updateCount();
}
public function drawLayer(){
var _local2:int;
ldWidth = layerData[0].length;
ldHeight = layerData.length;
host.x = (-((firstRow + tileOffset)) * tileSize);
host.y = (-((firstLine + tileOffset)) * tileSize);
var _local1:int = Math.floor(((screenH / tileSize) + (tileOffset * 2)));
rowNum = (((screenW - this.x) / tileSize) + (tileOffset * 2));
lastRow = (firstRow + rowNum);
lastLine = firstLine;
if (layerEmpty()){
_local2 = 0;
while (_local2 < _local1) {
addLineAtEnd();
_local2++;
};
};
addEventListener(Event.ENTER_FRAME, updateLayer);
}
private function removeLineAtEnd(){
var _local2:String;
lastLine--;
updateCount();
var _local1:int = objList.length;
for (_local2 in objList[(_local1 - 1)]) {
removeChild(objList[int((_local1 - 1))][_local2]);
};
objList.pop();
}
private function layerEmpty(){
if (objList[0] != null){
trace("WARNING: clear layer before drawing a new one");
return (false);
};
return (true);
}
}
}//package game.utils
Section 156
//Cheats (game.Cheats)
package game {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class Cheats extends Sprite {
private var codeIndex:int;
private var cheatResult:Array;
private var cheatCodes:Array;
private var charIndex:int;// = 0
public function Cheats(){
cheatCodes = new Array(["m", "o", "n", "e", "y"], ["u", "p", "g", "r", "a", "d", "e"], ["d", "o", "w", "n", "g", "r", "a", "d", "e"]);
cheatResult = new Array([GameData.money, 10000]);
super();
addEventListener(Event.ADDED_TO_STAGE, addKeyChecker);
}
private function doCheat(_arg1){
if (_arg1 == 0){
GameData.money = (GameData.money + 100000);
} else {
if (_arg1 == 1){
GameData.fuel = 10;
GameData.wheel = 10;
GameData.drill = 10;
GameData.hull = 10;
GameData.radar = 10;
GameData.mole = 4;
GameData.nitro = 4;
} else {
if (_arg1 == 2){
GameData.fuel = 0;
GameData.wheel = 0;
GameData.drill = 0;
GameData.hull = 0;
GameData.radar = 0;
GameData.mole = 0;
GameData.nitro = 0;
};
};
};
}
private function addKeyChecker(_arg1:Event){
removeEventListener(Event.ADDED_TO_STAGE, addKeyChecker);
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKey);
}
private function codeCheck(_arg1:KeyboardEvent){
if (_arg1.charCode == Keyboard.SPACE){
trace("clear code entry");
charIndex = 0;
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKey);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, codeCheck);
};
if (String.fromCharCode(_arg1.charCode) == cheatCodes[codeIndex][charIndex]){
trace("key is correct");
if ((charIndex + 1) == cheatCodes[codeIndex].length){
trace("reached code last key");
doCheat(codeIndex);
charIndex = 0;
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKey);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, codeCheck);
} else {
charIndex++;
};
};
}
private function checkKey(_arg1:KeyboardEvent){
var _local2:int;
while (_local2 < cheatCodes.length) {
if (String.fromCharCode(_arg1.charCode) == cheatCodes[_local2][0]){
codeIndex = _local2;
charIndex = 1;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, checkKey);
stage.addEventListener(KeyboardEvent.KEY_DOWN, codeCheck);
trace(("started tracking code : " + codeIndex));
};
_local2++;
};
}
}
}//package game
Section 157
//debris (game.debris)
package game {
import flash.display.*;
import flash.events.*;
public class debris extends MovieClip {
private var maxSpeed:int;// = 6
private var speed:Number;
private var accel:Number;// = 0.5
private var adjustX:int;
private var speedX:Number;
private var speedY:Number;
private var disappearTime:int;// = 10
public function debris(_arg1, _arg2, _arg3){
scaleX = (scaleY = Math.random());
speed = ((Math.random() * 5) + 2);
speedX = ((Math.random() * 10) - 5);
speedY = ((Math.random() * -3) - 1);
if (speedX > 0){
adjustX = 20;
} else {
adjustX = -20;
};
speedX = (speedX + (Math.cos(((_arg3 + 90) * (Math.PI / 180))) * -(speed)));
speedY = (Math.sin(((_arg3 + 90) * (Math.PI / 180))) * -(speed));
rotation = (Math.random() * 360);
var _local4:Number = (Math.cos(((_arg3 + 90) * (Math.PI / 180))) * 30);
var _local5:Number = (Math.sin(((_arg3 + 90) * (Math.PI / 180))) * 30);
var _local6:Number = (Math.cos(((-(_arg3) + 90) * (Math.PI / 180))) * adjustX);
var _local7:Number = (Math.sin(((-(_arg3) + 90) * (Math.PI / 180))) * adjustX);
x = ((_arg1 + _local4) + _local7);
y = ((_arg2 + _local5) + _local6);
this.addEventListener(Event.ENTER_FRAME, fall);
this.addEventListener(Event.ENTER_FRAME, disappear);
this.addEventListener(Event.REMOVED_FROM_STAGE, clean);
}
private function disappear(_arg1:Event){
disappearTime--;
if (disappearTime <= 0){
this.alpha = (this.alpha - 0.2);
};
if (this.alpha <= 0){
this.parent.removeChild(this);
};
}
private function clean(_arg1:Event){
removeEventListener(Event.ENTER_FRAME, fall);
removeEventListener(Event.ENTER_FRAME, disappear);
removeEventListener(Event.REMOVED_FROM_STAGE, clean);
}
private function fall(_arg1:Event){
if (speedY < maxSpeed){
speedY = (speedY + accel);
};
this.y = (this.y + speedY);
this.x = (this.x + speedX);
}
}
}//package game
Section 158
//Drill (game.Drill)
package game {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.ui.*;
public class Drill extends MovieClip {
private var nitroCounter:int;// = 0
public var anim:MovieClip;
private var nitro:Boolean;// = false
private var hullLevels:Array;
private var tracker:TargetTracker;
public var maxFuel:int;
public var pressure:int;
private var debrisContainer:MovieClip;
private var endingReason:String;
private var moving:Boolean;
private var tileCoordX:Number;
private var tileCoordY:Number;
private var testSum:Number;// = 0
private var key:Key;
private var Sounds:SoundManager;
private var speedMultiplier:Number;// = 1
private var drillDistance:int;// = 50
private var steering:int;
private var acceleration:Number;// = 0.05
private var ground:TileLayer;
public var nitroNum:int;
public var levelEnded:Boolean;// = false
private var mole:Mole;
private var nitroLength:int;// = 60
public var view:DisplayObjectContainer;
public var drillStarted:Boolean;// = false
private var host:Game;
private var wheelLevels:Array;
private var rotateSpeed:Number;
public var hullStrength:int;
private var drillLevels:Array;
private var drillStrength:int;
public var fuel:int;
public var bitAnim:MovieClip;
private var money:TileLayer;
private var tileDistance:Number;
public var depth:int;
private var fuelLevels:Array;
private var time:Number;
private var nitroSpeed:int;// = 6
public var nitroGraph:MovieClip;
private var speedX:Number;
private var speedY:Number;
private var leftLimit:int;// = 110
private var baseSpeed:int;// = 4
private var moveSpeed:Number;// = 0
private var rightLimit:int;// = -110
public function Drill(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6){
time = getTimer();
Sounds = SoundManager.getInstance();
tracker = new TargetTracker();
key = new Key();
fuelLevels = new Array(300, 350, 500, 600, 700, 800, 1000, 1200, 1500, 2400, 3000);
wheelLevels = new Array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
drillLevels = new Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
hullLevels = new Array(300, 400, 500, 600, 700, 900, 1100, 1400, 1700, 2000, 2500);
super();
this.debrisContainer = _arg5;
this.mole = _arg4;
this.nitroGraph.visible = false;
GameData.cargoContent[0] = 0;
host = _arg6;
maxFuel = (fuel = fuelLevels[GameData.fuel]);
steering = wheelLevels[GameData.wheel];
drillStrength = drillLevels[GameData.drill];
hullStrength = hullLevels[GameData.hull];
nitroNum = GameData.nitro;
this.view = _arg1;
this.ground = _arg2;
this.money = _arg3;
this.addEventListener(Event.ADDED_TO_STAGE, init);
}
private function throwDebris(){
var _local1:Number;
if (GameData.Quality == "HIGH"){
_local1 = Math.random();
if (_local1 < (0.1 + (moveSpeed / 20))){
debrisContainer.addChild(new debris(this.x, this.y, this.rotation));
};
} else {
if (GameData.Quality == "MEDIUM"){
_local1 = Math.random();
if (_local1 < 0.1){
debrisContainer.addChild(new debris(this.x, this.y, this.rotation));
};
};
};
}
private function init(_arg1:Event):void{
var _local2:int;
while (_local2 < GameData.cargoContent.length) {
GameData.cargoContent[_local2] = 0;
_local2++;
};
stage.focus = stage;
key.initialize(this.stage);
rotateSpeed = (steering * 0.5);
}
private function navigation(_arg1:Event){
var evt = _arg1;
if (GameData.inPause == false){
var burnNitro:Function = function (){
speedMultiplier = 1;
rotateSpeed = (steering * 0.25);
if ((((view.y < 200)) && ((nitroNum > 0)))){
nitroNum--;
enterNitroMode();
playRandomSound(1, new Array("a_charBoost1", "a_charBoost2", "a_charBoost3"));
};
};
fuel--;
bitAnim.nextFrame();
if ((((moveSpeed < baseSpeed)) && ((moving == true)))){
moveSpeed = (moveSpeed + acceleration);
} else {
if (moveSpeed > baseSpeed){
moveSpeed = baseSpeed;
};
};
if (view.y >= 150){
if (rotation < -90){
rotation = (rotation + 5);
};
if (rotation > 90){
rotation = (rotation - 5);
};
};
if (((key.isDown(Keyboard.LEFT)) || (key.isDown(65)))){
if (GameData.inverted){
turnRight();
} else {
turnLeft();
};
} else {
if (((key.isDown(Keyboard.RIGHT)) || (key.isDown(68)))){
if (GameData.inverted){
turnLeft();
} else {
turnRight();
};
} else {
if (((key.isDown(Keyboard.UP)) || (key.isDown(87)))){
if ((((nitro == false)) && ((pressure < 100)))){
burnNitro();
};
};
};
};
if (fuel <= 0){
endingReason = "fuel";
endLevel();
} else {
if (pressure >= 100){
endingReason = "pressure";
endLevel();
};
};
};
}
public function startDrill(){
this.drillStarted = true;
this.moving = true;
this.addEventListener(Event.ENTER_FRAME, navigation);
this.addEventListener(Event.ENTER_FRAME, drill);
this.addEventListener(Event.ENTER_FRAME, collectMoney);
}
private function turnLeft(){
if (view.y < 200){
if (rotation > rightLimit){
rotation = (rotation - (rotateSpeed * speedMultiplier));
};
if (rotation < rightLimit){
rotation = rightLimit;
};
};
}
private function updatePressure(){
depth = (int((240 - view.y)) * 0.5);
pressure = int(((depth / hullStrength) * 100));
}
private function playRandomSound(_arg1:int, _arg2:Array){
var _local4:int;
var _local3:int = (Math.random() * _arg1);
if ((((_local3 <= 1)) && (GameData.soundOn))){
_local4 = Math.floor((Math.random() * _arg2.length));
Sounds.playSound(_arg2[_local4]);
};
}
private function drill(_arg1:Event):void{
var _local2:*;
var _local3:Number;
var _local4:Number;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
if (GameData.inPause == false){
_local4 = 0;
for (_local5 in ground.objList) {
for (_local7 in ground.objList[_local5]) {
_local2 = ground.objList[_local5][_local7];
tileCoordX = ((_local2.x + ground.x) + view.x);
tileCoordY = ((_local2.y + ground.y) + view.y);
tileDistance = tracker.findCoordDistance(this.x, this.y, tileCoordX, tileCoordY);
if ((((tileDistance < drillDistance)) && ((_local2.type == "ground")))){
_local2.drill(drillStrength);
throwDebris();
if (nitro == false){
_local3 = ((drillDistance - tileDistance) / drillDistance);
if (_local3 > _local4){
_local4 = _local3;
};
if (_local4 > 0.8){
_local4 = 1;
};
speedMultiplier = (1 - _local4);
};
};
};
};
for (_local6 in money.objList) {
for (_local8 in money.objList[_local6]) {
_local2 = money.objList[_local6][_local8];
tileCoordX = ((_local2.x + money.x) + view.x);
tileCoordY = ((_local2.y + money.y) + view.y);
tileDistance = tracker.findCoordDistance(this.x, this.y, tileCoordX, tileCoordY);
if ((((tileDistance < drillDistance)) && ((_local2.type == "Rock")))){
_local2.drill(drillStrength);
if (nitro == false){
_local3 = (((drillDistance + 30) - tileDistance) / drillDistance);
if (_local3 > _local4){
_local4 = _local3;
};
if (_local4 > 0.8){
_local4 = 1;
};
speedMultiplier = (1 - _local4);
};
};
};
};
if ((((_local4 > 0)) && ((moveSpeed > (baseSpeed * speedMultiplier))))){
moving = false;
moveSpeed = (baseSpeed * speedMultiplier);
} else {
moving = true;
};
};
}
private function endLevel(){
if (moveSpeed > 1){
moveSpeed = 1;
};
moving = false;
levelEnded = true;
this.removeEventListener(Event.ENTER_FRAME, navigation);
this.removeEventListener(Event.ENTER_FRAME, drill);
this.addEventListener(Event.ENTER_FRAME, stopDrill);
}
private function exitNitroMode(){
rotateSpeed = (steering * 0.5);
this.nitroGraph.visible = false;
nitro = false;
moveSpeed = baseSpeed;
drillStrength = drillLevels[GameData.drill];
removeEventListener(Event.ENTER_FRAME, nitroMode);
addEventListener(Event.ENTER_FRAME, navigation);
}
private function drillSound(){
}
private function stopDrill(_arg1:Event){
if (endingReason == "forced"){
moveSpeed = 0;
this.removeEventListener(Event.ENTER_FRAME, stopDrill);
} else {
moveSpeed = (moveSpeed - acceleration);
if (moveSpeed <= 0){
moveSpeed = 0;
playRandomSound(1, new Array("a_charEnd1", "a_charEnd2", "a_charEnd3"));
this.removeEventListener(Event.ENTER_FRAME, stopDrill);
host.Debrief(endingReason);
};
};
}
private function fall(_arg1:Event){
var _local2:*;
var _local3:*;
if (GameData.inPause == false){
moveSpeed = (moveSpeed + 0.4);
this.addEventListener(Event.ENTER_FRAME, move);
for (_local2 in ground.objList) {
for (_local3 in ground.objList[_local2]) {
tileCoordX = ((ground.objList[_local2][_local3].x + ground.x) + view.x);
tileCoordY = ((ground.objList[_local2][_local3].y + ground.y) + view.y);
tileDistance = tracker.findCoordDistance(this.x, this.y, tileCoordX, tileCoordY);
if ((((tileDistance < 40)) && ((ground.objList[_local2][_local3].type == "ground")))){
moveSpeed = 0;
this.removeEventListener(Event.ENTER_FRAME, fall);
startDrill();
};
};
};
};
}
private function turnRight(){
if (view.y < 200){
if (rotation < leftLimit){
rotation = (rotation + (rotateSpeed * speedMultiplier));
};
if (rotation > leftLimit){
rotation = leftLimit;
};
};
}
public function forceEndLevel(){
if (drillStarted){
endingReason = "forced";
endLevel();
};
}
private function collectMoney(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:*;
for (_local3 in money.objList) {
for (_local4 in money.objList[_local3]) {
_local2 = money.objList[_local3][_local4];
tileCoordX = ((_local2.x + money.x) + view.x);
tileCoordY = ((_local2.y + money.y) + view.y);
tileDistance = tracker.findCoordDistance(this.x, this.y, tileCoordX, tileCoordY);
if ((((tileDistance < drillDistance)) && ((_local2.type == "money")))){
if (_local2.nature == 0){
GameData.cargoContent[0] = (GameData.cargoContent[0] + _local2.value);
} else {
GameData.cargoContent[_local2.nature] = (GameData.cargoContent[_local2.nature] + 1);
};
if (nitro == false){
playRandomSound((10 - _local2.nature), new Array("a_charCollect1", "a_charCollect2", "a_charCollect3", "a_charCollect4"));
};
_local2.y = -1000;
host.checkMoneyTrophies();
};
};
};
for (_local3 in money.objList) {
for (_local4 in money.objList[_local3]) {
_local2 = money.objList[_local3][_local4];
tileCoordX = ((_local2.x + money.x) + view.x);
tileCoordY = ((_local2.y + money.y) + view.y);
tileDistance = tracker.findCoordDistance(mole.x, mole.y, tileCoordX, tileCoordY);
if ((((tileDistance < 20)) && ((_local2.type == "Rock")))){
if (GameData.mole == 4){
_local2.drill(1000);
} else {
if ((((GameData.mole == 3)) && ((_local2._resistance <= 250)))){
_local2.drill(1000);
} else {
mole.goBack();
};
};
};
if ((((tileDistance < 30)) && ((_local2.type == "money")))){
if (_local2.nature == 0){
GameData.cargoContent[0] = (GameData.cargoContent[0] + _local2.value);
} else {
GameData.cargoContent[_local2.nature] = (GameData.cargoContent[_local2.nature] + 1);
};
_local2.y = -1000;
host.checkMoneyTrophies();
};
};
};
}
private function move(_arg1:Event):void{
if (GameData.inPause == false){
speedX = (Math.cos(((rotation + 90) * (Math.PI / 180))) * moveSpeed);
speedY = (Math.sin(((rotation + 90) * (Math.PI / 180))) * moveSpeed);
view.y = (view.y - speedY);
view.x = (view.x - speedX);
if (mole.tracking == true){
mole.y = (mole.y - speedY);
mole.x = (mole.x - speedX);
mole.adjustTarget(speedX, speedY);
} else {
if (mole.returning == true){
mole.y = (mole.y - speedY);
mole.x = (mole.x - speedX);
};
};
host.bgSky.x = (host.bgSky.x + speedX);
updatePressure();
};
}
private function nitroMode(_arg1:Event){
if (GameData.inPause == false){
nitroCounter++;
throwDebris();
bitAnim.nextFrame();
bitAnim.nextFrame();
if (nitroCounter >= nitroLength){
nitroCounter = 0;
exitNitroMode();
};
};
if (((key.isDown(Keyboard.LEFT)) || (key.isDown(65)))){
if (GameData.inverted){
turnRight();
} else {
turnLeft();
};
} else {
if (((key.isDown(Keyboard.RIGHT)) || (key.isDown(68)))){
if (GameData.inverted){
turnLeft();
} else {
turnRight();
};
};
};
}
private function enterNitroMode(){
this.nitroGraph.visible = true;
nitro = true;
moveSpeed = nitroSpeed;
drillStrength = 1000;
removeEventListener(Event.ENTER_FRAME, navigation);
addEventListener(Event.ENTER_FRAME, nitroMode);
}
public function go(){
this.addEventListener(Event.ENTER_FRAME, fall);
}
public function destroy(){
removeEventListener(Event.ENTER_FRAME, move);
removeEventListener(Event.ENTER_FRAME, drill);
removeEventListener(Event.ENTER_FRAME, collectMoney);
view = null;
debrisContainer = null;
ground = null;
money = null;
tracker = null;
key = null;
host = null;
}
}
}//package game
Section 159
//Game (game.Game)
package game {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import game.tiles.*;
import flash.ui.*;
import game.UI.*;
import game.menus.*;
public class Game extends MovieClip {
private var towers:LaunchTowers;
private var bgLayer:TileLayer;
private var moneyLayout:Array;
private var radarLevels:Array;
private var groundLayout:Array;
private var debrief:DebriefingMenu;
public var bgSky:sky;
private var launcher:launch;
private var levelWidth:int;// = 48
private var groundLayer:TileLayer;
private var inDebriefing:Boolean;// = false
private var mole:Mole;
private var gameView:MovieClip;
private var fading:ActionFading;
private var tileVariety:int;// = 12
private var radarRadius:int;
private var debrisContainer:MovieClip;
private var timerCount:int;// = 0
private var levelHeight:int;// = 204
private var bgLayout:Array;
private var trophyFeedback:TrophyFeedback;
public var drill:Drill;
private var cursor:MoleCursor;
private var tutorial;
private var Sounds:SoundManager;
private var undergroundLayout:Array;
private var drillRadar:Sprite;
private var moneyLayer:TileLayer;
private var hud:HUD;
private var gameMask:Sprite;
public function Game(_arg1){
Sounds = SoundManager.getInstance();
fading = new ActionFading();
trophyFeedback = new TrophyFeedback();
bgLayout = new Array(["bg0", "bg0", "bg0", "bg0", "bg0", "bg1", "empty", "bg2", "bg0", "bg0", "bg0", "bg0", "bg0", "bg0", "bg0"], ["empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty"], ["empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty"], ["empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty"], ["empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty"], ["empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty", "empty"]);
undergroundLayout = new Array();
groundLayout = new Array();
moneyLayout = new Array();
gameView = new MovieClip();
bgSky = new sky();
bgLayer = new TileLayer(bgLayout, "game.tiles.", GameData.screenWidth, GameData.screenHeight, 96, false, gameView, 0, 0, true, false);
groundLayer = new TileLayer(groundLayout, "game.tiles.", GameData.screenWidth, GameData.screenHeight, 25, true, gameView, 12, -16, true, false);
moneyLayer = new TileLayer(moneyLayout, "game.tiles.", GameData.screenWidth, GameData.screenHeight, 50, false, gameView, 6, -8, true, false);
debrisContainer = new MovieClip();
mole = new Mole();
drill = new Drill(gameView, groundLayer, moneyLayer, mole, debrisContainer, this);
hud = new HUD(drill);
towers = new LaunchTowers(gameView);
drillRadar = new Sprite();
gameMask = new Sprite();
radarLevels = new Array(100, 120, 140, 160, 175, 190, 205, 220, 235, 250, 400);
cursor = new MoleCursor();
super();
radarRadius = radarLevels[GameData.radar];
this.launcher = _arg1;
addChild(gameView);
addChild(gameMask);
addChild(drillRadar);
addChild(mole);
addChild(drill);
addChild(debrisContainer);
addChild(towers);
addChild(hud);
addChild(trophyFeedback);
gameView.addChild(bgSky);
gameView.addChild(bgLayer);
gameView.addChild(groundLayer);
gameView.addChild(moneyLayer);
drill.x = (GameData.screenWidth / 2);
drill.y = (GameData.screenHeight / 2);
createLevel();
bgSky.x = -(gameView.x);
bgSky.y = -(gameView.y);
startMusic();
addEventListener(Event.ADDED_TO_STAGE, init);
addEventListener(Event.ENTER_FRAME, processes);
}
public function checkMoneyTrophies(){
var _local1:int;
while (_local1 < 6) {
if ((((GameData.cargoContent[_local1] >= GameData.treasureAchievements[_local1][0])) && ((GameData.treasureAchievementsDone[_local1] == 0)))){
GameData.treasureAchievementsDone[_local1] = 1;
trophyFeedback.textBox.t.text = GameData.treasureAchievements[_local1][2];
trophyFeedback.gotoAndPlay(2);
};
_local1++;
};
}
private function checkDepthTrophies(){
var _local1:int;
timerCount++;
if (timerCount >= 15){
timerCount = 0;
trace("check depth trophies");
_local1 = 0;
while (_local1 < 6) {
if ((((drill.depth >= GameData.depthAchievements[_local1][0])) && ((GameData.depthAchievementsDone[_local1] == 0)))){
GameData.depthAchievementsDone[_local1] = 1;
trophyFeedback.textBox.t.text = GameData.depthAchievements[_local1][2];
trophyFeedback.gotoAndPlay(2);
};
_local1++;
};
};
}
private function init(_arg1:Event){
addChild(fading);
moneyLayer.mask = gameMask;
startLevel();
}
private function dynamicMusic(_arg1:Event){
var volumes:Array;
var depthLength:int;
var fadeLength:int;
var evt = _arg1;
var fadeOut:Function = function (_arg1:int, _arg2:int){
if ((((drill.depth > (_arg1 * depthLength))) && ((drill.depth < ((_arg1 * depthLength) + fadeLength))))){
volumes[_arg2] = (1 - (((drill.depth - (_arg1 * depthLength)) * (100 / fadeLength)) / 100));
} else {
if (drill.depth > ((_arg1 * depthLength) + fadeLength)){
volumes[_arg2] = 0;
};
};
};
var fadeIn:Function = function (_arg1:int, _arg2:int){
if ((((drill.depth > (_arg1 * depthLength))) && ((drill.depth < ((_arg1 * depthLength) + fadeLength))))){
volumes[_arg2] = (((drill.depth - (_arg1 * depthLength)) * (100 / fadeLength)) / 100);
} else {
if ((((drill.depth > ((_arg1 * depthLength) + fadeLength))) && ((drill.depth < (((_arg1 + 1) * depthLength) + fadeLength))))){
volumes[_arg2] = 1;
if (_arg2 == 4){
removeEventListener(Event.ENTER_FRAME, dynamicMusic);
};
};
};
};
volumes = new Array(1, 0, 0, 0, 0);
depthLength = 400;
fadeLength = 30;
var fadeDelay:int;
fadeOut(1, 0);
fadeIn(1, 1);
fadeOut(2, 1);
fadeIn(2, 2);
fadeOut(3, 2);
fadeIn(3, 3);
fadeOut(4, 3);
fadeIn(4, 4);
if (GameData.soundOn){
Sounds.setSoundVolume("actionA", volumes[0]);
Sounds.setSoundVolume("actionB", volumes[1]);
Sounds.setSoundVolume("actionC", volumes[2]);
Sounds.setSoundVolume("actionD", volumes[3]);
Sounds.setSoundVolume("actionE", volumes[4]);
} else {
Sounds.setSoundVolume("actionA", 0);
Sounds.setSoundVolume("actionB", 0);
Sounds.setSoundVolume("actionC", 0);
Sounds.setSoundVolume("actionD", 0);
Sounds.setSoundVolume("actionE", 0);
};
}
private function waitForTowers(_arg1:Event){
stage.focus = stage;
if (towers.AnimationCompleted == true){
drill.go();
removeEventListener(Event.ENTER_FRAME, waitForTowers);
};
}
private function startLevel(){
var addTutorial:Function = function (){
GameData.inTutorial = true;
GameData.inPause = true;
towers.gotoAndStop(1);
addChild(tutorial);
tutorial.skipButton.addEventListener(MouseEvent.CLICK, closeTutorial);
};
if (GameData.firstPlay == true){
tutorial = new tutorialFirstPlay();
GameData.firstPlay = false;
addTutorial();
} else {
if ((((GameData.firstNitro == true)) && ((GameData.nitro > 0)))){
tutorial = new tutorialNitro();
GameData.firstNitro = false;
addTutorial();
} else {
if ((((GameData.firstMole == true)) && ((GameData.mole > 0)))){
tutorial = new tutorialMole();
GameData.firstMole = false;
addTutorial();
} else {
if ((((GameData.tutoControls == true)) && ((GameData.weekLeft == 20)))){
tutorial = new tutorialControls();
GameData.tutoControls = false;
addTutorial();
} else {
createRadar();
createMole();
GameData.inTutorial = false;
GameData.inPause = false;
addEventListener(Event.ENTER_FRAME, waitForTowers);
};
};
};
};
}
private function useMole(_arg1:MouseEvent){
if ((((((((mole.tracking == false)) && ((mole.returning == false)))) && ((gameView.y < 200)))) && ((drill.levelEnded == false)))){
mole.tracking = true;
mole.goto(stage.mouseX, stage.mouseY);
};
}
private function createMole(){
if (GameData.mole > 0){
Mouse.hide();
addChild(cursor);
cursor.addEventListener(MouseEvent.CLICK, useMole);
};
}
private function animationPauser(){
if (GameData.inPause){
towers.stop();
drill.anim.stop();
if (GameData.mole > 0){
cursor.visible = false;
};
} else {
towers.play();
drill.anim.play();
if (GameData.mole > 0){
cursor.visible = true;
};
};
if (((GameData.inPause) && (inDebriefing))){
debrief.stop();
} else {
if (inDebriefing){
if (debrief.debriefingPaused == false){
debrief.play();
};
};
};
}
private function startMusic(){
Sounds.playSound("actionA", 0, 0, 99999);
Sounds.playSound("actionB", 0, 0, 99999);
Sounds.playSound("actionC", 0, 0, 99999);
Sounds.playSound("actionD", 0, 0, 99999);
Sounds.playSound("actionE", 0, 0, 99999);
addEventListener(Event.ENTER_FRAME, dynamicMusic);
}
private function createLevel(){
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:Boolean;
_local1 = 0;
while (_local1 < ((levelHeight + 50) / 2)) {
if (moneyLayout[_local1] == null){
moneyLayout[_local1] = new Array();
};
_local2 = 0;
while (_local2 < (levelWidth / 2)) {
_local6 = false;
_local3 = Math.floor((Math.random() * 100));
if ((((_local1 > (levelHeight / 20))) && ((_local1 < ((levelHeight / 20) * 2))))){
if (_local3 <= 2){
moneyLayout[_local1][_local2] = "Rock1";
_local6 = true;
};
} else {
if ((((_local1 > ((levelHeight / 20) * 2))) && ((_local1 < ((levelHeight / 15) * 3))))){
if (_local3 <= 5){
moneyLayout[_local1][_local2] = "Rock1";
_local6 = true;
};
} else {
if ((((_local1 > ((levelHeight / 15) * 3))) && ((_local1 < ((levelHeight / 12) * 4))))){
if (_local3 <= 2){
moneyLayout[_local1][_local2] = "Rock1";
_local6 = true;
};
if ((((_local3 > 2)) && ((_local3 <= 4)))){
moneyLayout[_local1][_local2] = "Rock2";
_local6 = true;
};
} else {
if (_local1 > ((levelHeight / 12) * 4)){
if (_local3 <= 5){
moneyLayout[_local1][_local2] = "Rock2";
_local6 = true;
};
};
};
};
};
if (_local6 == false){
_local3 = (Math.floor((Math.random() * 51)) - 45);
if ((((((_local3 <= 0)) || ((Math.ceil((_local1 / 10)) == 0)))) || (!((_local4 == "empty"))))){
moneyLayout[_local1][_local2] = "empty";
_local4 = "empty";
} else {
_local3 = ((Math.ceil((_local1 / 10)) + Math.floor((Math.random() * 4))) - 1);
if (_local3 <= 10){
if (_local3 < 1){
_local3 = 1;
} else {
if (_local3 > 9){
_local3 = 9;
};
};
moneyLayout[_local1][_local2] = ("money" + _local3);
_local4 = ("money" + _local3);
} else {
moneyLayout[_local1][_local2] = "empty";
_local4 = "empty";
};
};
};
_local2++;
};
_local1++;
};
_local1 = 0;
while (_local1 < (levelHeight + 100)) {
if (groundLayout[_local1] == null){
groundLayout[_local1] = new Array();
};
_local2 = 0;
while (_local2 < levelWidth) {
if (_local1 < levelHeight){
_local5 = Math.floor(((_local1 * tileVariety) / levelHeight));
if (_local1 == 0){
groundLayout[_local1][_local2] = "g0a";
} else {
groundLayout[_local1][_local2] = ("g" + _local5);
};
} else {
groundLayout[_local1][_local2] = "g11";
};
_local2++;
};
_local1++;
};
bgLayer.drawLayer();
groundLayer.drawLayer();
moneyLayer.drawLayer();
}
private function createRadar(){
drillRadar.alpha = 0.2;
drillRadar.graphics.beginFill(0);
drillRadar.graphics.drawCircle(250, 250, radarRadius);
drillRadar.graphics.endFill();
gameMask.graphics.beginFill(0xFFFFFF);
gameMask.graphics.drawCircle(250, 250, radarRadius);
gameMask.graphics.endFill();
}
private function processes(_arg1:Event){
animationPauser();
checkDepthTrophies();
}
private function closeTutorial(_arg1:MouseEvent){
tutorial.skipButton.removeEventListener(MouseEvent.CLICK, closeTutorial);
removeChild(tutorial);
tutorial = null;
startLevel();
}
public function Debrief(_arg1:String){
Mouse.show();
cursor.visible = false;
launcher.setGameQuality("HIGH");
if (_arg1 == "forced"){
drill.forceEndLevel();
};
GameData.weekLeft = (GameData.weekLeft - 1);
debrief = new DebriefingMenu(launcher, _arg1, drill.depth);
this.addChild(debrief);
inDebriefing = true;
}
public function destroy(){
removeEventListener(Event.ENTER_FRAME, dynamicMusic);
removeEventListener(Event.ENTER_FRAME, processes);
Sounds.stopAllSounds();
groundLayer.destroy();
moneyLayer.destroy();
towers.destroy();
drill.destroy();
if (inDebriefing){
debrief.destroy();
};
var _local1:uint = gameView.numChildren;
var _local2:uint;
_local2 = 0;
while (_local2 < _local1) {
gameView.removeChildAt(0);
_local2++;
};
_local1 = debrisContainer.numChildren;
_local2 = 0;
_local2 = 0;
while (_local2 < _local1) {
debrisContainer.removeChildAt(0);
_local2++;
};
_local1 = this.numChildren;
_local2 = 0;
_local2 = 0;
while (_local2 < _local1) {
this.removeChildAt(0);
_local2++;
};
fading = null;
debrief = null;
gameView = null;
debrisContainer = null;
drill = null;
launcher = null;
towers = null;
trophyFeedback = null;
}
}
}//package game
Section 160
//GameData (game.GameData)
package game {
import flash.net.*;
import com.google.analytics.*;
import FGL.GameTracker.*;
public class GameData {
public static var maxLevel:int = 10;
public static var treasureValue:Array = new Array(5, 75, 125, 250, 400, 750);
public static var radar:int;
public static var depthAchievements:Array = new Array([300, 500, "Digger"], [600, 2000, "Driller"], [1000, 5000, "Earth Mover"], [1500, 12500, "Depth explorer"], [2100, 19000, "Dangerously deep!"], [2600, 25000, "And beyond."]);
public static var firstPlay:Boolean;
public static var tutoControls:Boolean;
public static var SponsorURL:URLRequest = new URLRequest("http://www.kongregate.com/?gamereferral=megadrill");
public static var debugMode:Boolean = false;
public static var weekLeft:int;
public static var cargoContent:Array = new Array(0, 0, 0, 0, 0, 0);
public static var Tracker:GameTracker = new GameTracker();
public static var inTutorial:Boolean = false;
public static var treasureAchievementsDone:Array = new Array();
public static var nitro:int;
public static var GoogleTracker:AnalyticsTracker;
public static var endingsUnlocked:Array;
public static var fullyUpgraded:Boolean;
public static var screenHeight:int = 500;
public static var depthAchievementsDone:Array = new Array();
public static var tutoTrophies:Boolean;
public static var fuel:int;
public static var gameState:String;
public static var nonex:Boolean;
public static var screenWidth:int = 500;
public static var money:int;
public static var mole:int;
public static var hull:int;
public static var soundOn:Boolean = true;
public static var GameWideLogo:Boolean = true;
public static var inPause:Boolean = false;
public static var firstNitro:Boolean;
public static var grants:int;
public static var wheel:int;
public static var Quality:String = "HIGH";
public static var drill:int;
public static var highestEnding:int;
public static var firstMole:Boolean;
public static var treasureAchievements:Array = new Array([100, 2500, "Coin Grabber", "Coins"], [15, 4500, "Treasure Hunter", "Treasures"], [15, 8000, "Emerald Extractor", "Emeralds"], [20, 12000, "Ruby Finder", "Rubies"], [20, 25000, "Diamond Lover", "Diamonds"], [25, 50000, "Connoisseur", "Big Diamonds"]);
public static var inverted:Boolean = true;
public static var groundTileSize:int = 25;
public static function googleTrack(_arg1:String, _arg2:String, _arg3){
GoogleTracker.trackEvent("MegaDrill", _arg1, _arg2, _arg3);
}
public static function defaultValues(){
weekLeft = 25;
money = 0;
grants = 0;
var _local1:int;
while (_local1 < depthAchievements.length) {
depthAchievementsDone[_local1] = 0;
_local1++;
};
var _local2:int;
while (_local2 < treasureAchievements.length) {
treasureAchievementsDone[_local2] = 0;
_local2++;
};
fuel = 0;
wheel = 0;
drill = 0;
hull = 0;
radar = 0;
mole = 0;
nitro = 0;
firstPlay = true;
firstNitro = true;
firstMole = true;
tutoControls = true;
tutoTrophies = true;
fullyUpgraded = false;
gameState = "new";
}
public static function initGA(_arg1){
GoogleTracker = new GATracker(_arg1, "UA-6744956-3", "AS3", false);
}
}
}//package game
Section 161
//GameSaver (game.GameSaver)
package game {
import flash.net.*;
public class GameSaver {
private var SaveSlot:SharedObject;
public function GameSaver(){
SaveSlot = SharedObject.getLocal("slot");
super();
loadGame();
}
public function loadGame(){
var _local1:String;
var _local2:String;
SaveSlot = SharedObject.getLocal("slot");
if (SaveSlot.data.highestEnding != undefined){
GameData.highestEnding = SaveSlot.data.highestEnding;
} else {
GameData.highestEnding = 0;
};
if (SaveSlot.data.weekLeft != undefined){
GameData.weekLeft = SaveSlot.data.weekLeft;
GameData.money = SaveSlot.data.money;
GameData.grants = SaveSlot.data.grants;
_local1 = SaveSlot.data.depthAchievementsDone.toString();
_local2 = SaveSlot.data.treasureAchievementsDone.toString();
GameData.depthAchievementsDone = _local1.split(",");
GameData.treasureAchievementsDone = _local2.split(",");
GameData.fuel = SaveSlot.data.fuel;
GameData.wheel = SaveSlot.data.wheel;
GameData.drill = SaveSlot.data.drill;
GameData.hull = SaveSlot.data.hull;
GameData.radar = SaveSlot.data.radar;
GameData.mole = SaveSlot.data.mole;
GameData.nitro = SaveSlot.data.nitro;
GameData.firstPlay = SaveSlot.data.firstPlay;
GameData.firstNitro = SaveSlot.data.firstNitro;
GameData.firstMole = SaveSlot.data.firstMole;
GameData.tutoControls = SaveSlot.data.tutoControls;
GameData.tutoTrophies = SaveSlot.data.tutoTrophies;
GameData.fullyUpgraded = SaveSlot.data.fullyUpgraded;
GameData.gameState = "loaded";
} else {
GameData.defaultValues();
GameData.gameState = "new";
};
}
public function saveGame(){
SaveSlot.data.highestEnding = new int(GameData.highestEnding);
SaveSlot.data.weekLeft = new int(GameData.weekLeft);
SaveSlot.data.money = new int(GameData.money);
SaveSlot.data.grants = new int(GameData.grants);
SaveSlot.data.depthAchievementsDone = new Array(GameData.depthAchievementsDone);
SaveSlot.data.treasureAchievementsDone = new Array(GameData.treasureAchievementsDone);
SaveSlot.data.fuel = new int(GameData.fuel);
SaveSlot.data.wheel = new int(GameData.wheel);
SaveSlot.data.drill = new int(GameData.drill);
SaveSlot.data.hull = new int(GameData.hull);
SaveSlot.data.radar = new int(GameData.radar);
SaveSlot.data.mole = new int(GameData.mole);
SaveSlot.data.nitro = new int(GameData.nitro);
SaveSlot.data.firstPlay = new Boolean(GameData.firstPlay);
SaveSlot.data.firstNitro = new Boolean(GameData.firstNitro);
SaveSlot.data.firstMole = new Boolean(GameData.firstMole);
SaveSlot.data.tutoControls = new Boolean(GameData.tutoControls);
SaveSlot.data.tutoTrophies = new Boolean(GameData.tutoTrophies);
SaveSlot.data.fullyUpgraded = new Boolean(GameData.fullyUpgraded);
SaveSlot.data.gameState = new String(GameData.gameState);
SaveSlot.flush();
}
}
}//package game
Section 162
//LaunchTowers (game.LaunchTowers)
package game {
import flash.display.*;
import flash.events.*;
public class LaunchTowers extends MovieClip {
public var leftTower:MovieClip;
private var view:MovieClip;
public var AnimationCompleted:Boolean;// = false
public var plane:MovieClip;
public function LaunchTowers(_arg1){
addFrameScript(0, frame1, 72, frame73, 95, frame96, 99, frame100, 151, frame152, 157, frame158);
this.plane.num.text = GameData.weekLeft.toString();
this.view = _arg1;
addEventListener(Event.ENTER_FRAME, followView);
}
function frame152(){
stop();
}
function frame100(){
this.AnimationCompleted = true;
}
function frame73(){
leftTower.w1.play();
leftTower.w2.play();
leftTower.w3.play();
leftTower.w4.play();
}
function frame1(){
stop();
}
function frame96(){
leftTower.w1.stop();
leftTower.w2.stop();
leftTower.w3.stop();
leftTower.w4.stop();
}
private function followView(_arg1:Event){
this.x = (view.x + 462);
this.y = (view.y - 136);
}
public function destroy(){
view = null;
removeEventListener(Event.ENTER_FRAME, followView);
}
function frame158(){
gotoAndStop("end");
}
}
}//package game
Section 163
//Mole (game.Mole)
package game {
import game.utils.*;
import flash.display.*;
import flash.events.*;
public class Mole extends MovieClip {
public var maxDistance:int;// = 50
private var normalX:int;// = 250
private var normalY:int;// = 250
private var angle:Number;
private var view;
private var targetX:Number;
private var targetY:Number;
private var speedX:Number;
private var speedY:Number;
public var moveSpeed:int;// = 4
public var tracking:Boolean;// = false
private var tracker:TargetTracker;
public var returning:Boolean;// = false
public function Mole(){
targetX = normalX;
targetY = normalY;
tracker = new TargetTracker();
super();
if (GameData.mole == 1){
moveSpeed = 3;
};
if (GameData.mole == 2){
moveSpeed = 5;
};
if (GameData.mole == 3){
moveSpeed = 7;
};
if (GameData.mole == 4){
moveSpeed = 9;
};
this.x = normalX;
this.y = normalY;
addEventListener(Event.ENTER_FRAME, move);
}
public function adjustTarget(_arg1, _arg2){
targetX = (targetX - _arg1);
targetY = (targetY - _arg2);
}
private function move(_arg1:Event){
if (GameData.inPause == false){
angle = tracker.findCoordAngle(this.x, this.y, targetX, targetY);
speedX = (Math.cos((angle * (Math.PI / 180))) * moveSpeed);
speedY = (Math.sin((angle * (Math.PI / 180))) * moveSpeed);
this.x = (this.x + speedX);
this.y = (this.y + speedY);
this.rotation = (angle + 90);
if ((((((((this.x >= (targetX - moveSpeed))) && ((this.x <= (targetX + moveSpeed))))) && ((this.y >= (targetY - moveSpeed))))) && ((this.y <= (targetY + moveSpeed))))){
if (tracking == true){
targetX = normalX;
targetY = normalY;
tracking = false;
returning = true;
} else {
if (returning == true){
returning = false;
};
};
};
};
}
public function goto(_arg1, _arg2){
tracking = true;
targetX = _arg1;
targetY = _arg2;
}
public function goBack(){
targetX = normalX;
targetY = normalY;
tracking = false;
returning = true;
}
}
}//package game
Section 164
//MoleCursor (game.MoleCursor)
package game {
import flash.display.*;
import flash.events.*;
public class MoleCursor extends MovieClip {
public function MoleCursor(){
addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(_arg1:Event){
this.x = stage.mouseX;
this.y = stage.mouseY;
this.startDrag();
}
}
}//package game
Section 165
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 166
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init(_arg1:Array, _arg2:Array):void{
_a = _arg1;
var _local3:int = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
}
}//package gs.plugins
Section 167
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
}
}//package gs.plugins
Section 168
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 169
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _target:DisplayObject;
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg1 is DisplayObject)){
return (false);
};
var _local4:ColorTransform = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
}
}//package gs.plugins
Section 170
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var propName:String;
public var onComplete:Function;
public var round:Boolean;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 171
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 172
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.media.*;
import flash.display.*;
import gs.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
}
}//package gs.plugins
Section 173
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 174
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 175
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import gs.utils.tween.*;
import gs.plugins.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
public var exposedVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
public static const version:Number = 10.092;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var _local4:int = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
var _local2:Number = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
var _local2:uint = (currentTime = getTimer());
var _local3:Dictionary = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local3:Object;
var _local2:Dictionary = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 176
//Anim_Drill_Intro_57 (MegaDrill_fla.Anim_Drill_Intro_57)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Anim_Drill_Intro_57 extends MovieClip {
public function Anim_Drill_Intro_57(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package MegaDrill_fla
Section 177
//Anim_FuelOut_14 (MegaDrill_fla.Anim_FuelOut_14)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Anim_FuelOut_14 extends MovieClip {
public function Anim_FuelOut_14(){
addFrameScript(0, frame1, 31, frame32);
}
function frame32(){
stop();
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 178
//Anim_MegaDrill_65 (MegaDrill_fla.Anim_MegaDrill_65)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Anim_MegaDrill_65 extends MovieClip {
public function Anim_MegaDrill_65(){
addFrameScript(21, frame22, 135, frame136);
}
function frame22(){
gotoAndPlay((this.currentFrame + Math.floor((Math.random() * 60))));
}
function frame136(){
gotoAndPlay("loop");
}
}
}//package MegaDrill_fla
Section 179
//Anim_WallCrumble_64 (MegaDrill_fla.Anim_WallCrumble_64)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Anim_WallCrumble_64 extends MovieClip {
public function Anim_WallCrumble_64(){
addFrameScript(27, frame28);
}
function frame28(){
stop();
}
}
}//package MegaDrill_fla
Section 180
//Anim2_Chaloupe_233 (MegaDrill_fla.Anim2_Chaloupe_233)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Anim2_Chaloupe_233 extends MovieClip {
public function Anim2_Chaloupe_233(){
addFrameScript(19, frame20, 88, frame89);
}
function frame20(){
gotoAndPlay(1);
}
function frame89(){
gotoAndPlay("oupsLoop");
}
}
}//package MegaDrill_fla
Section 181
//b_Achievements_87 (MegaDrill_fla.b_Achievements_87)
package MegaDrill_fla {
import flash.display.*;
public dynamic class b_Achievements_87 extends MovieClip {
public function b_Achievements_87(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 182
//b_Ready_84 (MegaDrill_fla.b_Ready_84)
package MegaDrill_fla {
import flash.display.*;
public dynamic class b_Ready_84 extends MovieClip {
public function b_Ready_84(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 183
//b_Upgrade_89 (MegaDrill_fla.b_Upgrade_89)
package MegaDrill_fla {
import flash.display.*;
public dynamic class b_Upgrade_89 extends MovieClip {
public function b_Upgrade_89(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 184
//b_UpgradeMenu_129 (MegaDrill_fla.b_UpgradeMenu_129)
package MegaDrill_fla {
import flash.display.*;
public dynamic class b_UpgradeMenu_129 extends MovieClip {
public function b_UpgradeMenu_129(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 185
//b_Vacation_88 (MegaDrill_fla.b_Vacation_88)
package MegaDrill_fla {
import flash.display.*;
public dynamic class b_Vacation_88 extends MovieClip {
public function b_Vacation_88(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 186
//end_Char_Head_138 (MegaDrill_fla.end_Char_Head_138)
package MegaDrill_fla {
import flash.display.*;
public dynamic class end_Char_Head_138 extends MovieClip {
public function end_Char_Head_138(){
addFrameScript(0, frame1, 1, frame2, 28, frame29);
}
function frame29(){
gotoAndPlay("laugh");
}
function frame1(){
stop();
}
function frame2(){
gotoAndStop(1);
}
}
}//package MegaDrill_fla
Section 187
//end_Character_131 (MegaDrill_fla.end_Character_131)
package MegaDrill_fla {
import flash.display.*;
public dynamic class end_Character_131 extends MovieClip {
public var head:MovieClip;
public function end_Character_131(){
addFrameScript(0, frame1, 1, frame2, 40, frame41, 56, frame57, 96, frame97, 108, frame109, 146, frame147, 166, frame167, 178, frame179, 260, frame261);
}
function frame1(){
stop();
}
function frame2(){
gotoAndStop(1);
}
function frame179(){
gotoAndStop(1);
}
function frame41(){
gotoAndPlay("loop");
}
function frame97(){
head.gotoAndStop(1);
this.gotoAndStop(1);
}
function frame167(){
stop();
}
function frame109(){
head.gotoAndStop("sad");
}
function frame147(){
gotoAndStop(1);
}
function frame261(){
stop();
}
function frame57(){
head.gotoAndPlay("laugh");
}
}
}//package MegaDrill_fla
Section 188
//end_ShopKeeper_169 (MegaDrill_fla.end_ShopKeeper_169)
package MegaDrill_fla {
import flash.display.*;
public dynamic class end_ShopKeeper_169 extends MovieClip {
public function end_ShopKeeper_169(){
addFrameScript(0, frame1, 51, frame52, 91, frame92);
}
function frame52(){
gotoAndStop(1);
}
function frame1(){
stop();
}
function frame92(){
stop();
}
}
}//package MegaDrill_fla
Section 189
//Enveloppe_19 (MegaDrill_fla.Enveloppe_19)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Enveloppe_19 extends MovieClip {
public var letter:MovieClip;
public function Enveloppe_19(){
addFrameScript(1, frame2, 17, frame18);
}
function frame18(){
stop();
}
function frame2(){
stop();
}
}
}//package MegaDrill_fla
Section 190
//firework_241 (MegaDrill_fla.firework_241)
package MegaDrill_fla {
import flash.display.*;
public dynamic class firework_241 extends MovieClip {
public function firework_241(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package MegaDrill_fla
Section 191
//Hero_Turn_204 (MegaDrill_fla.Hero_Turn_204)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Hero_Turn_204 extends MovieClip {
public function Hero_Turn_204(){
addFrameScript(0, frame1, 70, frame71);
}
function frame1(){
stop();
}
function frame71(){
stop();
}
}
}//package MegaDrill_fla
Section 192
//Lady_176 (MegaDrill_fla.Lady_176)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Lady_176 extends MovieClip {
public function Lady_176(){
addFrameScript(0, frame1, 48, frame49);
}
function frame49(){
stop();
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 193
//MainTimeline (MegaDrill_fla.MainTimeline)
package MegaDrill_fla {
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.utils.*;
import FGL.GameTracker.*;
import CPMStar.*;
import flash.ui.*;
import flash.system.*;
import flash.external.*;
import flash.errors.*;
import adobe.utils.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var loadingText:MovieClip;
public var locked:Boolean;
public var my_cMenu:ContextMenu;
public var homeURL:URLRequest;
public var sponsors:MovieClip;
public var noAdsSites:Array;
public var launcher:launch;
public var ad:DisplayObject;
public var CPMStarContentSpotID:String;
public var targetURL:URLRequest;
public var adBox:CPMStarAdBox;
public var ads:Boolean;
public var loadingBar:MovieClip;
public var bPlayNow:SimpleButton;
public var domain:String;
public var nonex:Boolean;
public var theOnes:Array;
public var b:SimpleButton;
public var unlocked:Boolean;
public function MainTimeline(){
addFrameScript(0, frame1, 16, frame17, 19, frame20, 162, frame163, 300, frame301, 305, frame306);
}
public function displayAds(){
if (ads == true){
adBox.x = 180;
adBox.y = 50;
addChild(adBox);
adBox.addChild(ad);
};
}
public function checkNonExclusives():void{
nonex = false;
var _local1:int;
while (_local1 < theOnes.length) {
if (theOnes[_local1] == domain){
nonex = true;
};
_local1++;
};
if (nonex){
sponsors.gotoAndStop(2);
};
play();
}
function frame163(){
targetURL.url = "http://www.smallinteractive.com/";
b.addEventListener(MouseEvent.CLICK, navigateTo);
}
public function retrieveDomain():void{
var _local1:String = stage.loaderInfo.url;
var _local2:Number = (_local1.indexOf("://") + 3);
var _local3:Number = _local1.indexOf("/", _local2);
domain = _local1.substring(_local2, _local3);
var _local4:Number = (domain.lastIndexOf(".") - 1);
var _local5:Number = (domain.lastIndexOf(".", _local4) + 1);
domain = domain.substring(_local5, domain.length);
}
public function proceed(_arg1:MouseEvent){
bPlayNow.visible = false;
bPlayNow.removeEventListener(MouseEvent.CLICK, proceed);
removeChild(adBox);
this.gotoAndPlay(3);
}
public function visitHome(_arg1:MouseEvent){
navigateToURL(homeURL);
}
public function navigateTo(_arg1:MouseEvent){
navigateToURL(targetURL);
}
function frame17(){
MochiBot.track(this, "3fa0b781");
stop();
launcher = new launch();
locked = false;
nonex = false;
unlocked = true;
theOnes = new Array("flashgamelicense.com");
retrieveDomain();
if (locked){
checkSiteLocked();
};
if (nonex){
checkNonExclusives();
};
if (unlocked){
play();
};
}
public function PL_LOADING(_arg1:ProgressEvent):void{
var _local2:Number = Math.ceil(((_arg1.bytesLoaded / _arg1.bytesTotal) * 1000));
if (_local2 == 1000){
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, PL_LOADING);
finishedLoading();
} else {
this.gotoAndStop(1);
};
if (_local2 < 1000){
loadingBar.gotoAndStop(_local2);
};
}
public function checkSiteLocked():void{
var _local1:int;
while (_local1 < theOnes.length) {
if (theOnes[_local1] == domain){
locked = false;
};
_local1++;
};
if (locked){
gotoAndStop("lock");
} else {
play();
};
}
function frame1(){
stop();
noAdsSites = new Array("flashgamelicense.com", "chat.kongregate.com", "uploads.ungrounded.net", "kongregate.com");
ads = true;
checkDomain();
adBox = new CPMStarAdBox();
CPMStarContentSpotID = "1473Q902175B5";
ad = new AdLoader(CPMStarContentSpotID);
displayAds();
my_cMenu = new ContextMenu();
my_cMenu.hideBuiltInItems();
contextMenu = my_cMenu;
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);
bPlayNow.visible = false;
}
public function finishedLoading(){
if (ads == true){
loadingText.visible = false;
bPlayNow.visible = true;
bPlayNow.addEventListener(MouseEvent.CLICK, proceed);
} else {
this.gotoAndPlay(3);
};
}
function frame20(){
targetURL = new URLRequest();
targetURL.url = "http://www.kongregate.com/?gamereferral=megadrill";
b.addEventListener(MouseEvent.CLICK, navigateTo);
}
public function checkDomain():void{
var _local1:String = stage.loaderInfo.url;
var _local2:Number = (_local1.indexOf("://") + 3);
var _local3:Number = _local1.indexOf("/", _local2);
var _local4:String = _local1.substring(_local2, _local3);
var _local5:Number = (_local4.lastIndexOf(".") - 1);
var _local6:Number = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
var _local7:int;
while (_local7 < noAdsSites.length) {
if (noAdsSites[_local7] == _local4){
ads = false;
};
_local7++;
};
}
function frame306(){
b.addEventListener(MouseEvent.CLICK, visitHome);
homeURL = new URLRequest("http://www.smallinteractive.com");
}
function frame301(){
stop();
addChild(launcher);
launcher.init(nonex);
}
}
}//package MegaDrill_fla
Section 194
//mc_Character02_214 (MegaDrill_fla.mc_Character02_214)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Character02_214 extends MovieClip {
public function mc_Character02_214(){
addFrameScript(72, frame73);
}
function frame73(){
stop();
}
}
}//package MegaDrill_fla
Section 195
//mc_Drill_ForTitle_58 (MegaDrill_fla.mc_Drill_ForTitle_58)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Drill_ForTitle_58 extends MovieClip {
public var r:int;
public function mc_Drill_ForTitle_58(){
addFrameScript(34, frame35, 227, frame228, 246, frame247);
}
function frame247(){
gotoAndPlay("loop");
}
function frame228(){
r = Math.floor((Math.random() * 2));
if (r == 0){
gotoAndPlay("loop");
};
}
function frame35(){
gotoAndPlay((this.currentFrame + Math.floor((Math.random() * 60))));
}
}
}//package MegaDrill_fla
Section 196
//mc_Drill_GameStartAnim_31 (MegaDrill_fla.mc_Drill_GameStartAnim_31)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Drill_GameStartAnim_31 extends MovieClip {
public function mc_Drill_GameStartAnim_31(){
addFrameScript(83, frame84, 88, frame89);
}
function frame84(){
stop();
}
function frame89(){
gotoAndStop("end");
}
}
}//package MegaDrill_fla
Section 197
//mc_DrillBitAnim_34 (MegaDrill_fla.mc_DrillBitAnim_34)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_DrillBitAnim_34 extends MovieClip {
public function mc_DrillBitAnim_34(){
addFrameScript(0, frame1, 1, frame2, 15, frame16, 16, frame17);
}
function frame16(){
gotoAndPlay(1);
}
function frame17(){
gotoAndPlay(1);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package MegaDrill_fla
Section 198
//mc_Ending01_49 (MegaDrill_fla.mc_Ending01_49)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Ending01_49 extends MovieClip {
public function mc_Ending01_49(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 199
//mc_Ending02_50 (MegaDrill_fla.mc_Ending02_50)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Ending02_50 extends MovieClip {
public function mc_Ending02_50(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 200
//mc_Ending03_51 (MegaDrill_fla.mc_Ending03_51)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Ending03_51 extends MovieClip {
public function mc_Ending03_51(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 201
//mc_Ending04_53 (MegaDrill_fla.mc_Ending04_53)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Ending04_53 extends MovieClip {
public function mc_Ending04_53(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 202
//mc_Ending05_55 (MegaDrill_fla.mc_Ending05_55)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Ending05_55 extends MovieClip {
public function mc_Ending05_55(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 203
//mc_FadeIn_168 (MegaDrill_fla.mc_FadeIn_168)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_FadeIn_168 extends MovieClip {
public function mc_FadeIn_168(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package MegaDrill_fla
Section 204
//mc_FadeOut_184 (MegaDrill_fla.mc_FadeOut_184)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_FadeOut_184 extends MovieClip {
public function mc_FadeOut_184(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package MegaDrill_fla
Section 205
//mc_FuelOut_LiquidAnim_15 (MegaDrill_fla.mc_FuelOut_LiquidAnim_15)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_FuelOut_LiquidAnim_15 extends MovieClip {
public function mc_FuelOut_LiquidAnim_15(){
addFrameScript(59, frame60);
}
function frame60(){
gotoAndPlay(1);
}
}
}//package MegaDrill_fla
Section 206
//mc_Intro_AllSponsors_296 (MegaDrill_fla.mc_Intro_AllSponsors_296)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Intro_AllSponsors_296 extends MovieClip {
public function mc_Intro_AllSponsors_296(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 207
//mc_LowFuelAlarm_102 (MegaDrill_fla.mc_LowFuelAlarm_102)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_LowFuelAlarm_102 extends MovieClip {
public function mc_LowFuelAlarm_102(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 208
//mc_NitroBar_85 (MegaDrill_fla.mc_NitroBar_85)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_NitroBar_85 extends MovieClip {
public function mc_NitroBar_85(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 209
//mc_Safe_200 (MegaDrill_fla.mc_Safe_200)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_Safe_200 extends MovieClip {
public function mc_Safe_200(){
addFrameScript(60, frame61);
}
function frame61(){
gotoAndPlay("loop");
}
}
}//package MegaDrill_fla
Section 210
//mc_SafeMini_197 (MegaDrill_fla.mc_SafeMini_197)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_SafeMini_197 extends MovieClip {
public function mc_SafeMini_197(){
addFrameScript(60, frame61);
}
function frame61(){
gotoAndPlay("loop");
}
}
}//package MegaDrill_fla
Section 211
//mc_TooMuchPressure_16 (MegaDrill_fla.mc_TooMuchPressure_16)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_TooMuchPressure_16 extends MovieClip {
public function mc_TooMuchPressure_16(){
addFrameScript(0, frame1, 22, frame23);
}
function frame1(){
stop();
}
function frame23(){
stop();
}
}
}//package MegaDrill_fla
Section 212
//mc_TowerWheel_25 (MegaDrill_fla.mc_TowerWheel_25)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_TowerWheel_25 extends MovieClip {
public function mc_TowerWheel_25(){
addFrameScript(1, frame2, 14, frame15);
}
function frame15(){
gotoAndPlay(2);
}
function frame2(){
gotoAndStop((Math.floor((Math.random() * 11)) + 3));
}
}
}//package MegaDrill_fla
Section 213
//mc_UpgradeBar_86 (MegaDrill_fla.mc_UpgradeBar_86)
package MegaDrill_fla {
import flash.display.*;
public dynamic class mc_UpgradeBar_86 extends MovieClip {
public function mc_UpgradeBar_86(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 214
//Money_140 (MegaDrill_fla.Money_140)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Money_140 extends MovieClip {
public var amount:MovieClip;
public var bag:MovieClip;
public function Money_140(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 215
//MoneyAnim_141 (MegaDrill_fla.MoneyAnim_141)
package MegaDrill_fla {
import flash.display.*;
public dynamic class MoneyAnim_141 extends MovieClip {
public function MoneyAnim_141(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
}
}
}//package MegaDrill_fla
Section 216
//SalesMan_181 (MegaDrill_fla.SalesMan_181)
package MegaDrill_fla {
import flash.display.*;
public dynamic class SalesMan_181 extends MovieClip {
public var head:MovieClip;
public var bubble:MovieClip;
public function SalesMan_181(){
addFrameScript(0, frame1, 37, frame38, 75, frame76, 119, frame120, 174, frame175);
}
function frame175(){
head.gotoAndStop(1);
stop();
}
function frame38(){
stop();
}
function frame76(){
stop();
}
function frame1(){
stop();
bubble.visible = false;
}
function frame120(){
head.gotoAndStop(1);
gotoAndStop(1);
}
}
}//package MegaDrill_fla
Section 217
//SalesMan_Bubble_183 (MegaDrill_fla.SalesMan_Bubble_183)
package MegaDrill_fla {
import flash.display.*;
public dynamic class SalesMan_Bubble_183 extends MovieClip {
public function SalesMan_Bubble_183(){
addFrameScript(15, frame16, 35, frame36, 65, frame66, 106, frame107, 158, frame159);
}
function frame36(){
stop();
}
function frame16(){
stop();
}
function frame159(){
stop();
}
function frame107(){
stop();
}
function frame66(){
stop();
}
}
}//package MegaDrill_fla
Section 218
//SalesMan_Head_182 (MegaDrill_fla.SalesMan_Head_182)
package MegaDrill_fla {
import flash.display.*;
public dynamic class SalesMan_Head_182 extends MovieClip {
public function SalesMan_Head_182(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package MegaDrill_fla
Section 219
//SkyAnim_216 (MegaDrill_fla.SkyAnim_216)
package MegaDrill_fla {
import flash.display.*;
public dynamic class SkyAnim_216 extends MovieClip {
public function SkyAnim_216(){
addFrameScript(1235, frame1236);
}
function frame1236(){
stop();
}
}
}//package MegaDrill_fla
Section 220
//Stuffs_11 (MegaDrill_fla.Stuffs_11)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Stuffs_11 extends MovieClip {
public function Stuffs_11(){
addFrameScript(1, frame2);
}
function frame2(){
stop();
}
}
}//package MegaDrill_fla
Section 221
//trophiesAnim_144 (MegaDrill_fla.trophiesAnim_144)
package MegaDrill_fla {
import flash.display.*;
public dynamic class trophiesAnim_144 extends MovieClip {
public var trophies:MovieClip;
public function trophiesAnim_144(){
addFrameScript(14, frame15, 37, frame38);
}
function frame15(){
stop();
}
function frame38(){
stop();
}
}
}//package MegaDrill_fla
Section 222
//Waves_192 (MegaDrill_fla.Waves_192)
package MegaDrill_fla {
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.utils.*;
import flash.ui.*;
import flash.system.*;
import flash.external.*;
import flash.errors.*;
import adobe.utils.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Waves_192 extends MovieClip {
public var l1:MovieClip;
public var l2:MovieClip;
public var l3:MovieClip;
public var l4:MovieClip;
public var l5:MovieClip;
public var l7:MovieClip;
public var l8:MovieClip;
public var l12:MovieClip;
public var l13:MovieClip;
public var l6:MovieClip;
public var l10:MovieClip;
public var l11:MovieClip;
public var l9:MovieClip;
public function Waves_192(){
addFrameScript(0, frame1);
}
function frame1(){
l1.startAnim(1);
l2.startAnim(7);
l3.startAnim(2);
l4.startAnim(8);
l5.startAnim(3);
l6.startAnim(9);
l7.startAnim(4);
l8.startAnim(10);
l9.startAnim(5);
l10.startAnim(11);
l11.startAnim(6);
l12.startAnim(12);
l13.startAnim(7);
}
}
}//package MegaDrill_fla
Section 223
//Waves_218 (MegaDrill_fla.Waves_218)
package MegaDrill_fla {
import flash.media.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
import flash.geom.*;
import flash.accessibility.*;
import flash.utils.*;
import flash.ui.*;
import flash.system.*;
import flash.external.*;
import flash.errors.*;
import adobe.utils.*;
import flash.filters.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.xml.*;
public dynamic class Waves_218 extends MovieClip {
public var l1:MovieClip;
public var l2:MovieClip;
public var l3:MovieClip;
public var l4:MovieClip;
public var l5:MovieClip;
public var l7:MovieClip;
public var l8:MovieClip;
public var l12:MovieClip;
public var l13:MovieClip;
public var l6:MovieClip;
public var l10:MovieClip;
public var l11:MovieClip;
public var l9:MovieClip;
public function Waves_218(){
addFrameScript(0, frame1);
}
function frame1(){
l1.startAnim(1);
l2.startAnim(2);
l3.startAnim(3);
l4.startAnim(4);
l5.startAnim(5);
l6.startAnim(6);
l7.startAnim(7);
l8.startAnim(8);
l9.startAnim(9);
l10.startAnim(10);
l11.startAnim(11);
l12.startAnim(12);
l13.startAnim(13);
}
}
}//package MegaDrill_fla
Section 224
//Waves_Line_193 (MegaDrill_fla.Waves_Line_193)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Waves_Line_193 extends MovieClip {
public var w7:MovieClip;
public var w1:MovieClip;
public var w3:MovieClip;
public var w5:MovieClip;
public var w8:MovieClip;
public var w2:MovieClip;
public var w4:MovieClip;
public var w6:MovieClip;
public function Waves_Line_193(){
addFrameScript(0, frame1);
}
function frame1(){
}
public function startAnim(_arg1){
w1.gotoAndPlay(_arg1);
w2.gotoAndPlay((_arg1 + 1));
w3.gotoAndPlay((_arg1 + 2));
w4.gotoAndPlay((_arg1 + 3));
w5.gotoAndPlay((_arg1 + 4));
w6.gotoAndPlay((_arg1 + 5));
w7.gotoAndPlay((_arg1 + 6));
w8.gotoAndPlay((_arg1 + 7));
}
}
}//package MegaDrill_fla
Section 225
//Waves_Line_219 (MegaDrill_fla.Waves_Line_219)
package MegaDrill_fla {
import flash.display.*;
public dynamic class Waves_Line_219 extends MovieClip {
public var w7:MovieClip;
public var w1:MovieClip;
public var w3:MovieClip;
public var w5:MovieClip;
public var w8:MovieClip;
public var w2:MovieClip;
public var w4:MovieClip;
public var w6:MovieClip;
public function Waves_Line_219(){
addFrameScript(0, frame1);
}
function frame1(){
}
public function startAnim(_arg1){
w1.gotoAndPlay(_arg1);
w2.gotoAndPlay((_arg1 + 1));
w3.gotoAndPlay((_arg1 + 2));
w4.gotoAndPlay((_arg1 + 3));
w5.gotoAndPlay((_arg1 + 4));
w6.gotoAndPlay((_arg1 + 5));
w7.gotoAndPlay((_arg1 + 6));
w8.gotoAndPlay((_arg1 + 7));
}
}
}//package MegaDrill_fla
Section 226
//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.3.0.4852";
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 227
//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.3.0.4852";
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 228
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 229
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.display.*;
import flash.events.*;
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 230
//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 231
//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 232
//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.3.0.4852";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var result:String;
var o:DisplayObject;
var s:String;
var indices:Array;
var displayObject = _arg1;
try {
o = displayObject;
while (o != null) {
if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){
break;
};
s = o.name;
if ((o is IRepeaterClient)){
indices = IRepeaterClient(o).instanceIndices;
if (indices){
s = (s + (("[" + indices.join("][")) + "]"));
};
};
result = ((result == null)) ? s : ((s + ".") + result);
o = o.parent;
};
} catch(e:SecurityError) {
};
return (result);
}
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 233
//a_alarmFuel (a_alarmFuel)
package {
import flash.media.*;
public dynamic class a_alarmFuel extends Sound {
}
}//package
Section 234
//a_charBoost1 (a_charBoost1)
package {
import flash.media.*;
public dynamic class a_charBoost1 extends Sound {
}
}//package
Section 235
//a_charBoost2 (a_charBoost2)
package {
import flash.media.*;
public dynamic class a_charBoost2 extends Sound {
}
}//package
Section 236
//a_charBoost3 (a_charBoost3)
package {
import flash.media.*;
public dynamic class a_charBoost3 extends Sound {
}
}//package
Section 237
//a_charCollect1 (a_charCollect1)
package {
import flash.media.*;
public dynamic class a_charCollect1 extends Sound {
}
}//package
Section 238
//a_charCollect2 (a_charCollect2)
package {
import flash.media.*;
public dynamic class a_charCollect2 extends Sound {
}
}//package
Section 239
//a_charCollect3 (a_charCollect3)
package {
import flash.media.*;
public dynamic class a_charCollect3 extends Sound {
}
}//package
Section 240
//a_charCollect4 (a_charCollect4)
package {
import flash.media.*;
public dynamic class a_charCollect4 extends Sound {
}
}//package
Section 241
//a_charEnd1 (a_charEnd1)
package {
import flash.media.*;
public dynamic class a_charEnd1 extends Sound {
}
}//package
Section 242
//a_charEnd2 (a_charEnd2)
package {
import flash.media.*;
public dynamic class a_charEnd2 extends Sound {
}
}//package
Section 243
//a_charEnd3 (a_charEnd3)
package {
import flash.media.*;
public dynamic class a_charEnd3 extends Sound {
}
}//package
Section 244
//actionA (actionA)
package {
import flash.media.*;
public dynamic class actionA extends Sound {
}
}//package
Section 245
//actionB (actionB)
package {
import flash.media.*;
public dynamic class actionB extends Sound {
}
}//package
Section 246
//actionC (actionC)
package {
import flash.media.*;
public dynamic class actionC extends Sound {
}
}//package
Section 247
//actionD (actionD)
package {
import flash.media.*;
public dynamic class actionD extends Sound {
}
}//package
Section 248
//actionE (actionE)
package {
import flash.media.*;
public dynamic class actionE extends Sound {
}
}//package
Section 249
//ActionFading (ActionFading)
package {
import flash.display.*;
public dynamic class ActionFading extends MovieClip {
public function ActionFading(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package
Section 250
//CPMStarAdBox (CPMStarAdBox)
package {
import flash.display.*;
public dynamic class CPMStarAdBox extends MovieClip {
}
}//package
Section 251
//e_boatLaugh (e_boatLaugh)
package {
import flash.media.*;
public dynamic class e_boatLaugh extends Sound {
}
}//package
Section 252
//e_boatThink (e_boatThink)
package {
import flash.media.*;
public dynamic class e_boatThink extends Sound {
}
}//package
Section 253
//e_charLaugh (e_charLaugh)
package {
import flash.media.*;
public dynamic class e_charLaugh extends Sound {
}
}//package
Section 254
//e_gongs (e_gongs)
package {
import flash.media.*;
public dynamic class e_gongs extends Sound {
}
}//package
Section 255
//e_shopHep (e_shopHep)
package {
import flash.media.*;
public dynamic class e_shopHep extends Sound {
}
}//package
Section 256
//e_shopHmm (e_shopHmm)
package {
import flash.media.*;
public dynamic class e_shopHmm extends Sound {
}
}//package
Section 257
//endChoice (endChoice)
package {
import flash.media.*;
public dynamic class endChoice extends Sound {
}
}//package
Section 258
//endCredits (endCredits)
package {
import flash.media.*;
public dynamic class endCredits extends Sound {
}
}//package
Section 259
//FinalFade (FinalFade)
package {
import flash.display.*;
public dynamic class FinalFade extends MovieClip {
public var TryAgain:MovieClip;
public var bSponsor:SimpleButton;
public var bBack:SimpleButton;
public function FinalFade(){
addFrameScript(122, frame123);
}
function frame123(){
stop();
}
}
}//package
Section 260
//i_bossLaugh (i_bossLaugh)
package {
import flash.media.*;
public dynamic class i_bossLaugh extends Sound {
}
}//package
Section 261
//i_charAngry (i_charAngry)
package {
import flash.media.*;
public dynamic class i_charAngry extends Sound {
}
}//package
Section 262
//i_charIdea (i_charIdea)
package {
import flash.media.*;
public dynamic class i_charIdea extends Sound {
}
}//package
Section 263
//i_charInterest (i_charInterest)
package {
import flash.media.*;
public dynamic class i_charInterest extends Sound {
}
}//package
Section 264
//i_newspaper1 (i_newspaper1)
package {
import flash.media.*;
public dynamic class i_newspaper1 extends Sound {
}
}//package
Section 265
//i_newspaper2 (i_newspaper2)
package {
import flash.media.*;
public dynamic class i_newspaper2 extends Sound {
}
}//package
Section 266
//i_sea (i_sea)
package {
import flash.media.*;
public dynamic class i_sea extends Sound {
}
}//package
Section 267
//Instructions (Instructions)
package {
import flash.display.*;
public dynamic class Instructions extends MovieClip {
public var skipButton:SimpleButton;
}
}//package
Section 268
//introTitle (introTitle)
package {
import flash.media.*;
public dynamic class introTitle extends Sound {
}
}//package
Section 269
//launch (launch)
package {
import game.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import game.*;
import game.tiles.*;
import game.credits.*;
import game.menus.*;
import flash.system.*;
public class launch extends MovieClip {
private var cheats:Cheats;
private var _m1:money1;// = null
private var _m2:money2;// = null
private var _m3:money3;// = null
private var _g11:g11;// = null
private var _m7:money7;// = null
private var _m9:money9;// = null
private var _m4:money4;// = null
private var activity:ActivityMonitor;
private var saver:GameSaver;
private var options:OptionsMenu;
private var _g10:g10;// = null
private var _g0a:g0a;// = null
private var _m5:money5;// = null
private var _m8:money8;// = null
private var _m6:money6;// = null
private var currentScreen:MovieClip;
private var FPS:FPSCounter;
private var _g2:g2;// = null
private var _g3:g3;// = null
private var _g4:g4;// = null
private var _g5:g5;// = null
private var _g6:g6;// = null
private var _g0:g0;// = null
private var _g1:g1;// = null
private var _g9:g9;// = null
private var _Rock1:Rock1;// = null
private var _Rock2:Rock2;// = null
private var _g7:g7;// = null
private var _g8:g8;// = null
public var kongregate;
private var Sounds:SoundManager;
private var e:empty;// = null
public var MindJoltAPI:Object;
public function launch(){
Sounds = SoundManager.getInstance();
options = new OptionsMenu(this);
saver = new GameSaver();
super();
}
private function addAllSounds(){
Sounds.addLibrarySound(actionA, "actionA");
Sounds.addLibrarySound(actionB, "actionB");
Sounds.addLibrarySound(actionC, "actionC");
Sounds.addLibrarySound(actionD, "actionD");
Sounds.addLibrarySound(actionE, "actionE");
Sounds.addLibrarySound(introTitle, "introTitle");
Sounds.addLibrarySound(mainTitle, "mainTitle");
Sounds.addLibrarySound(menu, "menu");
Sounds.addLibrarySound(endChoice, "endChoice");
Sounds.addLibrarySound(endCredits, "endCredits");
Sounds.addLibrarySound(i_charAngry, "i_charAngry");
Sounds.addLibrarySound(i_newspaper1, "i_newspaper1");
Sounds.addLibrarySound(i_newspaper2, "i_newspaper2");
Sounds.addLibrarySound(i_charInterest, "i_charInterest");
Sounds.addLibrarySound(i_charIdea, "i_charIdea");
Sounds.addLibrarySound(i_bossLaugh, "i_bossLaugh");
Sounds.addLibrarySound(i_sea, "i_sea");
Sounds.addLibrarySound(a_alarmFuel, "a_alarmFuel");
Sounds.addLibrarySound(a_charCollect1, "a_charCollect1");
Sounds.addLibrarySound(a_charCollect2, "a_charCollect2");
Sounds.addLibrarySound(a_charCollect3, "a_charCollect3");
Sounds.addLibrarySound(a_charCollect4, "a_charCollect4");
Sounds.addLibrarySound(a_charEnd1, "a_charEnd1");
Sounds.addLibrarySound(a_charEnd2, "a_charEnd2");
Sounds.addLibrarySound(a_charEnd3, "a_charEnd3");
Sounds.addLibrarySound(a_charBoost1, "a_charBoost1");
Sounds.addLibrarySound(a_charBoost2, "a_charBoost2");
Sounds.addLibrarySound(a_charBoost3, "a_charBoost3");
Sounds.addLibrarySound(e_charLaugh, "e_charLaugh");
Sounds.addLibrarySound(e_boatThink, "e_boatThink");
Sounds.addLibrarySound(e_boatLaugh, "e_boatLaugh");
Sounds.addLibrarySound(e_shopHep, "e_shopHep");
Sounds.addLibrarySound(e_shopHmm, "e_shopHmm");
Sounds.addLibrarySound(e_gongs, "e_gongs");
}
public function goToCredits(_arg1, _arg2){
hideOptions();
clearScreen();
currentScreen = new Credits(this, _arg1, _arg2);
addChildAt(currentScreen, 0);
}
public function goToUpgradeMenu(){
showOptions();
options.upgradeMenuMode();
saver.saveGame();
clearScreen();
currentScreen = new UpgradeMenu(this);
addChildAt(currentScreen, 0);
Sounds.playSound("menu", 1, 0, 99999);
if (GameData.soundOn == false){
Sounds.muteAllSounds();
};
}
private function clearScreen(){
Sounds.stopAllSounds();
currentScreen.destroy();
removeChild(currentScreen);
currentScreen = null;
}
public function goToEnding(){
hideOptions();
clearScreen();
currentScreen = new Ending(this);
addChildAt(currentScreen, 0);
}
public function startGame(){
Sounds.stopAllSounds();
showOptions();
setGameQuality(GameData.Quality);
GameData.Tracker.beginLevel(GameData.weekLeft, GameData.money, ((((((((((("fuel: " + GameData.fuel) + ", wheel: ") + GameData.wheel) + ", drill: ") + GameData.drill) + ", hull: ") + GameData.hull) + ", mole: ") + GameData.mole) + ", nitro: ") + GameData.nitro));
options.gameMode();
clearScreen();
currentScreen = new Game(this);
addChildAt(currentScreen, 0);
}
public function clearSaveData(){
GameData.defaultValues();
saver.saveGame();
}
public function init(_arg1){
GameData.nonex = _arg1;
GameData.initGA(this);
GameData.googleTrack("Game", "GameLoaded", 0);
launchKongregateAPI();
launchMindjoltAPI();
saver.loadGame();
GameData.Tracker.beginGame(GameData.money, ("Weeks left: " + GameData.weekLeft.toString()));
addAllSounds();
loadMainMenu();
addChild(options);
if (GameData.debugMode){
cheats = new Cheats();
addChild(cheats);
};
}
private function loadMainMenu(){
options.mainMenuMode();
showOptions();
currentScreen = new MainMenu(this);
addChildAt(currentScreen, 0);
}
public function switchToTrophies(){
clearScreenOnly();
currentScreen = new TrophyRoom(this);
addChildAt(currentScreen, 0);
}
private function launchKongregateAPI(){
var loadComplete:Function;
loadComplete = function (_arg1:Event):void{
kongregate = _arg1.target.content;
kongregate.services.connect();
};
var paramObj:Object = LoaderInfo(root.loaderInfo).parameters;
var apiPath:String = ((paramObj.kongregate_api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
Security.allowDomain(apiPath);
var request:URLRequest = new URLRequest(apiPath);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load(request);
this.addChild(loader);
}
public function recordEnding(_arg1){
GameData.googleTrack("Game", "CreditsStarted", _arg1);
GameData.googleTrack("Game", ("Credits ID : " + _arg1), GameData.money);
GameData.Tracker.alert(GameData.money, null, ("Game completed with ending no " + _arg1));
GameData.Tracker.beginLevel(0, GameData.money, ("Game completed with ending no " + _arg1));
}
private function launchMindjoltAPI(){
var postMindJoltAPIConnect:Function;
var gameParams:Object;
var urlLoader:Loader;
postMindJoltAPIConnect = function (_arg1:Boolean){
trace("[MindJoltAPI] service successfully loaded");
};
if (MindJoltAPI == null){
var loadFinished:Function = function (_arg1:Event):void{
MindJoltAPI = _arg1.currentTarget.content;
if (MindJoltAPI != null){
MindJoltAPI.service.connect(postMindJoltAPIConnect);
trace("[MindJoltAPI] service successfully loaded");
} else {
trace("[MindJoltAPI] failed to load");
};
};
Security.allowDomain("static.mindjolt.com");
gameParams = LoaderInfo(root.loaderInfo).parameters;
urlLoader = new Loader();
urlLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadFinished);
urlLoader.load(new URLRequest(((gameParams.mjPath) || ("http://static.mindjolt.com/api/as3/api_as3_local.swf"))));
this.addChild(urlLoader);
};
}
public function returnToMainMenu(){
kongregate.stats.submit("BestEnding", GameData.highestEnding);
clearScreen();
loadMainMenu();
}
public function showOptions(){
options.visible = true;
}
public function forceEndLevel(){
if (currentScreen.drill.drillStarted){
currentScreen.Debrief("forced");
} else {
options.tellNotStartedYet();
};
}
public function autoIntroduction(){
hideOptions();
clearScreen();
currentScreen = new Introduction(this, "auto");
addChildAt(currentScreen, 0);
}
public function setGameQuality(_arg1:String){
if (_arg1 == "HIGH"){
options.setGameQuality("HIGH");
} else {
if (_arg1 == "MEDIUM"){
options.setGameQuality("MEDIUM");
} else {
if (_arg1 == "LOW"){
options.setGameQuality("LOW");
};
};
};
}
private function clearScreenOnly(){
currentScreen.destroy();
removeChild(currentScreen);
currentScreen = null;
}
public function startAtIntroduction(){
hideOptions();
clearScreen();
currentScreen = new Introduction(this, "start");
addChildAt(currentScreen, 0);
}
public function submitFinalScore(){
if (MindJoltAPI != null){
MindJoltAPI.service.submitScore(GameData.money);
};
kongregate.stats.submit("FinalScore", GameData.money);
kongregate.stats.submit("WeeksLeft", GameData.weekLeft);
kongregate.stats.submit("BestEnding", GameData.highestEnding);
}
public function switchToUprades(){
clearScreenOnly();
currentScreen = new UpgradeMenu(this);
addChildAt(currentScreen, 0);
}
public function hideOptions(){
options.visible = false;
}
}
}//package
Section 270
//Light (Light)
package {
import flash.display.*;
public dynamic class Light extends MovieClip {
public function Light(){
addFrameScript(1235, frame1236);
}
function frame1236(){
stop();
}
}
}//package
Section 271
//mainTitle (mainTitle)
package {
import flash.media.*;
public dynamic class mainTitle extends Sound {
}
}//package
Section 272
//menu (menu)
package {
import flash.media.*;
public dynamic class menu extends Sound {
}
}//package
Section 273
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
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 274
//Star (Star)
package {
import flash.display.*;
public dynamic class Star extends MovieClip {
}
}//package
Section 275
//TrophyFeedback (TrophyFeedback)
package {
import flash.display.*;
public dynamic class TrophyFeedback extends MovieClip {
public var textBox:MovieClip;
public function TrophyFeedback(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 276
//tutorialControls (tutorialControls)
package {
import flash.display.*;
public dynamic class tutorialControls extends MovieClip {
public var skipButton:SimpleButton;
}
}//package
Section 277
//tutorialFirstPlay (tutorialFirstPlay)
package {
import flash.display.*;
public dynamic class tutorialFirstPlay extends MovieClip {
public var skipButton:SimpleButton;
}
}//package
Section 278
//tutorialMole (tutorialMole)
package {
import flash.display.*;
public dynamic class tutorialMole extends MovieClip {
public var skipButton:SimpleButton;
}
}//package
Section 279
//tutorialNitro (tutorialNitro)
package {
import flash.display.*;
public dynamic class tutorialNitro extends MovieClip {
public var skipButton:SimpleButton;
}
}//package
Section 280
//tutorialTrophies (tutorialTrophies)
package {
import flash.display.*;
public dynamic class tutorialTrophies extends MovieClip {
public var skipButton:SimpleButton;
}
}//package
Section 281
//winJingle (winJingle)
package {
import flash.media.*;
public dynamic class winJingle extends Sound {
}
}//package