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(empty:Boolean=true, newCampaign:Boolean=false){
super();
_empty = empty;
_new = newCampaign;
}
public function toURLString():String{
var v:Variables = toVariables();
return (v.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 variables:Variables = new Variables();
variables.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
variables.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
variables.utmcr = utmcr;
};
return (variables);
}
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"
public function CampaignKey(){
super();
}
}
}//package com.google.analytics.campaign
Section 3
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
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(config:Configuration, debug:DebugConfiguration, buffer:Buffer, domainHash:Number, referrer:String, timeStamp:Number){
super();
_config = config;
_debug = debug;
_buffer = buffer;
_domainHash = domainHash;
_referrer = referrer;
_timeStamp = timeStamp;
}
public function getCampaignInformation(search:String, noSessionInformation:Boolean):CampaignInfo{
var campaignTracker:CampaignTracker;
var oldTracker:CampaignTracker;
var sessionCount:int;
var campInfo:CampaignInfo = new CampaignInfo();
var duplicateCampaign:Boolean;
var campNoOverride:Boolean;
var responseCount:int;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (campInfo);
};
};
campaignTracker = getTrackerFromSearchString(search);
if (isValid(campaignTracker)){
campNoOverride = hasNoOverride(search);
if (((campNoOverride) && (!(_buffer.hasUTMZ())))){
return (campInfo);
};
};
if (!isValid(campaignTracker)){
campaignTracker = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(campaignTracker)))){
return (campInfo);
};
};
if (((!(isValid(campaignTracker))) && (noSessionInformation))){
campaignTracker = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(campaignTracker)))){
return (campInfo);
};
};
if (!isValid(campaignTracker)){
if (((!(_buffer.hasUTMZ())) && (noSessionInformation))){
campaignTracker = getDirectCampaign();
};
};
if (!isValid(campaignTracker)){
return (campInfo);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
oldTracker = new CampaignTracker();
oldTracker.fromTrackerString(_buffer.utmz.campaignTracking);
duplicateCampaign = (oldTracker.toTrackerString() == campaignTracker.toTrackerString());
responseCount = _buffer.utmz.responseCount;
};
if (((!(duplicateCampaign)) || (noSessionInformation))){
sessionCount = _buffer.utma.sessionCount;
responseCount++;
if (sessionCount == 0){
sessionCount = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = sessionCount;
_buffer.utmz.responseCount = responseCount;
_buffer.utmz.campaignTracking = campaignTracker.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
campInfo = new CampaignInfo(false, true);
} else {
campInfo = new CampaignInfo(false, false);
};
return (campInfo);
}
public function hasNoOverride(search:String):Boolean{
var key:CampaignKey = _config.campaignKey;
if (search == ""){
return (false);
};
var variables:Variables = new Variables(search);
var value:String = "";
if (variables.hasOwnProperty(key.UCNO)){
value = variables[key.UCNO];
switch (value){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getTrackerFromSearchString(search:String):CampaignTracker{
var organicCampaign:CampaignTracker = getOrganicCampaign();
var camp:CampaignTracker = new CampaignTracker();
var key:CampaignKey = _config.campaignKey;
if (search == ""){
return (camp);
};
var variables:Variables = new Variables(search);
if (variables.hasOwnProperty(key.UCID)){
camp.id = variables[key.UCID];
};
if (variables.hasOwnProperty(key.UCSR)){
camp.source = variables[key.UCSR];
};
if (variables.hasOwnProperty(key.UGCLID)){
camp.clickId = variables[key.UGCLID];
};
if (variables.hasOwnProperty(key.UCCN)){
camp.name = variables[key.UCCN];
} else {
camp.name = "(not set)";
};
if (variables.hasOwnProperty(key.UCMD)){
camp.medium = variables[key.UCMD];
} else {
camp.medium = "(not set)";
};
if (variables.hasOwnProperty(key.UCTR)){
camp.term = variables[key.UCTR];
} else {
if (((organicCampaign) && (!((organicCampaign.term == ""))))){
camp.term = organicCampaign.term;
};
};
if (variables.hasOwnProperty(key.UCCT)){
camp.content = variables[key.UCCT];
};
return (camp);
}
public function getOrganicCampaign():CampaignTracker{
var camp:CampaignTracker;
var tmp:Array;
var currentOrganicSource:OrganicReferrer;
var keyword:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (camp);
};
var ref:URL = new URL(_referrer);
var name:String = "";
if (ref.hostName != ""){
if (ref.hostName.indexOf(".") > -1){
tmp = ref.hostName.split(".");
switch (tmp.length){
case 2:
name = tmp[0];
break;
case 3:
name = tmp[1];
break;
};
};
};
if (_config.organic.match(name)){
currentOrganicSource = _config.organic.getReferrerByName(name);
keyword = _config.organic.getKeywordValue(currentOrganicSource, ref.search);
camp = new CampaignTracker();
camp.source = currentOrganicSource.engine;
camp.name = "(organic)";
camp.medium = "organic";
camp.term = keyword;
};
return (camp);
}
public function getDirectCampaign():CampaignTracker{
var camp:CampaignTracker = new CampaignTracker();
camp.source = "(direct)";
camp.name = "(direct)";
camp.medium = "(none)";
return (camp);
}
public function isIgnoredKeyword(tracker:CampaignTracker):Boolean{
if (((tracker) && ((tracker.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(tracker.term));
};
return (false);
}
public function isIgnoredReferral(tracker:CampaignTracker):Boolean{
if (((tracker) && ((tracker.medium == "referral")))){
return (_config.organic.isIgnoredReferral(tracker.source));
};
return (false);
}
public function isValid(tracker:CampaignTracker):Boolean{
if (((tracker) && (tracker.isValid()))){
return (true);
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var camp:CampaignTracker;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (camp);
};
var ref:URL = new URL(_referrer);
var hostname:String = ref.hostName;
var content:String = ref.path;
if (hostname.indexOf("www.") == 0){
hostname = hostname.substr(4);
};
camp = new CampaignTracker();
camp.source = hostname;
camp.name = "(referral)";
camp.medium = "referral";
camp.content = content;
return (camp);
}
public static function isInvalidReferrer(referrer:String):Boolean{
var url:URL;
if ((((((referrer == "")) || ((referrer == "-")))) || ((referrer == "0")))){
return (true);
};
if (referrer.indexOf("://") > -1){
url = new URL(referrer);
if ((((url.protocol == Protocols.file)) || ((url.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(referrer:String, config:Configuration):Boolean{
var url:URL = new URL(referrer);
if (url.hostName.indexOf(config.google) > -1){
if (url.search.indexOf((config.googleSearchParam + "=")) > -1){
if (url.path == ("/" + config.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(id:String="", source:String="", clickId:String="", name:String="", medium:String="", term:String="", content:String=""){
super();
this.id = id;
this.source = source;
this.clickId = clickId;
this.name = name;
this.medium = medium;
this.term = term;
this.content = content;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var data:Array = [];
_addIfNotEmpty(data, "utmcsr=", source);
_addIfNotEmpty(data, "utmccn=", name);
_addIfNotEmpty(data, "utmcmd=", medium);
_addIfNotEmpty(data, "utmctr=", term);
_addIfNotEmpty(data, "utmcct=", content);
_addIfNotEmpty(data, "utmcid=", id);
_addIfNotEmpty(data, "utmgclid=", clickId);
return (data.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(arr:Array, field:String, value:String):void{
if (value != ""){
value = value.split("+").join("%20");
value = value.split(" ").join("%20");
arr.push((field + value));
};
}
public function fromTrackerString(tracker:String):void{
var data:String = tracker.split(CampaignManager.trackingDelimiter).join("&");
var vars:Variables = new Variables(data);
if (vars.hasOwnProperty("utmcid")){
this.id = vars["utmcid"];
};
if (vars.hasOwnProperty("utmcsr")){
this.source = vars["utmcsr"];
};
if (vars.hasOwnProperty("utmccn")){
this.name = vars["utmccn"];
};
if (vars.hasOwnProperty("utmcmd")){
this.medium = vars["utmcmd"];
};
if (vars.hasOwnProperty("utmctr")){
this.term = vars["utmctr"];
};
if (vars.hasOwnProperty("utmcct")){
this.content = vars["utmcct"];
};
if (vars.hasOwnProperty("utmgclid")){
this.clickId = vars["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 5
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(config:Configuration, info:Environment){
super();
_config = config;
_info = info;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var v:Variables = toVariables();
return (v.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmfl():String{
var v:Version;
if (_config.detectFlash){
v = _info.flashVersion;
return (((((v.major + ".") + v.minor) + " r") + v.build));
};
return ("-");
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function toVariables():Variables{
var variables:Variables = new Variables();
variables.URIencode = true;
variables.utmcs = utmcs;
variables.utmsr = utmsr;
variables.utmsc = utmsc;
variables.utmul = utmul;
variables.utmje = utmje;
variables.utmfl = utmfl;
return (variables);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 6
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import flash.events.*;
import flash.net.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
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(config:Configuration, debug:DebugConfiguration, volatile:Boolean=false, data:Object=null){
var saveSO:Boolean;
var prop:String;
super();
_config = config;
_debug = debug;
UTMB.defaultTimespan = _config.sessionTimeout;
UTMZ.defaultTimespan = _config.conversionTimeout;
if (!volatile){
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
saveSO = 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();
saveSO = 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();
saveSO = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
saveSO = 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();
saveSO = 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();
saveSO = true;
};
};
if (saveSO){
save();
};
} else {
_OBJ = new Object();
if (data){
for (prop in data) {
_OBJ[prop] = data[prop];
};
};
};
_volatile = volatile;
}
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;
flushStatus = _SO.flush();
//unresolved jump
var _slot1 = e;
_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 value:String = "";
value = (value + utma.valueOf());
value = (value + utmb.valueOf());
value = (value + utmc.valueOf());
value = (value + utmz.valueOf());
value = (value + utmv.valueOf());
return (Utils.generateHash(value));
}
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(event:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (event.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(timestamp:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + timestamp) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = timestamp;
};
}
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(name:String, value):void{
if (isVolatile()){
_OBJ[name] = value;
} else {
_SO.data[name] = value;
};
}
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 7
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
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(config:Configuration, info:Environment, formatedReferrer:String, pageURL:String=null, adSense:AdSenseGlobals=null){
super();
_config = config;
_info = info;
_utmr = formatedReferrer;
_pageURL = pageURL;
_adSense = adSense;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var v:Variables = toVariables();
return (v.toString());
}
private function _renderPageURL(pageURL:String=""):String{
var pathname:String = _info.locationPath;
var search:String = _info.locationSearch;
if (((!(pageURL)) || ((pageURL == "")))){
pageURL = (pathname + unescape(search));
};
return (pageURL);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
public function get utmhid():String{
return (String(_generateHitId()));
}
private function _generateHitId():Number{
var hid:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
hid = Number(_adSense.hid);
} else {
hid = Math.round((Math.random() * 2147483647));
_adSense.hid = String(hid);
};
return (hid);
}
public function toVariables():Variables{
var variables:Variables = new Variables();
variables.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
variables.utmdt = utmdt;
};
variables.utmhid = utmhid;
variables.utmr = utmr;
variables.utmp = utmp;
return (variables);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 8
//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(mode:DomainNameMode=null, name:String="", debug:DebugConfiguration=null){
super();
_debug = debug;
if (mode == null){
mode = DomainNameMode.auto;
};
_mode = mode;
if (mode == DomainNameMode.custom){
this.name = name;
} else {
_name = name;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(value:DomainNameMode):void{
_mode = value;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(value:String):void{
if (((!((value.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + value), VisualDebugMode.geek);
};
_name = value;
}
}
}//package com.google.analytics.core
Section 9
//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(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 10
//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(isEventHit:Boolean, xObject:X10, extObject:X10=null){
super();
_isEventHit = isEventHit;
_x10 = xObject;
_ext10 = extObject;
}
public function toURLString():String{
var v:Variables = toVariables();
return (v.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var variables:Variables = new Variables();
variables.URIencode = true;
if (_isEventHit){
variables.utmt = utmt;
};
variables.utme = utme;
return (variables);
}
}
}//package com.google.analytics.core
Section 11
//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(name:String, parent:GoogleAnalyticsAPI){
super();
this.name = name;
_parent = parent;
}
public function trackEvent(action:String, label:String=null, value:Number=NaN):Boolean{
return (_parent.trackEvent(name, action, label, value));
}
}
}//package com.google.analytics.core
Section 12
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 13
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
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(config:Configuration, debug:DebugConfiguration, buffer:Buffer, info:Environment){
super();
_config = config;
_debug = debug;
_buffer = buffer;
_info = info;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(event:IOErrorEvent):void{
var url:String = _lastRequest.url;
var id:String = String((_requests.length - 1));
var msg = (("Gif Request #" + id) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (url.indexOf("?") > -1){
url = url.split("?")[0];
};
url = _shortenURL(url);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
msg = (msg + ((" \"" + url) + "\" does not exists or is unreachable"));
};
_debug.failure(msg);
} else {
_debug.warning(msg);
};
_removeListeners(event.target);
}
public function send(account:String, variables:Variables=null, force:Boolean=false, rateLimit:Boolean=false):void{
var localPath:String;
var localImage:URLRequest;
var remoteImage:URLRequest;
_utmac = account;
if (!variables){
variables = new Variables();
};
variables.URIencode = false;
variables.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
variables.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (force))){
if (rateLimit){
updateToken();
};
if (((((force) || (!(rateLimit)))) || ((_buffer.utmb.token >= 1)))){
if (((!(force)) && (rateLimit))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
variables.utmwv = utmwv;
variables.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
variables.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
variables.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
localPath = _info.locationSWFPath;
if (localPath.lastIndexOf("/") > 0){
localPath = localPath.substring(0, localPath.lastIndexOf("/"));
};
localImage = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
localImage.url = _config.localGIFpath;
} else {
localImage.url = (localPath + _config.localGIFpath);
};
localImage.url = (localImage.url + ("?" + variables.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(localImage);
} else {
sendRequest(localImage);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
remoteImage = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
remoteImage.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
remoteImage.url = _config.remoteGIFpath;
} else {
remoteImage.url = _config.remoteGIFpath;
};
};
variables.utmac = utmac;
variables.utmcc = encodeURIComponent(utmcc);
remoteImage.url = (remoteImage.url + ("?" + variables.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(remoteImage);
} else {
sendRequest(remoteImage);
};
};
};
};
}
public function onSecurityError(event:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(event.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var cookies:Array = [];
if (_buffer.hasUTMA()){
cookies.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
cookies.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
cookies.push((_buffer.utmv.toURLString() + ";"));
};
return (cookies.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(request:URLRequest):void{
var request = request;
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);
loader.load(request, context);
//unresolved jump
var _slot1 = e;
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
}
private function _removeListeners(target:Object):void{
target.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
target.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var tokenDelta:Number;
var timestamp:Number = new Date().getTime();
tokenDelta = ((timestamp - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + tokenDelta), VisualDebugMode.geek);
};
if (tokenDelta >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + tokenDelta)), _config.bucketCapacity);
_buffer.utmb.lastTime = timestamp;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(url:String):String{
var paths:Array;
if (url.length > 60){
paths = url.split("/");
while (url.length > 60) {
paths.shift();
url = ("../" + paths.join("/"));
};
};
return (url);
}
private function _debugSend(request:URLRequest):void{
var _local3:String;
var data:String = "";
switch (_debug.mode){
case VisualDebugMode.geek:
data = ((("Gif Request #" + _alertcount) + ":\n") + request.url);
break;
case VisualDebugMode.advanced:
_local3 = request.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
data = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
data = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(data, request, this);
_alertcount++;
}
public function onComplete(event:Event):void{
var id:String = event.target.loader.name;
_requests[id].complete();
var msg = (("Gif Request #" + id) + " sent");
var url:String = _requests[id].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (url.indexOf("?") > -1){
url = url.split("?")[0];
};
url = _shortenURL(url);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
msg = (msg + ((" to \"" + url) + "\""));
};
_debug.success(msg);
} else {
_debug.info(msg);
};
_removeListeners(event.target);
}
}
}//package com.google.analytics.core
Section 14
//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(config:Configuration, debug:DebugConfiguration, display:DisplayObject, buffer:Buffer){
super();
var delay:Number = config.idleLoop;
var inactivity:Number = config.idleTimeout;
var sessionTimeout:Number = config.sessionTimeout;
_loop = new Timer((delay * 1000));
_session = new Timer((sessionTimeout * 1000), 1);
_debug = debug;
_stage = display.stage;
_buffer = buffer;
_lastMove = getTimer();
_inactivity = (inactivity * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + delay) + "sec , inactivity: ") + inactivity) + "sec, sessionTimeout: ") + sessionTimeout), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(event:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(event: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(event:TimerEvent):void{
var current:int = getTimer();
if ((current - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 15
//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(){
super();
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function isIgnoredKeyword(keyword:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(keyword)){
return (true);
};
return (false);
}
public function getKeywordValue(or:OrganicReferrer, path:String):String{
var keyword:String = or.keyword;
return (getKeywordValueFromPath(keyword, path));
}
public function isIgnoredReferral(referrer:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(referrer)){
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(name:String):Boolean{
if (name == ""){
return (false);
};
name = name.toLowerCase();
if (_sourcesEngine[name] != undefined){
return (true);
};
return (false);
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function addSource(engine:String, keyword:String):void{
var orgref:OrganicReferrer = new OrganicReferrer(engine, keyword);
if (_sourcesCache[orgref.toString()] == undefined){
_sources.push(orgref);
_sourcesCache[orgref.toString()] = (_sources.length - 1);
if (_sourcesEngine[orgref.engine] == undefined){
_sourcesEngine[orgref.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[orgref.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((orgref.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(referrer:String):void{
if (_ignoredReferralsCache[referrer] == undefined){
_ignoredReferrals.push(referrer);
_ignoredReferralsCache[referrer] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + referrer) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(name:String):OrganicReferrer{
var index:int;
if (match(name)){
index = _sourcesEngine[name][0];
return (_sources[index]);
};
return (null);
}
public function addIgnoredKeyword(keyword:String):void{
if (_ignoredKeywordsCache[keyword] == undefined){
_ignoredKeywords.push(keyword);
_ignoredKeywordsCache[keyword] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + keyword) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(keyword:String, path:String):String{
var value:String;
var vars:Variables;
if (path.indexOf((keyword + "=")) > -1){
if (path.charAt(0) == "?"){
path = path.substr(1);
};
path = path.split("+").join("%20");
vars = new Variables(path);
value = vars[keyword];
};
return (value);
}
}
}//package com.google.analytics.core
Section 16
//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(engine:String, keyword:String){
super();
this.engine = engine;
this.keyword = keyword;
}
public function get keyword():String{
return (_keyword);
}
public function get engine():String{
return (_engine);
}
public function set engine(value:String):void{
_engine = value.toLowerCase();
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function set keyword(value:String):void{
_keyword = value.toLowerCase();
}
}
}//package com.google.analytics.core
Section 17
//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(request:URLRequest){
super();
start = getTimer();
this.request = request;
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function toString():String{
var data:Array = [];
data.push((("duration: " + duration) + "ms"));
data.push(("url: " + request.url));
return ((("{ " + data.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 18
//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(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 19
//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(tracker:GoogleAnalyticsAPI=null){
super();
this.tracker = tracker;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var o:Object;
var name:String;
var args:Array;
var l:int;
var i:int;
if (tracker == null){
return;
};
if (size() > 0){
l = _ar.length;
while (i < l) {
o = _ar.shift();
name = (o.name as String);
args = (o.args as Array);
if (((!((name == null))) && ((name in tracker)))){
(tracker[name] as Function).apply(tracker, args);
};
i++;
};
};
}
public function enqueue(name:String, ... _args):Boolean{
if (name == null){
return (false);
};
_ar.push({name:name, args:_args});
return (true);
}
public function link(targetUrl:String, useHash:Boolean=false):void{
enqueue("link", targetUrl, useHash);
}
public function addOrganic(newOrganicEngine:String, newOrganicKeyword:String):void{
enqueue("addOrganic", newOrganicEngine, newOrganicKeyword);
}
public function setAllowLinker(enable:Boolean):void{
enqueue("setAllowLinker", enable);
}
public function trackEvent(category:String, action:String, label:String=null, value:Number=NaN):Boolean{
enqueue("trackEvent", category, action, label, value);
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(pageURL:String=""):void{
enqueue("trackPageview", pageURL);
}
public function setClientInfo(enable:Boolean):void{
enqueue("setClientInfo", enable);
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
enqueue("linkByPost", formObject, useHash);
}
public function setCookieTimeout(newDefaultTimeout:int):void{
enqueue("setCookieTimeout", newDefaultTimeout);
}
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(enable:Boolean):void{
enqueue("setDetectFlash", enable);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(newCampNameKey:String):void{
enqueue("setCampNameKey", newCampNameKey);
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
enqueue("addItem", item, sku, name, category, price, quantity);
}
public function createEventTracker(objName: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(newVal:String):void{
enqueue("setVar", newVal);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setDomainName(newDomainName:String):void{
enqueue("setDomainName", newDomainName);
}
public function setCampSourceKey(newCampSrcKey:String):void{
enqueue("setCampSourceKey", newCampSrcKey);
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country: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(newCampContentKey:String):void{
enqueue("setCampContentKey", newCampContentKey);
}
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(enable:Boolean):void{
enqueue("setAllowAnchor", enable);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(newLocalGifPath:String):void{
enqueue("setLocalGifPath", newLocalGifPath);
}
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(newCookiePath:String):void{
enqueue("setCookiePath", newCookiePath);
}
public function setSampleRate(newRate:Number):void{
enqueue("setSampleRate", newRate);
}
public function setDetectTitle(enable:Boolean):void{
enqueue("setDetectTitle", enable);
}
public function setAllowHash(enable:Boolean):void{
enqueue("setAllowHash", enable);
}
public function addIgnoredOrganic(newIgnoredOrganicKeyword:String):void{
enqueue("addIgnoredOrganic", newIgnoredOrganicKeyword);
}
public function setCampNOKey(newCampNOKey:String):void{
enqueue("setCampNOKey", newCampNOKey);
}
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(newPath:String):void{
enqueue("cookiePathCopy", newPath);
}
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(enable:Boolean):void{
enqueue("setCampaignTrack", enable);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(newCampTermKey:String):void{
enqueue("setCampTermKey", newCampTermKey);
}
public function addIgnoredRef(newIgnoredReferrer:String):void{
enqueue("addIgnoredRef", newIgnoredReferrer);
}
public function setCampMediumKey(newCampMedKey:String):void{
enqueue("setCampMediumKey", newCampMedKey);
}
public function setSessionTimeout(newTimeout:int):void{
enqueue("setSessionTimeout", newTimeout);
}
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 20
//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";
public function TrackerMode(){
super();
}
}
}//package com.google.analytics.core
Section 21
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public function Utils(){
super();
}
public static function trim(raw:String, everything:Boolean=false):String{
var i:int;
var iLeft:int;
var iRight:int;
if (raw == ""){
return ("");
};
var whitespaces:Array = [" ", "\n", "\r", "\t"];
var str:String = raw;
if (everything){
i = 0;
while ((((i < whitespaces.length)) && ((str.indexOf(whitespaces[i]) > -1)))) {
str = str.split(whitespaces[i]).join("");
i++;
};
} else {
iLeft = 0;
while ((((iLeft < str.length)) && ((whitespaces.indexOf(str.charAt(iLeft)) > -1)))) {
iLeft++;
};
str = str.substr(iLeft);
iRight = (str.length - 1);
while ((((iRight >= 0)) && ((whitespaces.indexOf(str.charAt(iRight)) > -1)))) {
iRight--;
};
str = str.substring(0, (iRight + 1));
};
return (str);
}
public static function generateHash(input:String):int{
var pos:int;
var current:int;
var hash = 1;
var leftMost7:int;
if (((!((input == null))) && (!((input == ""))))){
hash = 0;
pos = (input.length - 1);
while (pos >= 0) {
current = input.charCodeAt(pos);
hash = ((((hash << 6) & 268435455) + current) + (current << 14));
leftMost7 = (hash & 266338304);
if (leftMost7 != 0){
hash = (hash ^ (leftMost7 >> 21));
};
pos--;
};
};
return (hash);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(account:String):Boolean{
var rel:RegExp = /^UA-[0-9]*-[0-9]*$/;
return (rel.test(account));
}
}
}//package com.google.analytics.core
Section 22
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/data;Cookie.as:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/data;Cookie.as:Date):void;
function set expiration(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/data;Cookie.as:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 23
//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(domainHash:Number=NaN, sessionId:Number=NaN, firstTime:Number=NaN, lastTime:Number=NaN, currentTime:Number=NaN, sessionCount:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = domainHash;
this.sessionId = sessionId;
this.firstTime = firstTime;
this.lastTime = lastTime;
this.currentTime = currentTime;
this.sessionCount = sessionCount;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(value:Number):void{
_lastTime = value;
update();
}
public function set currentTime(value:Number):void{
_currentTime = value;
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(value:Number):void{
_domainHash = value;
update();
}
public function set sessionId(value:Number):void{
_sessionId = value;
update();
}
public function set sessionCount(value:Number):void{
_sessionCount = value;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(value:Number):void{
_firstTime = value;
update();
}
}
}//package com.google.analytics.data
Section 24
//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(domainHash:Number=NaN, trackCount:Number=NaN, token:Number=NaN, lastTime:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = domainHash;
this.trackCount = trackCount;
this.token = token;
this.lastTime = lastTime;
}
public function set token(value:Number):void{
_token = value;
update();
}
public function set trackCount(value:Number):void{
_trackCount = value;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set lastTime(value:Number):void{
_lastTime = value;
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 25
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(domainHash:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = domainHash;
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
}
}//package com.google.analytics.data
Section 26
//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(name:String, inURL:String, fields:Array, timespan:Number=0){
super();
this.name = name;
this.inURL = inURL;
this.fields = fields;
_timestamp(timespan);
}
public function isEmpty():Boolean{
var field:String;
var empty:int;
var i:int;
while (i < fields.length) {
field = fields[i];
if ((((this[field] is Number)) && (isNaN(this[field])))){
empty++;
} else {
if ((((this[field] is String)) && ((this[field] == "")))){
empty++;
};
};
i++;
};
if (empty == fields.length){
return (true);
};
return (false);
}
public function resetTimestamp(timespan:Number=NaN):void{
if (!isNaN(timespan)){
_timespan = timespan;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function reset():void{
var field:String;
var i:int;
while (i < fields.length) {
field = fields[i];
if ((this[field] is Number)){
this[field] = NaN;
} else {
if ((this[field] is String)){
this[field] = "";
};
};
i++;
};
resetTimestamp();
update();
}
public function fromSharedObject(data:Object):void{
var field:String;
var len:int = fields.length;
var i:int;
while (i < len) {
field = fields[i];
if (data[field]){
this[field] = data[field];
};
i++;
};
if (data.creation){
this.creation = data.creation;
};
if (data.expiration){
this.expiration = data.expiration;
};
}
private function _timestamp(timespan:Number):void{
creation = new Date();
_timespan = timespan;
if (timespan > 0){
expiration = new Date((creation.valueOf() + timespan));
};
}
public function isExpired():Boolean{
var current:Date = new Date();
var diff:Number = (expiration.valueOf() - current.valueOf());
if (diff <= 0){
return (true);
};
return (false);
}
public function set expiration(value:Date):void{
_expiration = value;
}
public function get creation():Date{
return (_creation);
}
public function valueOf():String{
var field:String;
var value:*;
var data:Array = [];
var i:int;
while (i < fields.length) {
field = fields[i];
value = this[field];
if ((value is String)){
if (value == ""){
value = "-";
data.push(value);
} else {
data.push(value);
};
} else {
if ((value is Number)){
if (value == 0){
data.push(value);
} else {
if (isNaN(value)){
value = "-";
data.push(value);
} else {
data.push(value);
};
};
};
};
i++;
};
return (("" + data.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 field:String;
var value:*;
var data:Object = {};
var i:int;
for (;i < fields.length;i++) {
field = fields[i];
value = this[field];
if ((value is String)){
data[field] = value;
} else {
if (value == 0){
data[field] = value;
} else {
if (isNaN(value)){
continue;
} else {
data[field] = value;
};
};
};
};
data.creation = creation;
data.expiration = expiration;
return (data);
}
public function toString(showTimestamp:Boolean=false):String{
var field:String;
var value:*;
var data:Array = [];
var len:int = fields.length;
var i:int;
for (;i < len;i++) {
field = fields[i];
value = this[field];
if ((value is String)){
data.push((((field + ": \"") + value) + "\""));
} else {
if (value == 0){
data.push(((field + ": ") + value));
} else {
if (isNaN(value)){
continue;
} else {
data.push(((field + ": ") + value));
};
};
};
};
var str = (((name.toUpperCase() + " {") + data.join(", ")) + "}");
if (showTimestamp){
str = (str + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (str);
}
public function set creation(value:Date):void{
_creation = value;
}
}
}//package com.google.analytics.data
Section 27
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(hash:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = hash;
}
public function set hash(value:Number):void{
_hash = value;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 28
//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(domainHash:Number=NaN, value:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = domainHash;
this.value = value;
}
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(value:Number):void{
_domainHash = value;
update();
}
public function set value(value:String):void{
_value = value;
update();
}
}
}//package com.google.analytics.data
Section 29
//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(domainHash:Number=NaN, campaignCreation:Number=NaN, campaignSessions:Number=NaN, responseCount:Number=NaN, campaignTracking:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = domainHash;
this.campaignCreation = campaignCreation;
this.campaignSessions = campaignSessions;
this.responseCount = responseCount;
this.campaignTracking = campaignTracking;
}
public function set responseCount(value:Number):void{
_responseCount = value;
update();
}
public function set domainHash(value:Number):void{
_domainHash = value;
update();
}
public function set campaignCreation(value:Number):void{
_campaignCreation = value;
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(value:Number):void{
_campaignSessions = value;
update();
}
public function set campaignTracking(value:String):void{
_campaignTracking = value;
update();
}
}
}//package com.google.analytics.data
Section 30
//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(projectId:Number, type:String, num:Number, value:String):void{
if (!hasProject(projectId)){
_projectData[projectId] = {};
};
if (_projectData[projectId][type] == undefined){
_projectData[projectId][type] = [];
};
_projectData[projectId][type][num] = value;
_hasData = (_hasData + 1);
}
private function _renderProject(project:Object):String{
var i:int;
var data:Array;
var result:String = "";
var needTypeQualifier:Boolean;
var l:int = _set.length;
i = 0;
while (i < l) {
data = project[_set[i]];
if (data){
if (needTypeQualifier){
result = (result + _set[i]);
};
result = (result + _renderDataType(data));
needTypeQualifier = false;
} else {
needTypeQualifier = true;
};
i++;
};
return (result);
}
public function hasProject(projectId:Number):Boolean{
return (_projectData[projectId]);
}
public function clearKey(projectId:Number):void{
_clearInternal(projectId, _key);
}
private function _renderDataType(data:Array):String{
var str:String;
var i:int;
var result:Array = [];
i = 0;
while (i < data.length) {
if (data[i] != undefined){
str = "";
if (((!((i == _minimum))) && ((data[(i - 1)] == undefined)))){
str = (str + i.toString());
str = (str + _delimNumValue);
};
str = (str + _escapeExtensibleValue(data[i]));
result.push(str);
};
i++;
};
return (((_delimBegin + result.join(_delimSet)) + _delimEnd));
}
public function getKey(projectId:Number, num:Number):String{
return ((_getInternal(projectId, _key, num) as String));
}
public function hasData():Boolean{
return ((_hasData > 0));
}
public function renderMergedUrlString(extObject:X10=null):String{
var projectId:String;
if (!extObject){
return (renderUrlString());
};
var result:Array = [extObject.renderUrlString()];
for (projectId in _projectData) {
if (((hasProject(Number(projectId))) && (!(extObject.hasProject(Number(projectId)))))){
result.push((projectId + _renderProject(_projectData[projectId])));
};
};
return (result.join(""));
}
public function setValue(projectId:Number, num:Number, value:Number):Boolean{
if (((((!((Math.round(value) == value))) || (isNaN(value)))) || ((value == Infinity)))){
return (false);
};
_setInternal(projectId, _value, num, value.toString());
return (true);
}
public function renderUrlString():String{
var projectId:String;
var result:Array = [];
for (projectId in _projectData) {
if (hasProject(Number(projectId))){
result.push((projectId + _renderProject(_projectData[projectId])));
};
};
return (result.join(""));
}
private function _getInternal(projectId:Number, type:String, num:Number):Object{
if (((hasProject(projectId)) && (!((_projectData[projectId][type] == undefined))))){
return (_projectData[projectId][type][num]);
};
return (undefined);
}
public function setKey(projectId:Number, num:Number, value:String):Boolean{
_setInternal(projectId, _key, num, value);
return (true);
}
public function clearValue(projectId:Number):void{
_clearInternal(projectId, _value);
}
private function _clearInternal(projectId:Number, type:String):void{
var isEmpty:Boolean;
var i:int;
var l:int;
if (((hasProject(projectId)) && (!((_projectData[projectId][type] == undefined))))){
_projectData[projectId][type] = undefined;
isEmpty = true;
l = _set.length;
i = 0;
while (i < l) {
if (_projectData[projectId][_set[i]] != undefined){
isEmpty = false;
break;
};
i++;
};
if (isEmpty){
_projectData[projectId] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function getValue(projectId:Number, num:Number){
var value:* = _getInternal(projectId, _value, num);
if (value == null){
return (null);
};
return (Number(value));
}
private function _escapeExtensibleValue(value:String):String{
var i:int;
var c:String;
var escaped:String;
var result:String = "";
i = 0;
while (i < value.length) {
c = value.charAt(i);
escaped = _escapeCharMap[c];
if (escaped){
result = (result + escaped);
} else {
result = (result + c);
};
i++;
};
return (result);
}
}
}//package com.google.analytics.data
Section 31
//_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(){
super();
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(data:String):void{
_sheet.parseCSS(data);
}
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 32
//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(text:String, actions:Array, tag:String="uiAlert", color:uint=0, alignement:Align=null, stickToEdge:Boolean=false, actionOnNextLine:Boolean=true){
if (color == 0){
color = Style.alertColor;
};
if (alignement == null){
alignement = Align.center;
};
super(text, tag, color, alignement, stickToEdge);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = actionOnNextLine;
_actions = [];
var i:int;
while (i < actions.length) {
actions[i].container = this;
_actions.push(actions[i]);
i++;
};
}
private function _defineActions():void{
var action:AlertAction;
var str:String = "";
if (actionOnNextLine){
str = (str + "\n");
} else {
str = (str + " |");
};
str = (str + " ");
var actions:Array = [];
var i:int;
while (i < _actions.length) {
action = _actions[i];
actions.push((((("<a href=\"event:" + action.activator) + "\">") + action.name) + "</a>"));
i++;
};
str = (str + actions.join(" | "));
appendText(str, "uiAlertAction");
}
protected function isValidAction(action:String):Boolean{
var i:int;
while (i < _actions.length) {
if (action == _actions[i].activator){
return (true);
};
i++;
};
return (false);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function getAction(name:String):AlertAction{
var i:int;
while (i < _actions.length) {
if (name == _actions[i].activator){
return (_actions[i]);
};
i++;
};
return (null);
}
protected function spaces(num:int):String{
var str:String = "";
var spc:String = " ";
var i:int;
while (i < (num + 1)) {
str = (str + spc);
i++;
};
return (str);
}
override public function onLink(event:TextEvent):void{
var action:AlertAction;
if (isValidAction(event.text)){
action = getAction(event.text);
if (action){
action.execute();
};
};
if (autoClose){
close();
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 33
//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(name:String, activator:String, callback){
super();
this.name = name;
this.activator = activator;
_callback = callback;
}
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 34
//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(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 35
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public function Background(){
super();
}
public static function drawRounded(target, g:Graphics, width:uint=0, height:uint=0):void{
var W:uint;
var H:uint;
var R:uint = Style.roundedCorner;
if ((((width > 0)) && ((height > 0)))){
W = width;
H = height;
} else {
W = target.width;
H = target.height;
};
if (((target.stickToEdge) && (!((target.alignement == Align.none))))){
switch (target.alignement){
case Align.top:
g.drawRoundRectComplex(0, 0, W, H, 0, 0, R, R);
break;
case Align.topLeft:
g.drawRoundRectComplex(0, 0, W, H, 0, 0, 0, R);
break;
case Align.topRight:
g.drawRoundRectComplex(0, 0, W, H, 0, 0, R, 0);
break;
case Align.bottom:
g.drawRoundRectComplex(0, 0, W, H, R, R, 0, 0);
break;
case Align.bottomLeft:
g.drawRoundRectComplex(0, 0, W, H, 0, R, 0, 0);
break;
case Align.bottomRight:
g.drawRoundRectComplex(0, 0, W, H, R, 0, 0, 0);
break;
case Align.left:
g.drawRoundRectComplex(0, 0, W, H, 0, R, 0, R);
break;
case Align.right:
g.drawRoundRectComplex(0, 0, W, H, R, 0, R, 0);
break;
case Align.center:
g.drawRoundRect(0, 0, W, H, R, R);
break;
};
} else {
g.drawRoundRect(0, 0, W, H, R, R);
};
}
}
}//package com.google.analytics.debug
Section 36
//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(color:uint=0, alignement:Align=null, stickToEdge:Boolean=false){
if (alignement == null){
alignement = Align.bottom;
};
super("", "uiLabel", color, alignement, stickToEdge);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(message:String):void{
write(message, true);
}
private function _getLinesToDisplay(direction:int=0):Array{
var lines:Array;
var start:uint;
var end:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + direction);
} else {
if ((((_linediff > 0)) && ((direction < 0)))){
_linediff = (_linediff + direction);
};
};
start = ((_lines.length - maxLines) + _linediff);
end = (start + maxLines);
lines = _lines.slice(start, end);
} else {
lines = _lines;
};
return (lines);
}
private function onKey(event:KeyboardEvent=null):void{
var lines:Array;
switch (event.keyCode){
case Keyboard.DOWN:
lines = _getLinesToDisplay(1);
break;
case Keyboard.UP:
lines = _getLinesToDisplay(-1);
break;
default:
lines = null;
};
if (lines == null){
return;
};
text = lines.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
} else {
};
return (!NULL!);
}
public function write(message:String, bold:Boolean=false):void{
var inputLines:Array;
if (message.indexOf("") > -1){
inputLines = message.split("\n");
} else {
inputLines = [message];
};
var pre:String = "";
var post:String = "";
if (bold){
pre = "<b>";
post = "</b>";
};
var i:int;
while (i < inputLines.length) {
_lines.push(((pre + inputLines[i]) + post));
i++;
};
var lines:Array = _getLinesToDisplay();
text = lines.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 37
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import flash.net.*;
import com.google.analytics.core.*;
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(value:Boolean):void{
_verbose = value;
}
public function set mode(value):void{
if ((value is String)){
switch (value){
case "geek":
value = VisualDebugMode.geek;
break;
case "advanced":
value = VisualDebugMode.advanced;
break;
case "basic":
default:
value = VisualDebugMode.basic;
};
};
_mode = value;
}
public function success(message:String):void{
if (layout){
layout.createSuccessAlert(message);
};
if (traceOutput){
trace((("[+] " + message) + " !!"));
};
}
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(message:String, mode:VisualDebugMode=null):void{
if (_filter(mode)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(message);
};
if (traceOutput){
trace((("## " + message) + " ##"));
};
}
private function _filter(mode:VisualDebugMode=null):Boolean{
return (((mode) && ((int(mode) >= int(this.mode)))));
}
public function failure(message:String):void{
if (layout){
layout.createFailureAlert(message);
};
if (traceOutput){
trace((("[-] " + message) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(value:Boolean):void{
_active = value;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(message:String):void{
var msgs:Array;
var j:int;
var messages:Array = [];
var pre0:String = "";
var pre1:String = "";
if (this.mode == VisualDebugMode.geek){
pre0 = (getTimer() + " - ");
pre1 = (new Array(pre0.length).join(" ") + " ");
};
if (message.indexOf("\n") > -1){
msgs = message.split("\n");
j = 0;
while (j < msgs.length) {
if (msgs[j] == ""){
} else {
if (j == 0){
messages.push((pre0 + msgs[j]));
} else {
messages.push((pre1 + msgs[j]));
};
};
j++;
};
} else {
messages.push((pre0 + message));
};
var len:int = messages.length;
var i:int;
while (i < len) {
trace(messages[i]);
i++;
};
}
public function alert(message:String):void{
if (layout){
layout.createAlert(message);
};
if (traceOutput){
trace((("!! " + message) + " !!"));
};
}
public function info(message:String, mode:VisualDebugMode=null):void{
if (_filter(mode)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(message);
};
if (traceOutput){
trace(message);
};
}
public function alertGifRequest(message:String, request:URLRequest, ref:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(message, request, ref);
};
if (traceOutput){
trace(((">> " + message) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 38
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(debug:DebugConfiguration, text:String, actions:Array){
var alignement:Align = Align.bottomLeft;
var stickToEdge:Boolean;
var actionOnNextLine:Boolean;
if (debug.verbose){
text = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + text);
alignement = Align.center;
stickToEdge = false;
actionOnNextLine = true;
};
super(text, actions, "uiFailure", Style.failureColor, alignement, stickToEdge, actionOnNextLine);
}
}
}//package com.google.analytics.debug
Section 39
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(text:String, actions:Array){
super(text, actions);
}
}
}//package com.google.analytics.debug
Section 40
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import flash.display.*;
import flash.net.*;
import com.google.analytics.core.*;
public interface ILayout {
function createAlert(:String):void;
function addToStage(:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createWarning(:String):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(:String):void;
function createFailureAlert(:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(:String):void;
function createVisualDebug():void;
function destroy():void;
function bringToFront(:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 41
//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(text:String="", timeout:uint=3000){
super(text, "uiInfo", Style.infoColor, Align.top, true);
if (timeout > 0){
_timer = new Timer(timeout, 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(event:TextEvent):void{
switch (event.text){
case "hide":
close();
break;
};
}
public function onComplete(event:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 42
//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(text:String="", tag:String="uiLabel", color:uint=0, alignement:Align=null, stickToEdge:Boolean=false){
super();
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = text;
_tag = tag;
if (alignement == null){
alignement = Align.none;
};
this.alignement = alignement;
this.stickToEdge = stickToEdge;
if (color == 0){
color = Style.backgroundColor;
};
_color = color;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var g:Graphics = _background.graphics;
g.clear();
g.beginFill(_color);
var W:uint = _textField.width;
var H:uint = _textField.height;
if (forcedWidth > 0){
W = forcedWidth;
};
Background.drawRounded(this, g, W, H);
g.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(value:String, newtag:String=""):void{
if (value == ""){
return;
};
if (newtag == ""){
newtag = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + newtag) + "\">") + value) + "</span>"));
_text = (_text + value);
_draw();
resize();
}
public function set text(value:String):void{
if (value == ""){
value = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + value) + "</span>");
_text = value;
_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(value:String):void{
_tag = value;
text = "";
}
public function onLink(event:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 43
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import com.google.analytics.core.*;
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(debug:DebugConfiguration, display:DisplayObject){
super();
_display = display;
_debug = debug;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(event:KeyboardEvent=null):void{
switch (event.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(message:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(message);
return;
};
message = _filterMaxChars(message);
_hasWarning = true;
var w:Warning = new Warning(message, _debug.warningTimeout);
addToPanel("analytics", w);
w.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(message);
};
}
public function bringToFront(visual:DisplayObject):void{
_display.stage.setChildIndex(visual, (_display.stage.numChildren - 1));
}
public function createFailureAlert(message:String):void{
var actionClose:AlertAction;
if (_debug.verbose){
message = _filterMaxChars(message);
actionClose = new AlertAction("Close", "close", "close");
} else {
actionClose = new AlertAction("X", "close", "close");
};
var fa:Alert = new FailureAlert(_debug, message, [actionClose]);
addToPanel("analytics", fa);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.writeBold(message);
};
}
public function init():void{
var spaces = 10;
var W:uint = (_display.stage.stageWidth - (spaces * 2));
var H:uint = (_display.stage.stageHeight - (spaces * 2));
var mp:Panel = new Panel("analytics", W, H);
mp.alignement = Align.top;
mp.stickToEdge = false;
mp.title = ("Google Analytics v" + GATracker.version);
_mainPanel = mp;
addToStage(mp);
bringToFront(mp);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(name:String, visual:DisplayObject):void{
var panel:Panel;
var d:DisplayObject = _display.stage.getChildByName(name);
if (d){
panel = (d as Panel);
panel.addData(visual);
} else {
trace((("panel \"" + name) + "\" not found"));
};
}
private function _clearInfo(event:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(message:String, maxCharPerLine:int=0):String{
var line:String;
var CRLF:String = "\n";
var output:Array = [];
var lines:Array = message.split(CRLF);
if (maxCharPerLine == 0){
maxCharPerLine = _maxCharPerLine;
};
var i:int;
while (i < lines.length) {
line = lines[i];
while (line.length > maxCharPerLine) {
output.push(line.substr(0, maxCharPerLine));
line = line.substring(maxCharPerLine);
};
output.push(line);
i++;
};
return (output.join(CRLF));
}
private function _clearGRAlert(event:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(message:String):void{
var actionClose:AlertAction;
if (_debug.verbose){
message = _filterMaxChars(message);
actionClose = new AlertAction("Close", "close", "close");
} else {
actionClose = new AlertAction("X", "close", "close");
};
var sa:Alert = new SuccessAlert(_debug, message, [actionClose]);
addToPanel("analytics", sa);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.writeBold(message);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(message:String):void{
message = _filterMaxChars(message);
var a:Alert = new Alert(message, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", a);
if (_hasDebug){
visualDebug.writeBold(message);
};
}
public function createInfo(message:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(message);
return;
};
message = _filterMaxChars(message);
_hasInfo = true;
var i:Info = new Info(message, _debug.infoTimeout);
addToPanel("analytics", i);
i.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(message);
};
}
public function createGIFRequestAlert(message:String, request:URLRequest, ref:GIFRequest):void{
var message = message;
var request = request;
var ref = ref;
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(visual:DisplayObject):void{
_display.stage.addChild(visual);
}
private function _clearWarning(event:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(name:String, width:uint, height:uint):void{
var p:Panel = new Panel(name, width, height);
p.alignement = Align.center;
p.stickToEdge = false;
addToStage(p);
bringToFront(p);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 44
//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(top:int=0, bottom:int=0, left:int=0, right:int=0){
super();
this.top = top;
this.bottom = bottom;
this.left = left;
this.right = right;
}
}
}//package com.google.analytics.debug
Section 45
//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(name:String, width:uint, height:uint, backgroundColor:uint=0, borderColor:uint=0, baseAlpha:Number=0.3, alignement:Align=null, stickToEdge:Boolean=false){
super();
_name = name;
this.name = name;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = width;
forcedHeight = height;
this.baseAlpha = baseAlpha;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = width;
_data.forcedHeight = height;
_data.mouseEnabled = false;
_title = new Label(name, "uiLabel", 0xFFFFFF, Align.topLeft, stickToEdge);
_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 (alignement == null){
alignement = Align.none;
};
this.alignement = alignement;
this.stickToEdge = stickToEdge;
if (backgroundColor == 0){
backgroundColor = Style.backgroundColor;
};
_backgroundColor = backgroundColor;
if (borderColor == 0){
borderColor = Style.borderColor;
};
_borderColor = borderColor;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(event:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(value:Boolean):void{
_stickToEdge = value;
_title.stickToEdge = value;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var W:uint;
var H:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
W = forcedWidth;
H = forcedHeight;
} else {
W = _title.width;
H = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = W;
forcedHeight = H;
};
var g0:Graphics = _background.graphics;
g0.clear();
g0.beginFill(_backgroundColor);
Background.drawRounded(this, g0, W, H);
g0.endFill();
var g01:Graphics = _data.graphics;
g01.clear();
g01.beginFill(_backgroundColor, 0);
Background.drawRounded(this, g01, W, H);
g01.endFill();
var g1:Graphics = _border.graphics;
g1.clear();
g1.lineStyle(0.1, _borderColor);
Background.drawRounded(this, g1, W, H);
g1.endFill();
var g2:Graphics = _mask.graphics;
g2.clear();
g2.beginFill(_backgroundColor);
Background.drawRounded(this, g2, (W + 1), (H + 1));
g2.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(child:DisplayObject):void{
_data.addChild(child);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(value:String):void{
_title.text = value;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 46
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 47
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(debug:DebugConfiguration, text:String, actions:Array){
var alignement:Align = Align.bottomLeft;
var stickToEdge:Boolean;
var actionOnNextLine:Boolean;
if (debug.verbose){
text = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + text);
alignement = Align.center;
stickToEdge = false;
actionOnNextLine = true;
};
super(text, actions, "uiSuccess", Style.successColor, alignement, stickToEdge, actionOnNextLine);
}
}
}//package com.google.analytics.debug
Section 48
//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(alignTarget:DisplayObject=null){
super();
listenResize = false;
alignement = Align.none;
this.alignTarget = alignTarget;
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(event:Event):void{
layout();
resize();
}
protected function dispose():void{
var d:DisplayObject;
var i:int;
while (i < numChildren) {
d = getChildAt(i);
if (d){
removeChild(d);
};
i++;
};
}
public function set forcedHeight(value:uint):void{
_forcedHeight = value;
}
public function set forcedWidth(value:uint):void{
_forcedWidth = value;
}
protected function layout():void{
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
public function alignTo(alignement:Align, target:DisplayObject=null):void{
var H:uint;
var W:uint;
var X:uint;
var Y:uint;
var t:UISprite;
if (target == null){
if ((parent is Stage)){
target = this.stage;
} else {
target = parent;
};
};
if (target == this.stage){
if (this.stage == null){
return;
};
H = this.stage.stageHeight;
W = this.stage.stageWidth;
X = 0;
Y = 0;
} else {
t = (target as UISprite);
if (t.forcedHeight){
H = t.forcedHeight;
} else {
H = t.height;
};
if (t.forcedWidth){
W = t.forcedWidth;
} else {
W = t.width;
};
X = 0;
Y = 0;
};
switch (alignement){
case Align.top:
x = ((W / 2) - (forcedWidth / 2));
y = (Y + margin.top);
break;
case Align.bottom:
x = ((W / 2) - (forcedWidth / 2));
y = (((Y + H) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (X + margin.left);
y = ((H / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((X + W) - forcedWidth) - margin.right);
y = ((H / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((W / 2) - (forcedWidth / 2));
y = ((H / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (X + margin.left);
y = (Y + margin.top);
break;
case Align.topRight:
x = (((X + W) - forcedWidth) - margin.right);
y = (Y + margin.top);
break;
case Align.bottomLeft:
x = (X + margin.left);
y = (((Y + H) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((X + W) - forcedWidth) - margin.right);
y = (((Y + H) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((alignement == Align.none))))){
target.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = alignement;
this.alignTarget = target;
}
private function _onRemovedFromStage(event: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(event:Event):void{
resize();
}
}
}//package com.google.analytics.debug
Section 49
//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(text:String="", timeout:uint=3000){
super(text, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (timeout > 0){
_timer = new Timer(timeout, 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(event:TextEvent):void{
switch (event.text){
case "hide":
close();
break;
};
}
public function onComplete(event:TimerEvent):void{
close();
}
}
}//package com.google.analytics.debug
Section 50
//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(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 51
//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(type:String, tracker:AnalyticsTracker, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
this.tracker = tracker;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 52
//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(debug:DebugConfiguration){
super(debug);
}
public function set vid(value:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", value);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function set hid(value:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", value);
}
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(value:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", value);
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
}
}//package com.google.analytics.external
Section 53
//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(debug:DebugConfiguration){
super(debug);
}
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 obj:Object = call(cache_properties_js);
if (obj){
_host = obj.host;
_language = obj.language;
_characterSet = obj.characterSet;
_colorDepth = obj.colorDepth;
_location = obj.location;
_pathname = obj.pathname;
_protocol = obj.protocol;
_search = obj.search;
_referrer = obj.referrer;
_title = obj.title;
};
}
public function get language():String{
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
var lang:String = getProperty("navigator.language");
if (lang == null){
lang = getProperty("navigator.browserLanguage");
};
_language = lang;
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 cs:String = getProperty("document.characterSet");
if (cs == null){
cs = getProperty("document.charset");
};
_characterSet = cs;
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 54
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import com.google.analytics.debug.*;
import flash.external.*;
import flash.system.*;
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(debug:DebugConfiguration){
super();
_debug = debug;
}
public function getProperty(name:String){
return (call((name + ".valueOf")));
}
public function hasProperty(path:String):Boolean{
return (call(hasProperty_js, path));
}
public function setProperty(path:String, value):void{
call(setProperty_js, path, value);
}
public function executeBlock(data:String):void{
var data = data;
if (isAvailable()){
ExternalInterface.call(data);
//unresolved jump
var _slot1 = e;
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
//unresolved jump
var _slot1 = e;
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + _slot1.message));
};
};
}
public function getPropertyString(name:String):String{
return (call((name + ".toString")));
}
public function setPropertyByReference(path:String, target:String):void{
call(setPropertyRef_js, path, target);
}
public function call(functionName:String, ... _args){
var output:String;
var functionName = functionName;
var args = _args;
if (isAvailable()){
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));
//unresolved jump
var _slot1 = e;
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
//unresolved jump
var _slot1 = e;
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + _slot1.message));
};
};
return (null);
}
public function isAvailable():Boolean{
var available:Boolean = ExternalInterface.available;
if (((available) && ((Capabilities.playerType == "External")))){
available = false;
};
if (((((!(available)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (available);
}
}
}//package com.google.analytics.external
Section 55
//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(url:String="", app:String="", version:String="", debug:DebugConfiguration=null, dom:HTMLDOM=null){
var v:Version;
super();
if (app == ""){
if (isAIR()){
app = "AIR";
} else {
app = "Flash";
};
};
if (version == ""){
v = flashVersion;
} else {
v = Version.fromString(version);
};
_url = url;
_appName = app;
_appVersion = v;
_debug = debug;
_dom = dom;
}
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 _search:String = _dom.search;
if (_search){
return (_search);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var v:Version = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (v);
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
public function get languageEncoding():String{
var _charset:String;
if (System.useCodePage){
_charset = _dom.characterSet;
if (_charset){
return (_charset);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var color:String;
switch (Capabilities.screenColor){
case "bw":
color = "1";
break;
case "gray":
color = "2";
break;
case "color":
default:
color = "24";
};
var _colorDepth:String = _dom.colorDepth;
if (_colorDepth){
color = _colorDepth;
};
return (color);
}
private function _findProtocol():void{
var URL:String;
var test:String;
var p:Protocols = Protocols.none;
if (_url != ""){
URL = _url.toLowerCase();
test = URL.substr(0, 5);
switch (test){
case "file:":
p = Protocols.file;
break;
case "http:":
p = Protocols.HTTP;
break;
case "https":
if (URL.charAt(5) == ":"){
p = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
var _proto:String = _dom.protocol;
var proto:String = (p.toString() + ":").toLowerCase();
if (((((_proto) && (!((_proto == proto))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + proto) + ", DOM=") + _proto));
};
_protocol = p;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var p:String = Capabilities.manufacturer;
return (p.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(value:String):void{
_appName = value;
userAgent.applicationProduct = value;
}
function set url(value:String):void{
_url = value;
}
public function get referrer():String{
var _referrer:String = _dom.referrer;
if (_referrer){
return (_referrer);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _lang:String = _dom.language;
var lang:String = Capabilities.language;
if (_lang){
if ((((_lang.length > lang.length)) && ((_lang.substr(0, lang.length) == lang)))){
lang = _lang;
};
};
return (lang);
}
public function get domainName():String{
var URL:String;
var str:String;
var end:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
URL = _url.toLowerCase();
if (protocol == Protocols.HTTP){
str = URL.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
str = URL.split("https://").join("");
};
};
end = str.indexOf("/");
if (end > -1){
str = str.substring(0, end);
};
return (str);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(custom:UserAgent):void{
_userAgent = custom;
}
public function set appVersion(value:Version):void{
_appVersion = value;
userAgent.applicationVersion = value.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _pathname:String = _dom.pathname;
if (_pathname){
return (_pathname);
};
return ("");
}
public function get documentTitle():String{
var _title:String = _dom.title;
if (_title){
return (_title);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 56
//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(value:int=0, name:String=""){
super();
_value = value;
_name = name;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 57
//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;
public function Timespan(){
super();
}
}
}//package com.google.analytics.utils
Section 58
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(url:String=""){
super();
_url = url.toLowerCase();
}
public function get domain():String{
var parts:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
parts = hostName.split(".");
switch (parts.length){
case 2:
return (hostName);
case 3:
if (parts[1] == "co"){
return (hostName);
};
parts.shift();
return (parts.join("."));
case 4:
parts.shift();
return (parts.join("."));
};
};
return ("");
}
public function get path():String{
var _path:String = _url;
if (_path.indexOf("://") > -1){
_path = _path.split("://")[1];
};
if (_path.indexOf(hostName) == 0){
_path = _path.substr(hostName.length);
};
if (_path.indexOf("?") > -1){
_path = _path.split("?")[0];
};
if (_path.charAt(0) != "/"){
_path = ("/" + _path);
};
return (_path);
}
public function get protocol():Protocols{
var proto:String = _url.split("://")[0];
switch (proto){
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 hostname:String = _url;
if (hostname.indexOf("://") > -1){
hostname = hostname.split("://")[1];
};
if (hostname.indexOf("/") > -1){
hostname = hostname.split("/")[0];
};
if (hostname.indexOf("?") > -1){
hostname = hostname.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (hostname);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _search:String = _url;
if (_search.indexOf("://") > -1){
_search = _search.split("://")[1];
};
if (_search.indexOf(hostName) == 0){
_search = _search.substr(hostName.length);
};
if (_search.indexOf("?") > -1){
_search = _search.split("?")[1];
} else {
_search = "";
};
return (_search);
}
}
}//package com.google.analytics.utils
Section 59
//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(localInfo:Environment, product:String="", version:String=""){
super();
_localInfo = localInfo;
applicationProduct = product;
_version = Version.fromString(version);
}
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 vp:String = "";
if (_localInfo.isAIR()){
vp = (vp + "AIR");
} else {
vp = (vp + "FlashPlayer");
};
vp = (vp + "/");
vp = (vp + _version.toString(3));
return (vp);
}
public function toString():String{
var UA:String = "";
UA = (UA + applicationProductToken);
if (applicationComment != ""){
UA = (UA + (" " + applicationComment));
};
if (tamarinProductToken != ""){
UA = (UA + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
UA = (UA + (" " + vendorProductToken));
};
return (UA);
}
public function get applicationComment():String{
var comment:Array = [];
comment.push(_localInfo.platform);
comment.push(_localInfo.playerType);
if (!UserAgent.minimal){
comment.push(_localInfo.operatingSystem);
comment.push(_localInfo.language);
};
if (Capabilities.isDebugger){
comment.push("DEBUG");
};
if (comment.length > 0){
return ((("(" + comment.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(value:String):void{
_version = Version.fromString(value);
}
public function get applicationProductToken():String{
var token:String = applicationProduct;
if (applicationVersion != ""){
token = (token + ("/" + applicationVersion));
};
return (token);
}
public function set applicationProduct(value:String):void{
_applicationProduct = value;
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 60
//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(source:String=null, pre:Array=null, post:Array=null){
pre = [];
post = [];
super();
if (source){
decode(source);
};
if (pre){
this.pre = pre;
};
if (post){
this.post = post;
};
}
private function _join(vars:Variables):void{
var prop:String;
if (!vars){
return;
};
for (prop in vars) {
this[prop] = vars[prop];
};
}
public function join(... _args):void{
var l:int = _args.length;
var i:int;
while (i < l) {
if (!(_args[i] is Variables)){
} else {
_join(_args[i]);
};
i++;
};
}
public function toString():String{
var value:String;
var p:String;
var component:String;
var i:int;
var j:int;
var priority:String;
var last:String;
var data:Array = [];
for (p in this) {
value = this[p];
if (URIencode){
value = encodeURI(value);
};
data.push(((p + "=") + value));
};
if (sort){
data.sort();
};
if (pre.length > 0){
pre.reverse();
i = 0;
while (i < pre.length) {
priority = pre[i];
j = 0;
while (j < data.length) {
component = data[j];
if (component.indexOf(priority) == 0){
data.unshift(data.splice(j, 1)[0]);
};
j++;
};
i++;
};
pre.reverse();
};
if (post.length > 0){
i = 0;
while (i < post.length) {
last = post[i];
j = 0;
while (j < data.length) {
component = data[j];
if (component.indexOf(last) == 0){
data.push(data.splice(j, 1)[0]);
};
j++;
};
i++;
};
};
return (data.join("&"));
}
public function decode(source:String):void{
var data:Array;
var prop:String;
var name:String;
var value:String;
var tmp:Array;
if (source == ""){
return;
};
if (source.indexOf("&") > -1){
data = source.split("&");
} else {
data = [source];
};
var i:int;
while (i < data.length) {
prop = data[i];
if (prop.indexOf("=") > -1){
tmp = prop.split("=");
name = tmp[0];
value = decodeURI(tmp[1]);
this[name] = value;
};
i++;
};
}
public function toURLVariables():URLVariables{
var p:String;
var urlvars:URLVariables = new URLVariables();
for (p in this) {
urlvars[p] = this[p];
};
return (urlvars);
}
}
}//package com.google.analytics.utils
Section 61
//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(major:uint=0, minor:uint=0, build:uint=0, revision:uint=0){
var v:Version;
super();
if ((((((((major > _maxMajor)) && ((minor == 0)))) && ((build == 0)))) && ((revision == 0)))){
v = Version.fromNumber(major);
major = v.major;
minor = v.minor;
build = v.build;
revision = v.revision;
};
this.major = major;
this.minor = minor;
this.build = build;
this.revision = revision;
}
public function toString(fields:int=0):String{
var arr:Array;
if ((((fields <= 0)) || ((fields > 4)))){
fields = getFields();
};
switch (fields){
case 1:
arr = [major];
break;
case 2:
arr = [major, minor];
break;
case 3:
arr = [major, minor, build];
break;
case 4:
default:
arr = [major, minor, build, revision];
};
return (arr.join(_separator));
}
public function set revision(value:uint):void{
_revision = Math.min(value, _maxRevision);
}
public function get revision():uint{
return (_revision);
}
public function set build(value:uint):void{
_build = Math.min(value, _maxBuild);
}
public function set minor(value:uint):void{
_minor = Math.min(value, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(value:uint):void{
_major = Math.min(value, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
private function getFields():int{
var f = 4;
if (revision == 0){
f--;
};
if ((((f == 3)) && ((build == 0)))){
f--;
};
if ((((f == 2)) && ((minor == 0)))){
f--;
};
return (f);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function equals(o):Boolean{
if (!(o is Version)){
return (false);
};
if ((((((((o.major == major)) && ((o.minor == minor)))) && ((o.build == build)))) && ((o.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(value:String="", separator:String="."):Version{
var values:Array;
var v:Version = new (Version);
if ((((value == "")) || ((value == null)))){
return (v);
};
if (value.indexOf(separator) > -1){
values = value.split(separator);
v.major = parseInt(values[0]);
v.minor = parseInt(values[1]);
v.build = parseInt(values[2]);
v.revision = parseInt(values[3]);
} else {
v.major = parseInt(value);
};
return (v);
}
public static function fromNumber(value:Number=0):Version{
var v:Version = new (Version);
if (((((((((((isNaN(value)) || ((value == 0)))) || ((value < 0)))) || ((value == Number.MAX_VALUE)))) || ((value == Number.POSITIVE_INFINITY)))) || ((value == Number.NEGATIVE_INFINITY)))){
return (v);
};
v.major = (value >>> 28);
v.minor = ((value & 251658240) >>> 24);
v.build = ((value & 0xFF0000) >>> 16);
v.revision = (value & 0xFFFF);
return (v);
}
}
}//package com.google.analytics.utils
Section 62
//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(account:String, debug:DebugConfiguration, jsproxy:JavascriptProxy){
var msg0:String;
var msg1:String;
var msg2:String;
super();
_account = account;
_debug = debug;
_proxy = jsproxy;
if (!_checkGAJS()){
msg0 = "";
msg0 = (msg0 + "ga.js not found, be sure to check if\n");
msg0 = (msg0 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
msg0 = (msg0 + "is included in the HTML.");
_debug.warning(msg0);
throw (new Error(msg0));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
msg1 = "";
msg1 = (msg1 + "The Google Analytics tracking code was not found on the container page\n");
msg1 = (msg1 + "we create it");
_debug.info(msg1, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(account)){
_createTrackingObject(account);
} else {
if (_checkTrackingObject(account)){
_linkTrackingObject(account);
} else {
msg2 = "";
msg2 = (msg2 + (("JS Object \"" + account) + "\" doesn't exist in DOM\n"));
msg2 = (msg2 + "Bridge object not created.");
_debug.warning(msg2);
throw (new Error(msg2));
};
};
}
public function link(targetUrl:String, useHash:Boolean=false):void{
_debug.info((((("link( " + targetUrl) + ", ") + useHash) + " )"));
_call("_link", targetUrl, useHash);
}
public function addOrganic(newOrganicEngine:String, newOrganicKeyword:String):void{
_debug.info((("addOrganic( " + [newOrganicEngine, newOrganicKeyword].join(", ")) + " )"));
_call("_addOrganic", newOrganicEngine);
}
public function setAllowLinker(enable:Boolean):void{
_debug.info((("setAllowLinker( " + enable) + " )"));
_call("_setAllowLinker", enable);
}
private function _linkTrackingObject(path:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, path);
}
public function trackEvent(category:String, action:String, label:String=null, value:Number=NaN):Boolean{
var param = 2;
if (((label) && (!((label == ""))))){
param = 3;
};
if ((((param == 3)) && (!(isNaN(value))))){
param = 4;
};
switch (param){
case 4:
_debug.info((("trackEvent( " + [category, action, label, value].join(", ")) + " )"));
return (_call("_trackEvent", category, action, label, value));
case 3:
_debug.info((("trackEvent( " + [category, action, label].join(", ")) + " )"));
return (_call("_trackEvent", category, action, label));
case 2:
default:
_debug.info((("trackEvent( " + [category, action].join(", ")) + " )"));
return (_call("_trackEvent", category, action));
};
}
public function setClientInfo(enable:Boolean):void{
_debug.info((("setClientInfo( " + enable) + " )"));
_call("_setClientInfo", enable);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function setCookieTimeout(newDefaultTimeout:int):void{
_debug.info((("setCookieTimeout( " + newDefaultTimeout) + " )"));
_call("_setCookieTimeout", newDefaultTimeout);
}
public function trackPageview(pageURL:String=""):void{
_debug.info((("trackPageview( " + pageURL) + " )"));
_call("_trackPageview", pageURL);
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _checkValidTrackingObject(account:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, account));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
_debug.warning((((("linkByPost( " + formObject) + ", ") + useHash) + " ) not implemented"));
}
private function _call(functionName:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + functionName));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(account:String):Boolean{
var hasObj:Boolean = _proxy.hasProperty(account);
var isTracker:Boolean = _proxy.hasProperty((account + "._getAccount"));
return (((hasObj) && (isTracker)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(newCampNameKey:String):void{
_debug.info((("setCampNameKey( " + newCampNameKey) + " )"));
_call("_setCampNameKey", newCampNameKey);
}
public function setDetectFlash(enable:Boolean):void{
_debug.info((("setDetectFlash( " + enable) + " )"));
_call("_setDetectFlash", enable);
}
public function createEventTracker(objName:String):EventTracker{
_debug.info((("createEventTracker( " + objName) + " )"));
return (new EventTracker(objName, this));
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
_debug.info((("addItem( " + [item, sku, name, category, price, quantity].join(", ")) + " )"));
_call("_addItem", item, sku, name, category, price, quantity);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(newVal:String):void{
_debug.info((("setVar( " + newVal) + " )"));
_call("_setVar", newVal);
}
public function setDomainName(newDomainName:String):void{
_debug.info((("setDomainName( " + newDomainName) + " )"));
_call("_setDomainName", newDomainName);
}
public function hasTrackingAccount(account:String):Boolean{
if (Utils.validateAccount(account)){
return (_checkValidTrackingObject(account));
};
return (_checkTrackingObject(account));
}
public function setCampSourceKey(newCampSrcKey:String):void{
_debug.info((("setCampSourceKey( " + newCampSrcKey) + " )"));
_call("_setCampSourceKey", newCampSrcKey);
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country:String):Object{
_debug.info((("addTrans( " + [orderId, affiliation, total, tax, shipping, city, state, country].join(", ")) + " )"));
_call("_addTrans", orderId, affiliation, total, tax, shipping, city, state, country);
return (null);
}
public function setCampContentKey(newCampContentKey:String):void{
_debug.info((("setCampContentKey( " + newCampContentKey) + " )"));
_call("_setCampContentKey", newCampContentKey);
}
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(enable:Boolean):void{
_debug.info((("setAllowAnchor( " + enable) + " )"));
_call("_setAllowAnchor", enable);
}
public function setLocalGifPath(newLocalGifPath:String):void{
_debug.info((("setLocalGifPath( " + newLocalGifPath) + " )"));
_call("_setLocalGifPath", newLocalGifPath);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(newCookiePath:String):void{
_debug.info((("setCookiePath( " + newCookiePath) + " )"));
_call("_setCookiePath", newCookiePath);
}
public function setSampleRate(newRate:Number):void{
_debug.info((("setSampleRate( " + newRate) + " )"));
_call("_setSampleRate", newRate);
}
public function setAllowHash(enable:Boolean):void{
_debug.info((("setAllowHash( " + enable) + " )"));
_call("_setAllowHash", enable);
}
public function addIgnoredOrganic(newIgnoredOrganicKeyword:String):void{
_debug.info((("addIgnoredOrganic( " + newIgnoredOrganicKeyword) + " )"));
_call("_addIgnoredOrganic", newIgnoredOrganicKeyword);
}
public function setCampNOKey(newCampNOKey:String):void{
_debug.info((("setCampNOKey( " + newCampNOKey) + " )"));
_call("_setCampNOKey", newCampNOKey);
}
public function cookiePathCopy(newPath:String):void{
_debug.info((("cookiePathCopy( " + newPath) + " )"));
_call("_cookiePathCopy", newPath);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(enable:Boolean):void{
_debug.info((("setDetectTitle( " + enable) + " )"));
_call("_setDetectTitle", enable);
}
private function _createTrackingObject(account:String):void{
_proxy.call(_createTrackingObject_js, account);
}
public function setCampaignTrack(enable:Boolean):void{
_debug.info((("setCampaignTrack( " + enable) + " )"));
_call("_setCampaignTrack", enable);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(newCampTermKey:String):void{
_debug.info((("setCampTermKey( " + newCampTermKey) + " )"));
_call("_setCampTermKey", newCampTermKey);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(newCampMedKey:String):void{
_debug.info((("setCampMediumKey( " + newCampMedKey) + " )"));
_call("_setCampMediumKey", newCampMedKey);
}
public function addIgnoredRef(newIgnoredReferrer:String):void{
_debug.info((("addIgnoredRef( " + newIgnoredReferrer) + " )"));
_call("_addIgnoredRef", newIgnoredReferrer);
}
public function setSessionTimeout(newTimeout:int):void{
_debug.info((("setSessionTimeout( " + newTimeout) + " )"));
_call("_setSessionTimeout", newTimeout);
}
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 63
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
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(debug:DebugConfiguration=null){
_organic = new Organic();
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
campaignKey = new CampaignKey();
serverMode = ServerOperationMode.remote;
super();
_debug = debug;
_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(engine:String, keyword:String):void{
var engine = engine;
var keyword = keyword;
_organic.addSource(engine, keyword);
//unresolved jump
var _slot1 = e;
if (((_debug) && (_debug.active))){
_debug.warning(_slot1.message);
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(value:Number):void{
if (value <= 0){
value = 0.1;
};
if (value > 1){
value = 1;
};
value = Number(value.toFixed(2));
_sampleRate = value;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 64
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function getServiceMode():ServerOperationMode;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as: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(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setCampNameKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function addIgnoredOrganic(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function setAllowLinker(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function getClientInfo():Boolean;
function getDetectFlash():Boolean;
function setCampaignTrack(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function createEventTracker(void:String):EventTracker;
function setCookieTimeout(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:int):void;
function setAllowAnchor(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String=""):void;
function setLocalGifPath(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function getVersion():String;
function getLocalGifPath():String;
function setVar(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function addIgnoredRef(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setClientInfo(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function setCookiePath(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setSampleRate(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Number):void;
function setSessionTimeout(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:int):void;
function setRemoteServerMode():void;
function clearIgnoredRef():void;
function setDomainName(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setDetectTitle(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function setAllowHash(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function setLocalRemoteServerMode():void;
function cookiePathCopy(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics/v4;GoogleAnalyticsAPI.as:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 65
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import com.google.analytics.utils.*;
import com.google.analytics.data.*;
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(account:String, config:Configuration, debug:DebugConfiguration, info:Environment, buffer:Buffer, gifRequest:GIFRequest, adSense:AdSenseGlobals){
var msg:String;
super();
_account = account;
_config = config;
_debug = debug;
_info = info;
_buffer = buffer;
_gifRequest = gifRequest;
_adSense = adSense;
if (!Utils.validateAccount(account)){
msg = (("Account \"" + account) + "\" is not valid.");
_debug.warning(msg);
throw (new Error(msg));
};
_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(newOrganicEngine:String, newOrganicKeyword:String):void{
_debug.info((("addOrganic( " + [newOrganicEngine, newOrganicKeyword].join(", ")) + " )"));
_config.organic.addSource(newOrganicEngine, newOrganicKeyword);
}
public function setAllowLinker(enable:Boolean):void{
_config.allowLinker = enable;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function trackEvent(category:String, action:String, label:String=null, value:Number=NaN):Boolean{
var success:Boolean;
var params = 2;
if (((!((category == ""))) && (!((action == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
success = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, category);
success = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, action);
if (((label) && (!((label == ""))))){
success = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, label);
params = 3;
if (!isNaN(value)){
success = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, value);
params = 4;
};
};
if (success){
_debug.info(((("valid event tracking call\ncategory: " + category) + "\naction: ") + action), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + category) + "\naction: ") + action), VisualDebugMode.geek);
success = false;
};
switch (params){
case 4:
_debug.info((("trackEvent( " + [category, action, label, value].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [category, action, label].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [category, action].join(", ")) + " )"));
};
return (success);
}
public function trackPageview(pageURL:String=""):void{
_debug.info((("trackPageview( " + pageURL) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(pageURL);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + pageURL) + " ) failed"));
};
}
public function setCookieTimeout(newDefaultTimeout:int):void{
_config.conversionTimeout = newDefaultTimeout;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
_debug.warning("trackTrans() not implemented");
}
public function setClientInfo(enable:Boolean):void{
_config.detectClientInfo = enable;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
_debug.warning((("linkByPost( " + [formObject, useHash].join(", ")) + " ) not implemented"));
}
private function _initData():void{
var data0:String;
var data:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
data0 = "";
data0 = (data0 + "_initData 0");
data0 = (data0 + ("\ndomain name: " + _config.domainName));
data0 = (data0 + ("\ndomain hash: " + _domainHash));
data0 = (data0 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(data0, 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){
data = "";
data = (data + "_initData (misc)");
data = (data + ("\nflash version: " + _info.flashVersion.toString(4)));
data = (data + ("\nprotocol: " + _info.protocol));
data = (data + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
data = (data + ("\nlanguage: " + _info.language));
data = (data + ("\ndomain hash: " + _getDomainHash()));
data = (data + ("\nuser-agent: " + _info.userAgent));
_debug.info(data, 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(opt_xObj:X10=null):void{
var searchVariables:Variables;
var eventInfo:EventInfo;
var eventvars:Variables;
var generalvars:Variables;
_initData();
if (_takeSample()){
searchVariables = new Variables();
searchVariables.URIencode = true;
eventInfo = new EventInfo(true, _x10Module, opt_xObj);
eventvars = eventInfo.toVariables();
generalvars = _renderMetricsSearchVariables();
searchVariables.join(eventvars, generalvars);
_gifRequest.send(_account, searchVariables, false, true);
};
}
public function setDetectFlash(enable:Boolean):void{
_config.detectFlash = enable;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(newCampNameKey:String):void{
_config.campaignKey.UCCN = newCampNameKey;
var msg = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCCN]"));
} else {
_debug.info(msg);
};
}
private function _formatReferrer():String{
var domainName:String;
var ref:URL;
var dom:URL;
var referrer:String = _info.referrer;
if ((((referrer == "")) || ((referrer == "localhost")))){
referrer = "-";
} else {
domainName = _info.domainName;
ref = new URL(referrer);
dom = new URL(("http://" + domainName));
if (ref.hostName == domainName){
return ("-");
};
if (dom.domain == ref.domain){
if (dom.subDomain != ref.subDomain){
referrer = "0";
};
};
if ((((referrer.charAt(0) == "[")) && (referrer.charAt((referrer.length - 1))))){
referrer = "-";
};
};
_debug.info(("formated referrer: " + referrer), VisualDebugMode.advanced);
return (referrer);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(objName:String):EventTracker{
_debug.info((("createEventTracker( " + objName) + " )"));
return (new EventTracker(objName, this));
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
_debug.warning((("addItem( " + [item, sku, name, category, price, quantity].join(", ")) + " ) not implemented"));
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(newVal:String):void{
var variables:Variables;
if (((!((newVal == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = newVal;
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + newVal) + " )"));
if (_takeSample()){
variables = new Variables();
variables.utmt = "var";
_gifRequest.send(_account, variables);
};
} else {
_debug.warning((("setVar \"" + newVal) + "\" is ignored"));
};
}
public function setDomainName(newDomainName:String):void{
if (newDomainName == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (newDomainName == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = newDomainName;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var domainName:String;
if (_config.domain.mode == DomainNameMode.auto){
domainName = _info.domainName;
if (domainName.substring(0, 4) == "www."){
domainName = domainName.substring(4);
};
_config.domain.name = domainName;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country:String):Object{
_debug.warning((("addTrans( " + [orderId, affiliation, total, tax, shipping, city, state, country].join(", ")) + " ) not implemented"));
return (null);
}
private function _renderMetricsSearchVariables(pageURL:String=""):Variables{
var campvars:Variables;
var variables:Variables = new Variables();
variables.URIencode = true;
var docInfo:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, pageURL, _adSense);
_debug.info(("docInfo: " + docInfo.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
campvars = _campaignInfo.toVariables();
};
var browservars:Variables = _browserInfo.toVariables();
variables.join(docInfo.toVariables(), browservars, campvars);
return (variables);
}
public function setCampContentKey(newCampContentKey:String):void{
_config.campaignKey.UCCT = newCampContentKey;
var msg = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCCT]"));
} else {
_debug.info(msg);
};
}
private function _handleCookie():void{
var data0:String;
var data1:String;
var vid:Array;
var data2: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){
data0 = "";
data0 = (data0 + "AdSense sid found\n");
data0 = (data0 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(data0, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
data1 = "";
data1 = (data1 + "AdSense sid found (new visitor)\n");
data1 = (data1 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(data1, VisualDebugMode.geek);
};
};
if (_adSense.vid){
vid = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(vid[0]);
_buffer.utma.firstTime = Number(vid[1]);
if (_debug.verbose){
data2 = "";
data2 = (data2 + "AdSense vid found (new visitor)\n");
data2 = (data2 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(vid[0])) + ")\n"));
data2 = (data2 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(vid[1])) + ")"));
_debug.info(data2, 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(newCampSrcKey:String):void{
_config.campaignKey.UCSR = newCampSrcKey;
var msg = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCSR]"));
} else {
_debug.info(msg);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(newLocalGifPath:String):void{
_config.localGIFpath = newLocalGifPath;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(enable:Boolean):void{
_config.allowAnchor = enable;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var domainName:String = _config.domainName;
var g0 = (domainName.indexOf("www.google.") < 0);
var g1 = (domainName.indexOf(".google.") < 0);
var g2 = (domainName.indexOf("google.") < 0);
var g4 = (domainName.indexOf("google.org") > -1);
return (((((((((g0) || (g1))) || (g2))) || (!((_config.cookiePath == "/"))))) || (g4)));
}
public function setSampleRate(newRate:Number):void{
if (newRate < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = newRate;
};
_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(newCookiePath:String):void{
_config.cookiePath = newCookiePath;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(enable:Boolean):void{
_config.allowDomainHash = enable;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var hash:String = "";
hash = (hash + _info.appName);
hash = (hash + _info.appVersion);
hash = (hash + _info.language);
hash = (hash + _info.platform);
hash = (hash + _info.userAgent.toString());
hash = (hash + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
hash = (hash + _info.referrer);
return (Utils.generateHash(hash));
}
public function setCampNOKey(newCampNOKey:String):void{
_config.campaignKey.UCNO = newCampNOKey;
var msg = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCNO]"));
} else {
_debug.info(msg);
};
}
public function addIgnoredOrganic(newIgnoredOrganicKeyword:String):void{
_debug.info((("addIgnoredOrganic( " + newIgnoredOrganicKeyword) + " )"));
_config.organic.addIgnoredKeyword(newIgnoredOrganicKeyword);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(newPath:String):void{
_debug.warning((("cookiePathCopy( " + newPath) + " ) not implemented"));
}
public function setDetectTitle(enable:Boolean):void{
_config.detectTitle = enable;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(newCampTermKey:String):void{
_config.campaignKey.UCTR = newCampTermKey;
var msg = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCTR]"));
} else {
_debug.info(msg);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(pageURL:String=""):void{
var searchVariables:Variables;
var x10vars:Variables;
var generalvars:Variables;
var eventInfo:EventInfo;
if (_takeSample()){
searchVariables = new Variables();
searchVariables.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
eventInfo = new EventInfo(false, _x10Module);
x10vars = eventInfo.toVariables();
};
generalvars = _renderMetricsSearchVariables(pageURL);
searchVariables.join(x10vars, generalvars);
_gifRequest.send(_account, searchVariables);
};
}
public function setCampaignTrack(enable:Boolean):void{
_config.campaignTracking = enable;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(newIgnoredReferrer:String):void{
_debug.info((("addIgnoredRef( " + newIgnoredReferrer) + " )"));
_config.organic.addIgnoredReferral(newIgnoredReferrer);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(newCampMedKey:String):void{
_config.campaignKey.UCMD = newCampMedKey;
var msg = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((msg + " [UCMD]"));
} else {
_debug.info(msg);
};
}
private function _getUniqueSessionId():Number{
var sessionID:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + sessionID), VisualDebugMode.geek);
return (sessionID);
}
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(newTimeout:int):void{
_config.sessionTimeout = newTimeout;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(targetUrl:String, useHash:Boolean=false):void{
_debug.warning((("link( " + [targetUrl, useHash].join(", ")) + " ) not implemented"));
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 66
//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(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics;AnalyticsTracker.as:String):void;
function get config():Configuration;
function get mode():String;
function set config(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics;AnalyticsTracker.as:Configuration):void;
function set mode(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics;AnalyticsTracker.as:String):void;
function set debug(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics;AnalyticsTracker.as:DebugConfiguration):void;
function get visualDebug():Boolean;
function get account():String;
function set visualDebug(/buRRRn/projects/GAforFlash/GA_AS3/build/tmp;com/google/analytics;AnalyticsTracker.as:Boolean):void;
function isReady():Boolean;
function get debug():DebugConfiguration;
}
}//package com.google.analytics
Section 67
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
public function API(){
super();
}
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 68
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
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.utils.*;
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(display:DisplayObject, account:String, mode:String="AS3", visualDebug:Boolean=false, config:Configuration=null, debug:DebugConfiguration=null){
super();
_display = display;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = account;
this.mode = mode;
this.visualDebug = visualDebug;
if (!debug){
this.debug = new DebugConfiguration();
};
if (!config){
this.config = new Configuration(debug);
};
if (autobuild){
_factory();
};
}
public function link(targetUrl:String, useHash:Boolean=false):void{
_tracker.link(targetUrl, useHash);
}
public function addOrganic(Layout:String, Layout:String):void{
_tracker.addOrganic(Layout, Layout);
}
public function setAllowLinker(enable:Boolean):void{
_tracker.setAllowLinker(enable);
}
public function trackEvent(TrackerCache:String, TrackerCache:String, TrackerCache:String=null, TrackerCache:Number=NaN):Boolean{
return (_tracker.trackEvent(TrackerCache, TrackerCache, TrackerCache, TrackerCache));
}
public function setCookieTimeout(newDefaultTimeout:int):void{
_tracker.setCookieTimeout(newDefaultTimeout);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function trackPageview(pageURL:String=""):void{
_tracker.trackPageview(pageURL);
}
public function setClientInfo(Layout:Boolean):void{
_tracker.setClientInfo(Layout);
}
public function get account():String{
return (_account);
}
public function linkByPost(formObject:Object, useHash:Boolean=false):void{
_tracker.linkByPost(formObject, useHash);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(event:Event):Boolean{
return (_eventDispatcher.dispatchEvent(event));
}
public function get config():Configuration{
return (_config);
}
public function set mode(value:String):void{
_mode = value;
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
_eventDispatcher.removeEventListener(type, listener, useCapture);
}
public function setDetectFlash(Layout:Boolean):void{
_tracker.setDetectFlash(Layout);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(newCampNameKey:String):void{
_tracker.setCampNameKey(newCampNameKey);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(item:String, sku:String, name:String, category:String, price:Number, quantity:int):void{
_tracker.addItem(item, sku, name, category, price, quantity);
}
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(value:String):void{
_account = value;
}
public function setVar(newVal:String):void{
_tracker.setVar(newVal);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
_eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public function setDomainName(newDomainName:String):void{
_tracker.setDomainName(newDomainName);
}
public function createEventTracker(listener:String):EventTracker{
return (_tracker.createEventTracker(listener));
}
public function setCampSourceKey(newCampSrcKey:String):void{
_tracker.setCampSourceKey(newCampSrcKey);
}
public function set config(value:Configuration):void{
_config = value;
}
public function addTrans(orderId:String, affiliation:String, total:Number, tax:Number, shipping:Number, city:String, state:String, country:String):Object{
return (_tracker.addTrans(orderId, affiliation, total, tax, shipping, city, state, country));
}
public function setCampContentKey(newCampContentKey:String):void{
_tracker.setCampContentKey(newCampContentKey);
}
public function willTrigger(type:String):Boolean{
return (_eventDispatcher.willTrigger(type));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(enable:Boolean):void{
_tracker.setAllowAnchor(enable);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function isReady():Boolean{
return (_ready);
}
public function get mode():String{
return (_mode);
}
public function set debug(value:DebugConfiguration):void{
_debug = value;
}
public function setLocalGifPath(Layout:String):void{
_tracker.setLocalGifPath(Layout);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(newRate:Number):void{
_tracker.setSampleRate(newRate);
}
public function setCookiePath(newCookiePath:String):void{
_tracker.setCookiePath(newCookiePath);
}
public function setAllowHash(enable:Boolean):void{
_tracker.setAllowHash(enable);
}
public function addIgnoredOrganic(Layout:String):void{
_tracker.addIgnoredOrganic(Layout);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(newPath:String):void{
_tracker.cookiePathCopy(newPath);
}
private function _factory():void{
var activeTracker:GoogleAnalyticsAPI;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
var cache:TrackerCache = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
activeTracker = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
activeTracker = _trackerFactory();
};
if (!cache.isEmpty()){
cache.tracker = activeTracker;
cache.flush();
};
_tracker = activeTracker;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(newCampTermKey:String):void{
_tracker.setCampTermKey(newCampTermKey);
}
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(newCampNOKey:String):void{
_tracker.setCampNOKey(newCampNOKey);
}
public function setDetectTitle(Layout:Boolean):void{
_tracker.setDetectTitle(Layout);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(enable:Boolean):void{
_tracker.setCampaignTrack(enable);
}
public function addIgnoredRef(Layout:String):void{
_tracker.addIgnoredRef(Layout);
}
public function set visualDebug(value:Boolean):void{
_visualDebug = value;
}
public function setCampMediumKey(newCampMedKey:String):void{
_tracker.setCampMediumKey(newCampMedKey);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function hasEventListener(type:String):Boolean{
return (_eventDispatcher.hasEventListener(type));
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function setSessionTimeout(newTimeout:int):void{
_tracker.setSessionTimeout(newTimeout);
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 69
//AwardsService (com.spilgames.api.AwardsService)
package com.spilgames.api {
public class AwardsService {
public function AwardsService(){
super();
}
public static function submitAward(awardTag:String, callback:Function=null):int{
return (SpilGamesServices.getInstance().send("Awards", "submitAward", callback, {tag:awardTag, userName:User.getUserName(), userHash:User.getUserHash()}));
}
public static function isAvailable():Boolean{
return (SpilGamesServices.getInstance().isServiceAvailable("Awards"));
}
}
}//package com.spilgames.api
Section 70
//ScoreService (com.spilgames.api.ScoreService)
package com.spilgames.api {
public class ScoreService {
public function ScoreService(){
super();
}
public static function submitScore(score:int, callback:Function=null):int{
return (SpilGamesServices.getInstance().send("Score", "submitScore", callback, {score:score, userName:User.getUserName(), userHash:User.getUserHash()}));
}
public static function isAvailable():Boolean{
return (SpilGamesServices.getInstance().isServiceAvailable("Score"));
}
}
}//package com.spilgames.api
Section 71
//SpilGamesServices (com.spilgames.api.SpilGamesServices)
package com.spilgames.api {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import flash.system.*;
public class SpilGamesServices extends MovieClip {
private const DEFAULT_CONNECTION_LOCATION:String = "http://www8.agame.com/games/flash/services/ServicesConnection.swf";
private var _connected:Boolean;// = false
private var _connecting:Boolean;// = false
private var _loader:Loader;
private var _servicesConnection;// = null
private var _alwaysInFront:Boolean;// = false
public static const INVALID_ID:int = -1;
public static const CONFIGURATION_FAILED:String = "configurationFailure";
public static const INVALID_DOMAIN:String = "invalidDomain";
private static var _instance:SpilGamesServices = null;
public function SpilGamesServices(access:Private=null){
super();
if (!access){
throw (new Error("Cannot instantiate this class, use SpilGamesServices.getInstance"));
};
}
private function handleRemovedFromStage(e:Event):void{
trace("WARNING: please do not remove SpilGamesServices from the stage");
}
private function handleLoadComplete(e:Event):void{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_servicesConnection = LoaderInfo(e.target).content;
_servicesConnection.addEventListener(Event.COMPLETE, handleServicesReady);
_servicesConnection.addEventListener(ErrorEvent.ERROR, handleServicesFailed);
_servicesConnection.addEventListener("serviceError", handleServiceError);
addChild(_servicesConnection);
}
public function send(serviceID:String, functionName:String, callback:Function, args:Object=null):int{
if (isReady()){
return (_servicesConnection.send(serviceID, functionName, callback, args));
};
return (INVALID_ID);
}
private function handleServicesFailed(e:ErrorEvent):void{
_servicesConnection.addEventListener(Event.COMPLETE, handleServicesReady);
_servicesConnection.addEventListener(ErrorEvent.ERROR, handleServicesFailed);
_servicesConnection.addEventListener("serviceError", handleServiceError);
_connecting = false;
if (hasEventListener("servicesFailed")){
dispatchEvent(new ErrorEvent("servicesFailed", false, false, e.text));
};
}
public function get version():String{
return ("1.1");
}
public function isReady():Boolean{
return (((!((_servicesConnection == null))) && (_servicesConnection.isReady())));
}
private function handleIOError(e:IOErrorEvent):void{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_connecting = false;
if (hasEventListener(e.type)){
dispatchEvent(e);
};
}
private function handleServiceError(e:Event):void{
var message:String;
if (hasEventListener("serviceError")){
message = "";
if ((e is ErrorEvent)){
message = ErrorEvent(e).text;
} else {
message = e.toString();
};
dispatchEvent(new ErrorEvent("serviceError", false, false, message));
};
}
public function disconnect():void{
if (_servicesConnection){
_servicesConnection.removeEventListener(Event.COMPLETE, handleServicesReady);
_servicesConnection.removeEventListener(ErrorEvent.ERROR, handleServicesFailed);
_servicesConnection.removeEventListener("serviceError", handleServiceError);
if (_connected){
_servicesConnection.disconnect();
};
removeChild(_servicesConnection);
};
_servicesConnection = null;
if (_loader){
try {
_loader.close();
//unresolved jump
var _slot1 = e;
} finally {
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
};
_loader = null;
};
removeEventListener(Event.ENTER_FRAME, bringToFront);
removeEventListener(Event.REMOVED_FROM_STAGE, handleRemovedFromStage);
if (parent){
parent.removeChild(this);
};
_connected = (_connecting = false);
}
private function handleServicesReady(e:Event):void{
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_connected = true;
_connecting = false;
dispatchEvent(new Event("servicesReady"));
}
public function get connection(){
return (_servicesConnection);
}
public function getSiteID():int{
if (_servicesConnection != null){
return (_servicesConnection.getSiteID());
};
return (INVALID_ID);
}
public function isServiceAvailable(serviceID:String):Boolean{
return (((isReady()) && (_servicesConnection.isServiceAvailable(serviceID))));
}
public function getChannelID():int{
if (_servicesConnection != null){
return (_servicesConnection.getChannelID());
};
return (INVALID_ID);
}
public function set alwaysInFront(value:Boolean):void{
if (_alwaysInFront != value){
_alwaysInFront = value;
if (_alwaysInFront){
addEventListener(Event.ENTER_FRAME, bringToFront);
} else {
removeEventListener(Event.ENTER_FRAME, bringToFront);
};
};
}
public function getItemID():int{
if (_servicesConnection != null){
return (_servicesConnection.getItemID());
};
return (INVALID_ID);
}
public function allowDomain(domain:String):void{
Security.allowDomain("*");
Security.allowInsecureDomain("*");
}
public function connect(clip:DisplayObjectContainer, ... _args):void{
var request:URLRequest;
var connectionLocation:String;
var urlVariables:URLVariables;
var date:Date;
if (((!(_connecting)) && (!(_connected)))){
if (!clip.stage){
throw (new Error("The given clip must be present in the display list (added to stage)"));
};
_connecting = true;
clip.stage.addChild(this);
addEventListener(Event.REMOVED_FROM_STAGE, handleRemovedFromStage);
if (((root.loaderInfo.parameters["servicesLoc"]) && ((root.loaderInfo.parameters["servicesLoc"].length > 0)))){
connectionLocation = root.loaderInfo.parameters["servicesLoc"];
request = new URLRequest(connectionLocation);
} else {
connectionLocation = DEFAULT_CONNECTION_LOCATION;
urlVariables = new URLVariables();
date = new Date();
urlVariables.nocache = ((((date.fullYear * 12) + (date.month + 1)) * 31) + date.day);
request = new URLRequest(connectionLocation);
request.data = urlVariables;
};
allowDomain(connectionLocation);
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoadComplete);
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleIOError);
_loader.load(request);
};
}
public function get alwaysInFront():Boolean{
return (_alwaysInFront);
}
public function get connecting():Boolean{
return (_connecting);
}
public function isDomainAllowed():Boolean{
return (((!((_servicesConnection == null))) && (_servicesConnection.isDomainValid())));
}
public function bringToFront(e:Event=null):void{
var e = e;
if (parent){
parent.setChildIndex(this, (parent.numChildren - 1));
//unresolved jump
var _slot1 = e;
removeEventListener(Event.ENTER_FRAME, bringToFront);
};
}
public static function getInstance():SpilGamesServices{
if (!_instance){
_instance = new SpilGamesServices(new Private());
};
return (_instance);
}
}
}//package com.spilgames.api
class Private {
private function Private(){
super();
}
}
Section 72
//User (com.spilgames.api.User)
package com.spilgames.api {
import flash.display.*;
public class User {
public function User(){
super();
}
public static function getUserName():String{
var connection:* = SpilGamesServices.getInstance().connection;
if (connection != null){
return (connection.getUserName());
};
return ("");
}
public static function isGuest():Boolean{
var root:DisplayObject;
var vars:Object;
var connection:* = SpilGamesServices.getInstance().connection;
if (connection != null){
return (connection.isGuest());
};
root = SpilGamesServices.getInstance().root;
if (root.loaderInfo != null){
vars = root.loaderInfo.parameters;
return (((((((!(vars.username)) || ((vars.username == "")))) || (!(vars.hash)))) || ((vars.hash == ""))));
};
return (false);
}
public static function getUserHash():String{
var connection:* = SpilGamesServices.getInstance().connection;
if (connection != null){
return (connection.getUserHash());
};
return ("");
}
}
}//package com.spilgames.api
Section 73
//a10_com_logo_108 (export_fla.a10_com_logo_108)
package export_fla {
import flash.display.*;
public dynamic class a10_com_logo_108 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 74
//girlsgogames_101 (export_fla.girlsgogames_101)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_101 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 75
//girlsgogames_102 (export_fla.girlsgogames_102)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_102 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 76
//girlsgogames_103 (export_fla.girlsgogames_103)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_103 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 77
//girlsgogames_104 (export_fla.girlsgogames_104)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_104 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 78
//girlsgogames_93 (export_fla.girlsgogames_93)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_93 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 79
//girlsgogames_94 (export_fla.girlsgogames_94)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_94 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 80
//girlsgogames_95 (export_fla.girlsgogames_95)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_95 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 81
//girlsgogames_96 (export_fla.girlsgogames_96)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_96 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 82
//girlsgogames_97 (export_fla.girlsgogames_97)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_97 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 83
//girlsgogames_98 (export_fla.girlsgogames_98)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_98 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 84
//girlsgogames_99 (export_fla.girlsgogames_99)
package export_fla {
import flash.display.*;
public dynamic class girlsgogames_99 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 85
//juegosdechicas_100 (export_fla.juegosdechicas_100)
package export_fla {
import flash.display.*;
public dynamic class juegosdechicas_100 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 86
//label_131 (export_fla.label_131)
package export_fla {
import flash.display.*;
public dynamic class label_131 extends MovieClip {
public var flag:MovieClip;
}
}//package export_fla
Section 87
//LanguageSelectPopup_130 (export_fla.LanguageSelectPopup_130)
package export_fla {
import flash.display.*;
public dynamic class LanguageSelectPopup_130 extends MovieClip {
public var l_se:MovieClip;
public var l_ar:MovieClip;
public var l_arg:MovieClip;
public var l_br:MovieClip;
public var l_cn:MovieClip;
public var l_in:MovieClip;
public var l_tr:MovieClip;
public var l_de:MovieClip;
public var l_my:MovieClip;
public var _blank:MovieClip;
public var l_es:MovieClip;
public var l_en_uk:MovieClip;
public var l_mx:MovieClip;
public var l_fr:MovieClip;
public var l_en_us:MovieClip;
public var l_pl:MovieClip;
public var l_pt:MovieClip;
public var l_ph:MovieClip;
public var l_nl:MovieClip;
public var l_id:MovieClip;
public var l_it:MovieClip;
public var l_jp:MovieClip;
public var l_ru:MovieClip;
}
}//package export_fla
Section 88
//logo_asoyun_com_79 (export_fla.logo_asoyun_com_79)
package export_fla {
import flash.display.*;
public dynamic class logo_asoyun_com_79 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 89
//logo_game_56 (export_fla.logo_game_56)
package export_fla {
import flash.display.*;
public dynamic class logo_game_56 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 90
//logo_game_com_my_80 (export_fla.logo_game_com_my_80)
package export_fla {
import flash.display.*;
public dynamic class logo_game_com_my_80 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 91
//logo_giocaregratis_it_68 (export_fla.logo_giocaregratis_it_68)
package export_fla {
import flash.display.*;
public dynamic class logo_giocaregratis_it_68 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 92
//logo_laro_com_ph_106 (export_fla.logo_laro_com_ph_106)
package export_fla {
import flash.display.*;
public dynamic class logo_laro_com_ph_106 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 93
//logo_minigry_pl_78 (export_fla.logo_minigry_pl_78)
package export_fla {
import flash.display.*;
public dynamic class logo_minigry_pl_78 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 94
//logo_my_games_co_uk_71 (export_fla.logo_my_games_co_uk_71)
package export_fla {
import flash.display.*;
public dynamic class logo_my_games_co_uk_71 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 95
//logo_oyunlar123_com_92 (export_fla.logo_oyunlar123_com_92)
package export_fla {
import flash.display.*;
public dynamic class logo_oyunlar123_com_92 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 96
//new_agame_com_53 (export_fla.new_agame_com_53)
package export_fla {
import flash.display.*;
public dynamic class new_agame_com_53 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 97
//new_clickjogos_com_66 (export_fla.new_clickjogos_com_66)
package export_fla {
import flash.display.*;
public dynamic class new_clickjogos_com_66 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 98
//new_flashgames_ru_72 (export_fla.new_flashgames_ru_72)
package export_fla {
import flash.display.*;
public dynamic class new_flashgames_ru_72 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 99
//new_game_co_in_74 (export_fla.new_game_co_in_74)
package export_fla {
import flash.display.*;
public dynamic class new_game_co_in_74 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 100
//new_games_co_id_76 (export_fla.new_games_co_id_76)
package export_fla {
import flash.display.*;
public dynamic class new_games_co_id_76 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 101
//new_jeu_fr_62 (export_fla.new_jeu_fr_62)
package export_fla {
import flash.display.*;
public dynamic class new_jeu_fr_62 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 102
//new_spel_se_69 (export_fla.new_spel_se_69)
package export_fla {
import flash.display.*;
public dynamic class new_spel_se_69 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 103
//new_spielen_com_64 (export_fla.new_spielen_com_64)
package export_fla {
import flash.display.*;
public dynamic class new_spielen_com_64 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 104
//new_zapjuegos_com_58 (export_fla.new_zapjuegos_com_58)
package export_fla {
import flash.display.*;
public dynamic class new_zapjuegos_com_58 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 105
//newagame_co_uk_110 (export_fla.newagame_co_uk_110)
package export_fla {
import flash.display.*;
public dynamic class newagame_co_uk_110 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 106
//newspel_nl_60 (export_fla.newspel_nl_60)
package export_fla {
import flash.display.*;
public dynamic class newspel_nl_60 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package export_fla
Section 107
//NextTarget_01_148 (export_fla.NextTarget_01_148)
package export_fla {
import flash.display.*;
import flash.text.*;
public dynamic class NextTarget_01_148 extends MovieClip {
public var targetNum:TextField;
}
}//package export_fla
Section 108
//PressPtopause_01_256 (export_fla.PressPtopause_01_256)
package export_fla {
import flash.display.*;
public dynamic class PressPtopause_01_256 extends MovieClip {
public var qualitySwitch:MovieClip;
public var soundSwitch:MovieClip;
public var backGame:MovieClip;
public var musicSwitch:MovieClip;
public var howToPlay:MovieClip;
public var quitGame:MovieClip;
public var __id4_:MoreGamesLogocopy;
public function PressPtopause_01_256(){
__setProp___id4__PressPtopause_01__1();
}
function __setProp___id4__PressPtopause_01__1(){
try {
__id4_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id4_.position = "button_pausedscreen_moregames";
__id4_.type = "moregames";
try {
__id4_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package export_fla
Section 109
//Timeline_231 (export_fla.Timeline_231)
package export_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Timeline_231 extends MovieClip {
public var text:TextField;
}
}//package export_fla
Section 110
//Timeline_233 (export_fla.Timeline_233)
package export_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Timeline_233 extends MovieClip {
public var text:TextField;
}
}//package export_fla
Section 111
//Timeline_235 (export_fla.Timeline_235)
package export_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Timeline_235 extends MovieClip {
public var text:TextField;
}
}//package export_fla
Section 112
//Timeline_266 (export_fla.Timeline_266)
package export_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Timeline_266 extends MovieClip {
public var score_kill:TextField;
public var __id6_:MoreGamesLogocopy2;
public var b_maker:MovieClip;
public var menu:MovieClip;
public var killCount:TextField;
public var shootFatmanCount:TextField;
public var propCount:TextField;
public var score_hitNote:TextField;
public var tryAgain:MovieClip;
public var score_shootFatman:TextField;
public var scoreNum:TextField;
public var hitNoteCount:TextField;
public var score_prop:TextField;
public function Timeline_266(){
__setProp___id6___1();
}
function __setProp___id6___1(){
try {
__id6_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id6_.position = "button_gameover_moregames";
__id6_.type = "moregames";
try {
__id6_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package export_fla
Section 113
//LivePreviewParent (fl.livepreview.LivePreviewParent)
package fl.livepreview {
import flash.display.*;
import flash.utils.*;
import flash.external.*;
public class LivePreviewParent extends MovieClip {
public var myInstance:DisplayObject;
public function LivePreviewParent(){
super();
try {
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
myInstance = getChildAt(0);
onResize(stage.width, stage.height);
if (ExternalInterface.available){
ExternalInterface.addCallback("onResize", onResize);
ExternalInterface.addCallback("onUpdate", onUpdate);
};
} catch(e) {
};
}
private function updateCollection(_arg1:Object, _arg2:String):void{
var _local3:Class;
var _local4:Class;
var _local5:Object;
var _local6:int;
var _local7:Object;
var _local8:Object;
var _local9:*;
_local3 = Class(getDefinitionByName(_arg1.collectionClass));
_local4 = Class(getDefinitionByName(_arg1.collectionItemClass));
_local5 = new (_local3);
_local6 = 0;
while (_local6 < _arg1.collectionArray.length) {
_local7 = new (_local4);
_local8 = _arg1.collectionArray[_local6];
for (_local9 in _local8) {
_local7[_local9] = _local8[_local9];
};
_local5.addItem(_local7);
_local6++;
};
myInstance[_arg2] = (_local5 as _local3);
}
public function onResize(_arg1:Number, _arg2:Number):void{
var setSizeFn:Function;
var width = _arg1;
var height = _arg2;
setSizeFn = null;
try {
setSizeFn = myInstance["setSize"];
} catch(e:Error) {
setSizeFn = null;
};
if (setSizeFn != null){
setSizeFn(width, height);
} else {
myInstance.width = width;
myInstance.height = height;
};
}
public function onUpdate(... _args):void{
var i:int;
var name:String;
var value:*;
var updateArray = _args;
i = 0;
while ((i + 1) < updateArray.length) {
try {
name = String(updateArray[i]);
value = updateArray[(i + 1)];
if ((((typeof(value) == "object")) && (value.__treatAsCollectionSpecialSauce__))){
updateCollection(value, name);
} else {
myInstance[name] = value;
};
} catch(e:Error) {
};
i = (i + 2);
};
}
}
}//package fl.livepreview
Section 114
//ArrowManage (game.ArrowManage)
package game {
import flash.display.*;
import flash.events.*;
import tools.*;
import zlong.breathxue.utils.*;
import flash.geom.*;
public class ArrowManage {
private var fatMan:MovieClip;
private var _gameMc:MovieClip;
private var _massA:Number;// = 0.5
private var fatManPoint:Point;
private var _airA:Number;// = 0.1
private var _type:String;
private var _arrowSpeedX:Number;
private var _arrowSpeedY:Number;
private var fatManRotation:Number;
private var _mc:MovieClip;
public function ArrowManage(upMc:MovieClip, initArrowX:Number, initArrowY:Number, arrowAngle:Number, type:String="arrow"):void{
super();
_type = type;
_gameMc = upMc;
if (_type == "arrow"){
_mc = Attach.getMovieClip("arrow");
} else {
if (_type == "flamingArrow"){
_mc = Attach.getMovieClip("flamingArrow");
} else {
if (_type == "explodingArrow"){
_mc = Attach.getMovieClip("explodingArrow");
_mc.gotoAndStop(1);
};
};
};
_gameMc.addChild(_mc);
_mc.rotation = arrowAngle;
_mc.x = initArrowX;
_mc.y = initArrowY;
}
public function remove():void{
_gameMc.removeChild(_mc);
_mc = null;
}
public function fatManArrow():Boolean{
var point:Point = fatMan.localToGlobal(fatManPoint);
_mc.x = point.x;
_mc.y = point.y;
_mc.rotation = (_mc.rotation + (fatMan.rotation - fatManRotation));
fatManRotation = fatMan.rotation;
if (_mc.x < -100){
remove();
return (true);
};
return (false);
}
public function moveSky():Boolean{
if (_type == "explodingArrow"){
_mc.nextFrame();
if (_mc.currentFrame == _mc.totalFrames){
_mc.gotoAndStop(2);
};
};
_mc.y = (_mc.y + _arrowSpeedY);
_mc.x = (_mc.x + _arrowSpeedX);
_mc.rotation = ((Math.atan2(_arrowSpeedY, _arrowSpeedX) * 180) / Math.PI);
_arrowSpeedY = (_arrowSpeedY + _massA);
_arrowSpeedX = (_arrowSpeedX - _airA);
if (_mc.y > 400){
_gameMc.removeChild(_mc);
return (true);
};
return (false);
}
public function setAtFatMan(fatMan:MovieClip, i:Number):void{
_gameMc = _gameMc.parent["fatmanMc"];
_gameMc.addChild(_mc);
_mc.y = (_mc.y - (-(i) * Math.sin(((_mc.rotation * Math.PI) / 180))));
_mc.x = (_mc.x - (-(i) * Math.cos(((_mc.rotation * Math.PI) / 180))));
var point:Point = new Point(_mc.x, _mc.y);
this.fatMan = fatMan;
fatManPoint = fatMan.globalToLocal(point);
fatManRotation = fatMan.rotation;
if (_type == "explodingArrow"){
_mc.gotoAndStop(1);
_mc.addEventListener("BOMB", bomb);
new GameEffect("countTime", _mc);
} else {
if (_type == "flamingArrow"){
_mc.visible = false;
new GameEffect("flame", _gameMc, _mc);
};
};
}
private function bomb(e:Event):void{
new PopupBox(_gameMc, "exploding");
_mc.removeEventListener("BOMB", bomb);
_mc.visible = false;
new GameEffect("burst", _gameMc, _mc);
SoundsManager.instance.playSound("Exploding", 1);
}
public function moveAndBow(angle:Number, x:Number, y:Number):void{
_mc.rotation = angle;
_mc.x = x;
_mc.y = y;
}
public function get mc():MovieClip{
return (_mc);
}
public function shoot(fireStrength:int=65):void{
if (_type == "arrow"){
SoundsManager.instance.playSound("shoot", 1);
} else {
if (_type == "flamingArrow"){
SoundsManager.instance.playSound("shoot_Burningarrow", 1);
} else {
if (_type == "explodingArrow"){
SoundsManager.instance.playSound("shoot_missle", 1);
};
};
};
if (_type == "explodingArrow"){
_mc.gotoAndStop(2);
};
var i:Number = ((fireStrength / 5) + 15);
_arrowSpeedY = (i * Math.sin(((_mc.rotation * Math.PI) / 180)));
_arrowSpeedX = (i * Math.cos(((_mc.rotation * Math.PI) / 180)));
}
public function get type():String{
return (_type);
}
}
}//package game
Section 115
//BackdropManage (game.BackdropManage)
package game {
import flash.display.*;
import zlong.breathxue.utils.*;
public class BackdropManage {
private var _firstBackdropSpeed:Number;
private var _secondBackdropMcOne:MovieClip;
private var _secondBackdropMcTwo:MovieClip;
private var _upMc:MovieClip;
private var _roadMcOne:MovieClip;
private var _mc:MovieClip;
private var _roadMcTwo:MovieClip;
private var _secondBackdropSpeed:Number;
public function BackdropManage(upMc:MovieClip):void{
super();
_upMc = upMc["backdropMc"];
initData();
initDis();
}
private function initData():void{
_firstBackdropSpeed = XmlManage.FIRST_BACKDROP_SPEED;
_secondBackdropSpeed = XmlManage.SECOND_BACKDROP_SPEED;
}
private function initDis():void{
_mc = new MovieClip();
_upMc.addChild(_mc);
_upMc.setChildIndex(_mc, 0);
_roadMcOne = Attach.getMovieClip("road");
_roadMcOne.cacheAsBitmap = true;
_roadMcTwo = Attach.getMovieClip("road");
_roadMcTwo.cacheAsBitmap = true;
_roadMcTwo.x = 1990;
_secondBackdropMcOne = Attach.getMovieClip("houseBackdrop");
_secondBackdropMcOne.cacheAsBitmap = true;
_secondBackdropMcTwo = Attach.getMovieClip("houseBackdrop");
_secondBackdropMcTwo.cacheAsBitmap = true;
_secondBackdropMcTwo.x = 650;
_mc.addChild(_secondBackdropMcOne);
_mc.addChild(_secondBackdropMcTwo);
_mc.addChild(_roadMcOne);
_mc.addChild(_roadMcTwo);
}
public function frameRun():void{
_secondBackdropMcOne.x = (_secondBackdropMcOne.x - _secondBackdropSpeed);
_roadMcOne.x = (_roadMcOne.x - _firstBackdropSpeed);
if (_roadMcOne.x <= -1990){
_roadMcOne.x = 1990;
};
_roadMcTwo.x = (_roadMcTwo.x - _firstBackdropSpeed);
if (_roadMcTwo.x <= -1990){
_roadMcTwo.x = 1990;
};
if (_secondBackdropMcOne.x <= -650){
_secondBackdropMcOne.x = 650;
};
_secondBackdropMcTwo.x = (_secondBackdropMcTwo.x - _secondBackdropSpeed);
if (_secondBackdropMcTwo.x <= -650){
_secondBackdropMcTwo.x = 650;
};
}
}
}//package game
Section 116
//Bag (game.Bag)
package game {
import flash.display.*;
import zlong.breathxue.utils.*;
public class Bag {
private var _massA:Number;// = 1
private var _speedX:Number;// = -10
private var _speedY:Number;// = -6
private var _hit:MovieClip;
private var _airA:Number;// = 0.1
private var _type:String;
private var _removeIf:Boolean;
private var _mc:MovieClip;
private var _howToPlayIf:Boolean;
public function Bag(upMc:MovieClip, x:Number, y:Number):void{
super();
_mc = Attach.getMovieClip("bag");
_hit = _mc["bagHit"];
_mc.x = x;
_mc.y = y;
upMc.addChild(_mc);
_type = "sky";
}
public function get removeIf():Boolean{
return (_removeIf);
}
private function del():void{
_mc.parent.removeChild(_mc);
_mc = null;
_removeIf = true;
}
public function get hit():MovieClip{
return (_hit);
}
private function landing():void{
_mc.x = (_mc.x - 5);
if (_mc.x <= -100){
del();
};
}
public function frameRun():void{
if (_type == "sky"){
sky();
} else {
if (_type == "land"){
landing();
};
};
}
private function sky():void{
var temp:MovieClip;
_mc.x = (_mc.x + _speedX);
_mc.y = (_mc.y + _speedY);
_speedX = (_speedX + _airA);
_speedY = (_speedY + _massA);
if (_mc.y >= 300){
_mc.y = 300;
_type = "land";
if (_howToPlayIf){
temp = Attach.getMovieClip("indicate");
_mc.addChild(temp);
temp.rotation = 90;
temp.x = 7;
temp.y = -100;
};
};
}
public function hitNa():void{
}
public function howToPlay():void{
_howToPlayIf = true;
}
}
}//package game
Section 117
//Bomb (game.Bomb)
package game {
import flash.display.*;
import tools.*;
import zlong.breathxue.utils.*;
public class Bomb {
private var _removeIf:Boolean;
private var _massA:Number;// = 0.5
private var _speedX:Number;
private var _speedY:Number;
private var _hit:MovieClip;
private var _mc:MovieClip;
private var _airA:Number;// = 0.1
private var _type:String;
public function Bomb(upMc:MovieClip, x:Number, y:Number){
super();
_mc = Attach.getMovieClip("bomb");
_hit = _mc["bombHit"];
_mc.gotoAndStop(1);
_mc.x = x;
_mc.y = y;
upMc.addChild(_mc);
var i:Number = ((Math.random() * 0.3) + 0.7);
_speedX = (-15 * i);
_speedY = (-11 * i);
_type = "sky";
}
private function sky():void{
_mc.x = (_mc.x + _speedX);
_mc.y = (_mc.y + _speedY);
_speedX = (_speedX + _airA);
_speedY = (_speedY + _massA);
if (_mc.y >= 300){
burst();
};
}
public function get removeIf():Boolean{
return (_removeIf);
}
public function hitNa():void{
if (_type == "sky"){
burst();
};
}
public function del():void{
_removeIf = true;
_mc.gotoAndStop(1);
_mc.parent.removeChild(_mc);
_mc = null;
}
public function burst():void{
SoundsManager.instance.playSound("Exploding", 1);
_type = "burst";
_mc.gotoAndStop(28);
}
public function get hit():MovieClip{
return (_hit);
}
public function frameRun():void{
if (_type == "sky"){
sky();
};
if (_type == "burst"){
_mc.x = (_mc.x - 5);
};
if (_mc.currentFrame == 27){
_mc.gotoAndStop(1);
};
if (_mc.currentFrame == 38){
del();
return;
};
_mc.nextFrame();
}
}
}//package game
Section 118
//Bow (game.Bow)
package game {
import flash.display.*;
import tools.*;
import zlong.breathxue.utils.*;
import flash.geom.*;
public class Bow {
private var _shootCD:int;
private var _bowAngle:Number;// = 0
private var _rapidIf:Boolean;
private var _arrow:ArrowManage;
private var _shootCDCount:int;
private var _arrowCountMc:MovieClip;
private var _bowAngleMin:Number;
private var _tumbleIf:Boolean;
private var _mc:MovieClip;
private var _bowAngleMax:Number;
private var _gameMc:MovieClip;
private var _arrowCount_max:int;
private var _fitArrowIf:Boolean;
private var _shootIf:Boolean;
private var _arrowCount_current:int;
private var _rapidIfTime:int;
private var _explodNum:int;
private var _flamNum:int;
private var _fireStrength:Number;
public function Bow(upMc:MovieClip):void{
super();
_gameMc = upMc;
_bowAngleMax = XmlManage.ARROW_ANGLE_MAX;
_bowAngleMin = XmlManage.ARROW_ANGLE_MIN;
_arrowCount_max = XmlManage.MAX_ARROW_NUM;
_arrowCount_current = _arrowCount_max;
_shootCD = XmlManage.FIRE_CD;
_fitArrowIf = true;
initDis();
}
public function getExplod():void{
var point:Point;
if (_flamNum > 0){
_flamNum = 0;
};
_explodNum = 1;
if (_arrow != null){
_arrow.remove();
point = (_mc["point"] as MovieClip).localToGlobal(new Point(0, 0));
_arrow = new ArrowManage(_gameMc.parent["napoleonMc"], point.x, point.y, _bowAngle, "explodingArrow");
};
}
public function get mc():MovieClip{
return (_mc);
}
public function moveBowAngle():void{
var point:Point = _mc.localToGlobal(new Point(22, 4));
var dx:int = (_gameMc.mouseX - point.x);
if (_gameMc.mouseX < point.x){
dx = (dx * -1);
};
var dy:int = (_gameMc.mouseY - point.y);
_bowAngle = ((Math.atan2(dy, dx) * 180) / Math.PI);
if (_bowAngle > _bowAngleMax){
_bowAngle = _bowAngleMax;
};
if (_bowAngle < _bowAngleMin){
_bowAngle = _bowAngleMin;
};
_mc.rotation = _bowAngle;
if (_arrow != null){
arrowMove();
};
}
public function shoot():void{
if (_tumbleIf){
return;
};
if (_arrowCount_current == 0){
addArrow();
};
if (_arrow == null){
return;
};
_shootCDCount = _shootCD;
if (_flamNum > 0){
_flamNum--;
if (_flamNum == 0){
_gameMc.parent.dispatchEvent(new EventProp(EventProp.PROP_OVER));
};
};
if (_explodNum > 0){
_explodNum--;
if (_explodNum == 0){
_gameMc.parent.dispatchEvent(new EventProp(EventProp.PROP_OVER));
};
};
if (_rapidIf){
_arrow.shoot(100);
} else {
_arrow.shoot(_fireStrength);
};
HitCheck.ARROWS_SKY.push(_arrow);
_shootIf = true;
_arrow = null;
_mc.gotoAndStop(101);
_arrowCount_current--;
_arrowCountMc.gotoAndStop((11 - _arrowCount_current));
}
public function resetSite(point:Point):void{
_mc.x = point.x;
_mc.y = point.y;
}
public function changeState(state:String):void{
if ((((state == "napoleon_run")) || ((state == "napoleon_jump")))){
_tumbleIf = false;
show();
} else {
if (state == "napoleon_tumble"){
_shootIf = false;
_tumbleIf = true;
hide();
_mc.gotoAndStop(1);
};
};
}
public function hide():void{
_mc.visible = false;
if (_arrow != null){
_arrow.mc.visible = false;
};
}
private function cdTime():void{
if (_shootCDCount > 0){
_shootCDCount--;
if (_shootCDCount == 0){
_fitArrowIf = true;
};
};
}
private function initDis():void{
_mc = Attach.getMovieClip("bow");
_mc.gotoAndStop(1);
_gameMc.addChild(_mc);
_arrowCountMc = _gameMc.parent["arrowNumMc"];
_arrowCountMc.gotoAndStop(1);
}
public function howToPlayKeyDown():void{
_arrowCount_current = 0;
_arrowCountMc.gotoAndStop((11 - _arrowCount_current));
if (_arrow != null){
_arrow.remove();
_arrow = null;
};
}
private function shooting():void{
if (!_shootIf){
return;
};
if (_mc.currentFrame == _mc.totalFrames){
_shootIf = false;
_mc.gotoAndStop(1);
};
_mc.nextFrame();
}
public function frameRun(point:Point):void{
if (_tumbleIf){
hide();
return;
};
cdTime();
rapidCount();
resetSite(point);
shooting();
moveBowAngle();
if (_fitArrowIf){
fitArrow();
};
}
public function drawBow():void{
if (_tumbleIf){
return;
};
if (_arrow == null){
return;
};
if (_mc.currentFrame == 100){
return;
};
_mc.gotoAndStop((_mc.currentFrame + 3));
if (_mc.currentFrame > 100){
_mc.gotoAndStop(100);
};
_fireStrength = _mc.currentFrame;
}
public function addArrow():void{
if (_tumbleIf){
return;
};
GameManage.RELOADIF = true;
_arrowCount_current = 10;
_arrowCountMc.gotoAndStop((11 - _arrowCount_current));
SoundsManager.instance.playSound("reload", 1);
}
public function getFlam():void{
var point:Point;
if (_explodNum > 0){
_explodNum = 0;
};
_flamNum = 3;
if (_arrow != null){
_arrow.remove();
point = (_mc["point"] as MovieClip).localToGlobal(new Point(0, 0));
_arrow = new ArrowManage(_gameMc.parent["napoleonMc"], point.x, point.y, _bowAngle, "flamingArrow");
};
}
private function rapidCount():void{
if (!_rapidIf){
return;
};
_rapidIfTime--;
if (_rapidIfTime == 0){
_rapidIf = false;
_gameMc.parent.dispatchEvent(new EventProp(EventProp.PROP_OVER));
};
}
public function arrowMove():void{
var point:Point = (_mc["point"] as MovieClip).localToGlobal(new Point(0, 0));
_arrow.moveAndBow(_bowAngle, point.x, point.y);
}
public function rapid():void{
_rapidIf = true;
_rapidIfTime = 150;
}
public function show():void{
_mc.visible = true;
_gameMc.setChildIndex(_mc, (_gameMc.numChildren - 1));
if (_arrow != null){
_arrow.mc.parent.setChildIndex(_arrow.mc, (_arrow.mc.parent.numChildren - 1));
_arrow.mc.visible = true;
};
}
public function fitArrow():void{
if (_arrowCount_current == 0){
return;
};
var point:Point = (_mc["point"] as MovieClip).localToGlobal(new Point(0, 0));
_fitArrowIf = false;
if (_flamNum > 0){
_arrow = new ArrowManage(_gameMc.parent["napoleonMc"], point.x, point.y, _bowAngle, "flamingArrow");
} else {
if (_explodNum > 0){
_arrow = new ArrowManage(_gameMc.parent["napoleonMc"], point.x, point.y, _bowAngle, "explodingArrow");
} else {
_arrow = new ArrowManage(_gameMc.parent["napoleonMc"], point.x, point.y, _bowAngle);
};
};
if (_mc.visible == false){
_arrow.mc.visible = false;
};
}
}
}//package game
Section 119
//Cow (game.Cow)
package game {
import flash.display.*;
import tools.*;
import zlong.breathxue.utils.*;
public class Cow {
private var _fatman:FatManManage;
private var _gameMc:MovieClip;
private var _napoleon:Napoleon;
private var _hitMc:MovieClip;
private var _mc:MovieClip;
private var _backFunc:Function;
public function Cow(gameMc:MovieClip, fatman:FatManManage, napoleon:Napoleon, backFunc:Function):void{
super();
_gameMc = gameMc;
_fatman = fatman;
_napoleon = napoleon;
_backFunc = backFunc;
initDis();
}
public function frameRun():void{
if (_mc.currentFrame == 30){
SoundsManager.instance.playSound("Dropacowfall", 1);
};
if (_mc.currentFrame == 65){
_gameMc.parent.dispatchEvent(new EventProp(EventProp.PROP_OVER));
new PopupBox(_gameMc, "cow2");
};
if (_mc.currentFrame == (_mc.totalFrames - 3)){
new PopupBox(_gameMc, "cow3");
SoundsManager.instance.playSound("Dropacowcrush", 1);
};
if (_mc.currentFrame < _mc.totalFrames){
_mc.nextFrame();
cowAndFatman();
} else {
cowAndNapoleon();
move();
};
}
private function cowAndFatman():void{
if (_fatman._fatman_live == null){
return;
};
if (_fatman._fatman_live.fatmanMc.hitTestObject(_hitMc)){
_fatman._fatman_live.hitByCow();
};
}
private function cowAndNapoleon():void{
if (_napoleon.hitMc.hitTestObject(_hitMc)){
_napoleon.hitFat();
};
}
private function move():void{
_mc.x = (_mc.x - 5);
if (_mc.x < -200){
_gameMc.removeChild(_mc);
_mc = null;
_backFunc();
};
}
private function initDis():void{
_mc = Attach.getMovieClip("cow");
_mc.gotoAndStop(1);
_hitMc = _mc["hitMc"];
_gameMc.addChild(_mc);
_mc.y = -75;
if (_fatman._fatman_live != null){
_mc.x = _fatman._fatman_live.fatmanMc.x;
} else {
_mc.x = 400;
};
}
}
}//package game
Section 120
//DanceGame (game.DanceGame)
package game {
import flash.display.*;
import flash.events.*;
import zlong.breathxue.utils.*;
public class DanceGame {
private var _gotoOverIf:Boolean;
private var _gameMc:MovieClip;
private var _girlsMc:MovieClip;
private var _noteShowTime:int;
private var _napoleonMc:MovieClip;
private var _appearNoteNum:int;
private var _musicMc:MovieClip;
private var _appearNoteCount:int;
private var _backFunc:Function;
private var _noteShowTimeNum:int;
private var _noteSpeed:Number;
private var _danceGameTime:int;
private var _danceNoteArr:Array;
public static var UNFIRST_IF:Boolean;
public static var LOSE_IF:int;
public function DanceGame(upMc:MovieClip, danceOver:Function):void{
super();
_gameMc = upMc;
_backFunc = danceOver;
initData();
initDis();
}
private function del():void{
_gameMc.removeChild(_girlsMc);
_girlsMc = null;
_gameMc.removeChild(_napoleonMc);
_napoleonMc = null;
_gameMc.removeChild(_musicMc);
_musicMc = null;
}
private function time():void{
if (_gotoOverIf){
return;
};
_danceGameTime--;
if (_danceGameTime == 0){
gotoOver();
};
}
public function gotoOver():void{
if (!UNFIRST_IF){
UNFIRST_IF = true;
};
if (LOSE_IF < 3){
_gameMc.dispatchEvent(new Event("dancePerfect"));
};
_gotoOverIf = true;
_girlsMc.gotoAndStop(40);
}
private function initData():void{
_danceNoteArr = new Array();
_danceGameTime = XmlManage.DANCE_TIME;
_noteShowTime = XmlManage.NOTE_SHOW_TIME;
_noteSpeed = -(XmlManage.NOTE_SPEED);
LOSE_IF = 0;
}
private function appearNewNote():void{
_noteShowTimeNum = 0;
_appearNoteCount = 10;
var i:Number = Math.random();
if (!UNFIRST_IF){
i = 0;
};
if (i < 0.25){
_appearNoteNum = 1;
} else {
if ((((0.25 <= i)) && ((i < 0.75)))){
_appearNoteNum = 2;
} else {
if ((((0.75 <= i)) && ((i < 1)))){
_appearNoteNum = 3;
};
};
};
}
public function initDis():void{
_napoleonMc = Attach.getMovieClip("dance");
_napoleonMc.x = 320;
_napoleonMc.y = 200;
_gameMc.addChild(_napoleonMc);
_musicMc = Attach.getMovieClip("music");
_musicMc.x = 415;
_musicMc.y = 272;
_girlsMc = Attach.getMovieClip("girls");
_girlsMc.x = 316;
_girlsMc.y = 200.4;
_girlsMc.addFrameScript((_girlsMc.totalFrames - 1), girlsStop);
_gameMc.addChild(_girlsMc);
_gameMc.addChild(_musicMc);
}
public function keyDown(keyCode:int):void{
if ((((keyCode == 87)) || ((keyCode == 38)))){
noteProper(2);
} else {
if ((((keyCode == 83)) || ((keyCode == 40)))){
noteProper(0);
} else {
if ((((keyCode == 65)) || ((keyCode == 37)))){
noteProper(1);
} else {
if ((((keyCode == 68)) || ((keyCode == 39)))){
noteProper(3);
};
};
};
};
}
private function noteProper(num:int):void{
var note:MusicalNote;
var i:int;
while (i < _danceNoteArr.length) {
note = _danceNoteArr[i];
if (note.type == "walk"){
note.judge(num);
return;
};
i++;
};
}
public function frameRun():void{
girl();
note();
time();
}
private function note():void{
var temp:MusicalNote;
var note:MusicalNote;
if (_gotoOverIf){
return;
};
if (_appearNoteNum != 0){
if (_appearNoteCount == 10){
_appearNoteCount = 0;
temp = new MusicalNote(_gameMc, _noteSpeed);
_danceNoteArr.push(temp);
_appearNoteNum--;
};
_appearNoteCount++;
} else {
_noteShowTimeNum++;
if ((((_noteShowTimeNum == _noteShowTime)) && ((_danceGameTime > 120)))){
appearNewNote();
};
};
var i:int;
while (i < _danceNoteArr.length) {
note = _danceNoteArr[i];
if (note.mc == null){
_danceNoteArr.splice(i, 1);
i--;
} else {
note.frameRun();
};
i++;
};
}
private function girl():void{
if (_gotoOverIf){
_girlsMc.gotoAndStop((_girlsMc.currentFrame - 1));
if (_girlsMc.currentFrame == 1){
del();
_backFunc();
};
return;
};
}
public function girlsStop():void{
_girlsMc.stop();
}
}
}//package game
Section 121
//EventProp (game.EventProp)
package game {
import flash.events.*;
public class EventProp extends Event {
public var propName:String;
public static const SET_PROP:String = "SET_PROP";
public static const PROP_OVER:String = "PROP_OVER";
public function EventProp(type:String, propName:String=null){
super(type);
this.propName = propName;
}
}
}//package game
Section 122
//EventScore (game.EventScore)
package game {
import flash.events.*;
public class EventScore extends Event {
public var _state:String;
public var _score:int;
public static const SCORE_ADD:String = "SCORE_ADD";
public function EventScore(type:String, state:String, num:int){
super(type);
_score = num;
_state = state;
}
}
}//package game
Section 123
//Fatman (game.Fatman)
package game {
import flash.display.*;
import flash.events.*;
import tools.*;
import zlong.breathxue.utils.*;
import flash.geom.*;
public class Fatman {
private var _speed_current:Number;
private var _deadHitMc:MovieClip;
private var _fatmanX_rightRange:Number;
public var shootedNum1:int;
public var shootedNum2:int;
private var _fatmanX_leftRange:Number;
private var _stepSoundTime:int;
private var _fatmanMcX:Number;
private var _fatmanMcY:Number;
private var _appear:Boolean;
private var _danceIf:Boolean;
private var _hurt_speed:Number;
private var _speed_normal:Number;// = 5
private var _deadIf:Boolean;
private var _gameMc:MovieClip;
private var _atkTime:int;
private var _site_appear:Number;
private var _action:FatmanAction;
private var _atkIf:Boolean;
private var _life:int;// = 100
private var _hurt_move_time:int;
private var _howToPlayAtkIf:Boolean;
private var _fatmanMc:MovieClip;
private var _move_time:int;
private var _howToPlayIf:Boolean;
public function Fatman(upMc:MovieClip, arr:Array){
super();
_gameMc = upMc;
initData();
initDis();
setAppearSite();
setMoveSpeed();
_action = new FatmanAction(_gameMc, _fatmanMc, arr);
}
public function get deadHitMc():MovieClip{
return (_deadHitMc);
}
public function deadRun():Boolean{
_fatmanMc.x = (_fatmanMc.x - 5);
if (_danceIf){
if (_fatmanMc.x <= 330){
_fatmanMc.x = 330;
_danceIf = false;
_gameMc.parent.dispatchEvent(new Event(GameManage.DANCE_BEGIN));
};
};
if (_fatmanMc.x < -400){
_gameMc.removeChild(_fatmanMc);
_fatmanMc = null;
return (true);
};
return (false);
}
public function get fatmanMc():MovieClip{
return (_fatmanMc);
}
private function atk():void{
var temp:*;
var i:Number;
if (((_howToPlayIf) && (!(_howToPlayAtkIf)))){
return;
};
if (_deadIf){
return;
};
_atkIf = false;
setAtkTime();
_action.action_throwRubbish();
if (_howToPlayAtkIf){
temp = new Bag(_gameMc, (_fatmanMc.x + 25.3), (_fatmanMc.y - 66));
temp.howToPlay();
} else {
i = Math.random();
if (i < 0.5){
temp = new Bomb(_gameMc, (_fatmanMc.x + 25.3), (_fatmanMc.y - 66));
} else {
temp = new Bag(_gameMc, (_fatmanMc.x + 25.3), (_fatmanMc.y - 66));
};
};
HitCheck.BOMB.push(temp);
SoundsManager.instance.playSound("fat_strikeback", 1);
}
public function leftFootHarm(type:String):void{
if (_deadIf){
return;
};
setHurtSpeed(60, -0.4);
_gameMc.parent.dispatchEvent(new EventScore(EventScore.SCORE_ADD, "shootFatman", 20));
loseLife(15, type);
_action.action_leftFootHarm();
}
public function loseLife(loseNum:int, type:String):void{
if (type == "flamingArrow"){
loseNum = (loseNum + 5);
} else {
if (type == "explodingArrow"){
loseNum = (loseNum + 15);
};
};
new PopupData("loseLife", (_gameMc.parent as MovieClip), loseNum, new Point(_fatmanMc.x, (_fatmanMc.y - 200)));
if (_howToPlayIf){
return;
};
_life = (_life - loseNum);
if (_life <= 0){
dead();
};
}
private function moveFunc():void{
if (_deadIf){
return;
};
if (_appear){
move(-10);
if (_fatmanMcX <= _site_appear){
SoundsManager.instance.playSound(String(("Cryoffear" + int(((Math.random() * 2) + 1)))), 1);
SoundsManager.instance.playSound(String(("NVO" + int(((Math.random() * 2) + 1)))), 1);
_appear = false;
setAtkTime();
};
return;
};
if (_hurt_move_time > 0){
_hurt_move_time--;
move((_hurt_speed - _speed_normal));
return;
};
move((_speed_current - _speed_normal));
_move_time--;
if (_move_time == 0){
setMoveSpeed();
};
}
private function setHurtSpeed(time:int, num:Number):void{
_hurt_move_time = time;
_hurt_speed = (_speed_normal * (1 + num));
}
public function dance():void{
_danceIf = true;
}
private function setMoveSpeed():void{
_speed_current = ((Math.random() * (9 - 2)) + 2);
_move_time = ((Math.random() * (50 - 10)) + 10);
}
public function howToPlay():void{
_howToPlayIf = true;
}
private function setAtkTime():void{
_atkTime = ((Math.random() * (151 - 120)) + 120);
}
public function move(num:Number):void{
_fatmanMcX = (_fatmanMcX + num);
if (((!(_appear)) && (!(_deadIf)))){
if (_fatmanMcX < _fatmanX_leftRange){
_fatmanMcX = _fatmanX_leftRange;
};
if (_fatmanMcX > _fatmanX_rightRange){
_fatmanMcX = _fatmanX_rightRange;
};
};
_fatmanMc.x = _fatmanMcX;
}
private function atkRun():void{
if (_atkTime > 0){
_atkTime--;
if (_atkTime == 0){
_atkIf = true;
};
};
}
public function howToPlayAtk():void{
_life = 100000;
_howToPlayAtkIf = true;
}
private function initData():void{
_appear = true;
}
public function howToPlayAtkOver():void{
_howToPlayAtkIf = false;
}
private function initDis():void{
_fatmanMc = Attach.getMovieClip("fatamanAction");
_fatmanMc.cacheAsBitmap = true;
_fatmanMcX = XmlManage.FAT_MANX;
_fatmanMcY = XmlManage.FAT_MANY;
_fatmanX_rightRange = XmlManage.FAT_MAN_MAX_X;
_fatmanX_leftRange = XmlManage.FAT_MAN_MIN_X;
_fatmanMc.x = _fatmanMcX;
_fatmanMc.y = _fatmanMcY;
_gameMc.addChild(_fatmanMc);
_deadHitMc = _fatmanMc["deadFatMan"];
}
public function rightFootHarm(type:String):void{
if (_deadIf){
return;
};
setHurtSpeed(60, -0.4);
_gameMc.parent.dispatchEvent(new EventScore(EventScore.SCORE_ADD, "shootFatman", 20));
loseLife(15, type);
_action.action_rightFootHarm();
}
public function hitByCow():void{
if (_deadIf){
return;
};
dead();
}
public function dead():void{
_deadIf = true;
_action.action_dead();
SoundsManager.instance.playSound(String(("fat_die" + int(((Math.random() * 2) + 1)))), 1);
}
public function frameRun():void{
if (!_deadIf){
if (!_stepSoundTime){
_stepSoundTime = 90;
};
_stepSoundTime--;
};
moveFunc();
atkRun();
_action.frameRun();
if (_atkIf){
atk();
};
if (_deadIf){
move(-5);
};
}
public function armHarm(type:String):void{
if (_deadIf){
return;
};
_gameMc.parent.dispatchEvent(new EventScore(EventScore.SCORE_ADD, "shootFatman", 30));
loseLife(10, type);
_action.action_armHarm();
}
public function headHarm(type:String):void{
if (_deadIf){
return;
};
setHurtSpeed(60, -0.2);
_gameMc.parent.dispatchEvent(new EventScore(EventScore.SCORE_ADD, "shootFatman", 50));
loseLife(25, type);
_action.action_headHarm();
}
public function backHarm(type:String):void{
if (_deadIf){
return;
};
setHurtSpeed(60, 0.2);
_gameMc.parent.dispatchEvent(new EventScore(EventScore.SCORE_ADD, "shootFatman", 40));
loseLife(15, type);
_action.action_bodyHarm();
}
private function setAppearSite():void{
_site_appear = ((Math.random() * (600 - 450)) + 450);
}
}
}//package game
Section 124
//FatmanAction (game.FatmanAction)
package game {
import flash.display.*;
import flash.events.*;
public class FatmanAction {
private const HEAD_HARM_S:int = 170;
private const THROW_RUBBISH_F:int = 69;
private const BACK_HARM_F:int = 95;
private const THROW_RUBBISH_S:int = 47;
private const ARM_HARM:String = "ARM_HARM";
private const ARM_HARM_F:int = 129;
private const BACK_HARM_S:int = 70;
private const FOOT_HARM_RIGHT_F:int = 149;
private const DEAD_F:int = 209;
private const ARM_HARM_S:int = 107;
private const FOOT_HARM_RIGHT_S:int = 130;
private const DEAD_S:int = 190;
private const THROW_RUBBISH:String = "THROW_RUBBISH";
private const BACK_HARM:String = "BACK_HARM";
private const FOOT_HARM_LEFT:String = "FOOT_HARM_LEFT";
private const FOOT_HARM_RIGHT:String = "FOOT_HARM_RIGHT";
private const FOOT_HARM_LEFT_F:int = 169;
private const DEAD:String = "DEAD";
private const RUN:String = "RUN";
private const HEAD_HARM:String = "HEAD_HARM";
private const FOOT_HARM_LEFT_S:int = 150;
private const RUN_F:int = 23;
private const HEAD_HARM_F:int = 189;
private const RUN_S:int = 1;
private var _headMc:MovieClip;
private var _bumpDetect_arr:Array;
private var _actionState:String;
private var _gameMc:MovieClip;
private var _fatmanMc:MovieClip;
public function FatmanAction(gameMc:MovieClip, fatmanMc:MovieClip, arr:Array):void{
super();
_gameMc = gameMc;
_fatmanMc = fatmanMc;
_bumpDetect_arr = arr;
initDis();
action_run();
}
public function action_run():void{
_actionState = RUN;
_fatmanMc.gotoAndStop(RUN_S);
_headMc.gotoAndStop(1);
}
public function action_throwRubbish():void{
if (_actionState == DEAD){
return;
};
_actionState = THROW_RUBBISH;
_fatmanMc.gotoAndStop(THROW_RUBBISH_S);
}
public function action_headHarm():void{
if (_actionState == RUN){
_actionState = HEAD_HARM;
_fatmanMc.gotoAndStop(HEAD_HARM_S);
_headMc.gotoAndStop(2);
};
}
public function action_bodyHarm():void{
if (_actionState == RUN){
_actionState = BACK_HARM;
_fatmanMc.gotoAndStop(BACK_HARM_S);
_headMc.gotoAndStop(2);
};
}
public function action_leftFootHarm():void{
if (_actionState == RUN){
_actionState = FOOT_HARM_LEFT;
_fatmanMc.gotoAndStop(FOOT_HARM_LEFT_S);
_headMc.gotoAndStop(2);
};
}
public function action_dead():void{
_actionState = DEAD;
_fatmanMc.gotoAndStop(DEAD_S);
_headMc.gotoAndStop(3);
}
private function initDis():void{
_bumpDetect_arr[0] = _fatmanMc["rightArm"];
_bumpDetect_arr[1] = _fatmanMc["head"];
_headMc = _fatmanMc["head"];
_headMc.gotoAndStop(1);
_bumpDetect_arr[2] = _fatmanMc["body"];
_bumpDetect_arr[3] = _fatmanMc["rightThigh"];
_bumpDetect_arr[4] = _fatmanMc["rightCrus"];
_bumpDetect_arr[5] = _fatmanMc["rightFoot"];
_bumpDetect_arr[6] = _fatmanMc["leftThigh"];
_bumpDetect_arr[7] = _fatmanMc["leftCrus"];
_bumpDetect_arr[8] = _fatmanMc["leftFoot"];
var i:int = ((Math.random() * 3) + 1);
(_fatmanMc["body"] as MovieClip).gotoAndStop(i);
}
public function action_armHarm():void{
if (_actionState == RUN){
_actionState = ARM_HARM;
_fatmanMc.gotoAndStop(ARM_HARM_S);
_headMc.gotoAndStop(2);
};
}
public function frameRun():void{
var i:int = _fatmanMc.currentFrame;
if ((((((((((((((i == RUN_F)) || ((i == THROW_RUBBISH_F)))) || ((i == HEAD_HARM_F)))) || ((i == BACK_HARM_F)))) || ((i == ARM_HARM_F)))) || ((i == FOOT_HARM_RIGHT_F)))) || ((i == FOOT_HARM_LEFT_F)))){
action_run();
};
if (i == DEAD_F){
_gameMc.parent.dispatchEvent(new Event(GameManage.FAT_MAN_DEAD));
};
_fatmanMc.nextFrame();
}
public function action_rightFootHarm():void{
if (_actionState == RUN){
_actionState = FOOT_HARM_RIGHT;
_fatmanMc.gotoAndStop(FOOT_HARM_RIGHT_S);
_headMc.gotoAndStop(2);
};
}
}
}//package game
Section 125
//FatManManage (game.FatManManage)
package game {
import flash.display.*;
import tools.*;
import flash.geom.*;
public class FatManManage {
private var _howToPlayIf:Boolean;
private var _gameMc:MovieClip;
private var _place:int;
private var fatman_live:Fatman;
private var _hitDetectArr:Array;
private var _num:int;
private var arrowfatman_live:Array;
private var _napoleon:Napoleon;
private var _appearCd:int;
private var _arrowArr:Array;
private var _danceIf:Boolean;
private var _bombType:String;
private var fatman_deadArr:Array;
public function FatManManage(upMc:MovieClip, napo:Napoleon):void{
arrowfatman_live = [];
fatman_deadArr = [];
super();
_napoleon = napo;
_gameMc = upMc;
_arrowArr = HitCheck.ARROWS_SKY;
_hitDetectArr = new Array();
}
private function arrowMove():void{
var i:int;
while (i < arrowfatman_live.length) {
if ((arrowfatman_live[i] as ArrowManage).fatManArrow()){
arrowfatman_live.splice(i, 1);
i--;
};
i++;
};
}
public function fatManDead():void{
_hitDetectArr = [];
fatman_deadArr.push(fatman_live);
fatman_live = null;
_appearCd = 30;
}
public function howToPlay():void{
_howToPlayIf = true;
}
public function dance():void{
_danceIf = true;
(fatman_deadArr[(fatman_deadArr.length - 1)] as Fatman).dance();
}
public function howToPlayAtkOver():void{
if (fatman_live != null){
fatman_live.howToPlayAtkOver();
};
}
public function deadManRun():void{
if (fatman_deadArr.length == 0){
return;
};
var i:int;
while (i < fatman_deadArr.length) {
if (_napoleon.hitMc.hitTestObject((fatman_deadArr[i] as Fatman).deadHitMc)){
_napoleon.hitFat();
};
if ((fatman_deadArr[i] as Fatman).deadRun()){
fatman_deadArr.splice(i, 1);
i--;
};
i++;
};
}
public function appearFatman():void{
fatman_live = new Fatman(_gameMc, _hitDetectArr);
if (_howToPlayIf){
fatman_live.howToPlay();
};
}
public function bruise(bruisePlace:int, type:String):void{
fatman_live.shootedNum1++;
if (fatman_live.shootedNum1 == 3){
SoundsManager.instance.playSound("napoleonstupid_fvo", 1);
fatman_live.shootedNum1 = 0;
};
fatman_live.shootedNum2++;
if (fatman_live.shootedNum2 == 2){
SoundsManager.instance.playSound(String(("napoleon_laugh" + int(((Math.random() * 4) + 1)))), 1);
fatman_live.shootedNum2 = 0;
};
SoundsManager.instance.playSound("Hitinbody", 1);
if (type == "flamingArrow"){
SoundsManager.instance.playSound("fat_fireauch", 1);
new PopupBox(_gameMc, "flaming");
} else {
if (type == "explodingArrow"){
_num = 43;
_place = bruisePlace;
_bombType = type;
return;
};
SoundsManager.instance.playSound(String(("fat_auch" + int(((Math.random() * 5) + 1)))), 1);
};
if (bruisePlace == 0){
fatman_live.armHarm(type);
} else {
if (bruisePlace == 1){
fatman_live.headHarm(type);
} else {
if (bruisePlace == 2){
fatman_live.backHarm(type);
} else {
if ((((bruisePlace >= 3)) && ((bruisePlace <= 5)))){
fatman_live.rightFootHarm(type);
} else {
if (bruisePlace >= 5){
fatman_live.leftFootHarm(type);
};
};
};
};
};
}
public function howToPlayAtk():void{
if (fatman_live != null){
fatman_live.howToPlayAtk();
};
}
public function get _fatman_live():Fatman{
return (fatman_live);
}
public function frameRun():void{
bomb();
cdRun();
deadManRun();
if (fatman_live != null){
fatman_live.frameRun();
};
shootFatman();
arrowMove();
}
public function shootFatman():void{
var j:int;
var m:int;
var point:Point;
if ((((_arrowArr.length == 0)) || ((_hitDetectArr.length == 0)))){
return;
};
var i:int;
while (i < _hitDetectArr.length) {
j = 0;
while (j < _arrowArr.length) {
m = -30;
while (m <= 0) {
point = (_arrowArr[j] as ArrowManage).mc.localToGlobal(new Point(m, 0));
if (_hitDetectArr[i].hitTestPoint(point.x, point.y, true)){
_arrowArr[j].setAtFatMan(_hitDetectArr[i], m);
arrowfatman_live.push(_arrowArr[j]);
bruise(i, _arrowArr[j].type);
_arrowArr.splice(j, 1);
return;
};
m = (m + 5);
};
j++;
};
i++;
};
}
public function danceOver():void{
_danceIf = false;
}
private function cdRun():void{
if (_danceIf){
return;
};
if (_appearCd > 0){
_appearCd--;
if (_appearCd == 0){
appearFatman();
};
};
}
private function bomb():void{
if (_num > 0){
_num--;
if (_num == 0){
if (fatman_live == null){
return;
};
if (_place == 0){
fatman_live.armHarm(_bombType);
} else {
if (_place == 1){
fatman_live.headHarm(_bombType);
} else {
if (_place == 2){
fatman_live.backHarm(_bombType);
} else {
if ((((_place >= 3)) && ((_place <= 5)))){
fatman_live.rightFootHarm(_bombType);
} else {
if (_place >= 5){
fatman_live.leftFootHarm(_bombType);
};
};
};
};
};
};
};
}
}
}//package game
Section 126
//GameEffect (game.GameEffect)
package game {
import flash.display.*;
import flash.events.*;
import tools.*;
import zlong.breathxue.utils.*;
public class GameEffect {
private var _mc:MovieClip;
private var _arrow:MovieClip;
public function GameEffect(type:String, upMc:MovieClip, arrow:MovieClip=null):void{
super();
_mc = Attach.getMovieClip(type);
_arrow = arrow;
upMc.addChild(_mc);
if (_arrow == null){
_mc.x = -4;
_mc.y = 0;
} else {
_mc.x = arrow.x;
_mc.y = arrow.y;
};
_mc.addFrameScript((_mc.totalFrames - 1), remove);
_mc.addEventListener(Event.ENTER_FRAME, frameRun);
}
private function remove():void{
if (_arrow == null){
_mc.parent.dispatchEvent(new Event("BOMB"));
};
_mc.removeEventListener(Event.ENTER_FRAME, frameRun);
_mc.parent.removeChild(_mc);
_mc.gotoAndStop(1);
//unresolved jump
var _slot1 = e;
}
private function frameRun(event:Event):void{
if (_arrow == null){
if ((((((_mc.currentFrame == 5)) || ((_mc.currentFrame == 19)))) || ((_mc.currentFrame == 34)))){
SoundsManager.instance.playSound("bombCountdown", 1);
};
return;
};
_mc.x = _arrow.x;
_mc.y = _arrow.y;
}
}
}//package game
Section 127
//GameManage (game.GameManage)
package game {
import flash.display.*;
import flash.events.*;
import zlong.spilSystemTool.*;
import tools.*;
import flash.geom.*;
import flash.text.*;
import ui.*;
public class GameManage {
private var _danceGameIf:Boolean;
private var _playerManage:Napoleon;
private var _timeNumText:TextField;
private var _killNum:int;
private var scoreNum:int;
private var _hitDetect:HitCheck;
private var _rightMove:Boolean;
private var _stayType:String;
private var _fatManManage:FatManManage;
private var _cowIf:Boolean;
private var _shootPropCount:int;
private var _shootFatmanCount:int;
private var _timeManage:TimeManage;
private var _stayTime:int;
private var _mc:MovieClip;
private var _scoreNumText:TextField;
private var _root:Sprite;
private var _napoleonJumpIf:Boolean;
private var score_dance:int;
private var _propManage:GameProp;
private var _hitNoteCount:int;
private var _danceGameManage:DanceGame;
private var _cow:Cow;
private var _killNumText:TextField;
private var score_kill:int;
private var _mouseDown:Boolean;
private var score_prop:int;
private var score_shootFatman:int;
private var _danceKillNum:int;
private var _pause:Boolean;
private var _leftMove:Boolean;
private var _backdropManage:BackdropManage;
private var _danceNeedKillNum:int;// = 3
public static const DANCE_BEGIN:String = "DANCE_BEGIN";
public static const FAT_MAN_DEAD:String = "FAT_MAN_DEAD";
public static var RELOADIF:Boolean;
public static var danceMusicIf:Boolean;
public function GameManage(root:Sprite, mc:MovieClip):void{
super();
RELOADIF = false;
DanceGame.UNFIRST_IF = false;
_root = root;
_mc = mc;
initDis();
_hitDetect = new HitCheck();
_timeManage = new TimeManage(_timeNumText, TimeManage.COUNT_DOWN, 120, gameOver);
_backdropManage = new BackdropManage(_mc);
_playerManage = new Napoleon(_mc["napoleonMc"]);
_fatManManage = new FatManManage(_mc["fatmanMc"], _playerManage);
_propManage = new GameProp(_mc);
initEvent();
gameBegin();
SoundsManager.instance.playMusic("关卡");
}
private function propOver(event:EventProp):void{
_propManage.propOver();
}
private function pauseGame():void{
if (!_pause){
_pause = true;
};
new PauseUI(_root);
}
private function playerOperation():void{
if (_mouseDown == true){
_playerManage.drawBow();
};
if (_leftMove == true){
_playerManage.move(-6);
};
if ((((_rightMove == true)) && ((_leftMove == false)))){
_playerManage.move(6);
};
if (_napoleonJumpIf == true){
_napoleonJumpIf = false;
_playerManage.jump();
};
}
private function keyUpHandler(event:KeyboardEvent):void{
if ((((event.keyCode == 65)) || ((event.keyCode == 37)))){
_leftMove = false;
} else {
if ((((event.keyCode == 68)) || ((event.keyCode == 39)))){
_rightMove = false;
} else {
if ((((event.keyCode == 87)) || ((event.keyCode == 38)))){
_napoleonJumpIf = false;
} else {
if ((((event.keyCode == 83)) || ((event.keyCode == 40)))){
if (!_danceGameIf){
_playerManage.addArrow();
};
};
};
};
};
}
private function useProp():void{
if (_cowIf){
_cowIf = false;
_cow = new Cow(_mc["napoleonMc"], _fatManManage, _playerManage, cowOver);
};
}
private function addScore(event:EventScore):void{
if ((((event._state == "hitNote")) || ((event._state == "dancePerfect")))){
new PopupData("addScore", _mc, event._score, new Point(325, 100), true);
} else {
new PopupData("addScore", _mc, event._score, new Point(100, 50));
};
if (event._state == "kill"){
_killNum++;
_killNumText.text = String(_killNum);
score_kill = (score_kill + event._score);
} else {
if (event._state == "shootProp"){
_shootPropCount++;
score_prop = (score_prop + event._score);
} else {
if (event._state == "shootFatman"){
_shootFatmanCount++;
score_shootFatman = (score_shootFatman + event._score);
} else {
if (event._state == "hitNote"){
_hitNoteCount++;
score_dance = (score_dance + event._score);
} else {
if (event._state == "dancePerfect"){
score_dance = (score_dance + event._score);
};
};
};
};
};
scoreNum = (scoreNum + event._score);
_scoreNumText.text = String(scoreNum);
}
private function mouseUp(event:MouseEvent):void{
if ((((((_pause == true)) || ((_mouseDown == false)))) || (_danceGameIf))){
return;
};
_mouseDown = false;
useProp();
_playerManage.shooting();
}
private function finishAward(awardNum:int):void{
if (!Cookie.instance.playerAwards["awards"][(awardNum - 1)]){
SoundsManager.instance.playSound("achievement", 1);
Cookie.instance.playerAwards["awards"][(awardNum - 1)] = true;
Award_HighScore.instance.submitAchievement(String(("award" + awardNum)));
finishAllAwardsIf();
};
}
private function initEvent():void{
_mc.addEventListener(GameManage.DANCE_BEGIN, danceBegin);
_mc.addEventListener(Event.ENTER_FRAME, frameRun);
_mc.addEventListener(FAT_MAN_DEAD, onFatManDead);
_mc.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_mc.stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
_mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
_mc.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
_mc.addEventListener(EventScore.SCORE_ADD, addScore);
_mc.addEventListener(EventProp.SET_PROP, getProp);
_mc.addEventListener(EventProp.PROP_OVER, propOver);
_mc.addEventListener("dancePerfect", addDanceTime);
_mc.addEventListener(Event.DEACTIVATE, losePlayer);
_mc.stage.focus = _mc;
}
private function danceOver():void{
_danceGameIf = false;
_danceGameManage = null;
_fatManManage.danceOver();
_playerManage.danceOver();
popTargetBox();
danceMusicIf = false;
SoundsManager.instance.playMusic("关卡");
}
private function popTargetBox():void{
new TargetBox(_mc, _danceNeedKillNum, removeTargetBox);
}
private function finishAllAwardsIf():void{
var i:int;
var arr:Array = Cookie.instance.playerAwards["awards"];
while (i < arr.length) {
if (!arr){
return;
};
i++;
};
GoogleEvent.instance.gaTrackEvent("Unlocked_all_achievements", true);
}
public function delEvent():void{
_mc.removeEventListener(GameManage.DANCE_BEGIN, danceBegin);
_mc.removeEventListener(Event.ENTER_FRAME, frameRun);
_mc.addEventListener(FAT_MAN_DEAD, onFatManDead);
_mc.stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_mc.stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
_mc.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
_mc.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
_mc.removeEventListener(EventScore.SCORE_ADD, addScore);
_mc.removeEventListener(EventProp.SET_PROP, getProp);
_mc.removeEventListener(EventProp.PROP_OVER, propOver);
_mc.removeEventListener("dancePerfect", addDanceTime);
_mc.removeEventListener(Event.DEACTIVATE, losePlayer);
}
private function danceBegin(event:Event):void{
_danceKillNum = 0;
_danceNeedKillNum++;
_playerManage.dance(danceGame);
_danceGameIf = true;
}
private function addDanceTime(event:Event):void{
_timeManage.addTime(10);
new PopupData("addTime", _mc, 10, new Point(315, 72));
}
private function onFatManDead(event:Event):void{
SoundsManager.instance.playSound(String(("napoleon_laugh" + int(((Math.random() * 2) + 5)))), 1);
SoundsManager.instance.playSound("horn_Fatguykill", 1);
_mc.dispatchEvent(new EventScore(EventScore.SCORE_ADD, "kill", 200));
_danceKillNum++;
_fatManManage.fatManDead();
if (_danceKillNum == _danceNeedKillNum){
_fatManManage.dance();
new PopupBox(_mc, "dance");
};
new PopupBox(_mc, "dead");
awards();
}
private function danceGame():void{
_danceGameManage = new DanceGame(_mc, danceOver);
SoundsManager.instance.playMusic("跳舞");
danceMusicIf = true;
}
private function awards():void{
if (_killNum == 1){
finishAward(1);
} else {
if ((((_killNum == 2)) && (!(RELOADIF)))){
finishAward(3);
} else {
if (_killNum == 3){
finishAward(2);
} else {
if (_killNum == 30){
finishAward(5);
} else {
if (_killNum == 40){
finishAward(4);
};
};
};
};
};
}
private function gameFlow():void{
if (_stayType == "begin"){
_stayTime--;
if (_stayTime == 0){
_stayType = null;
popTargetBox();
return;
};
};
}
private function gameBegin():void{
_stayType = "begin";
_stayTime = XmlManage.BEGIN_STAY_TIME;
}
private function getProp(event:EventProp):void{
if (event.propName == "flamingArrow"){
_playerManage.getFlam();
} else {
if (event.propName == "explodingArrow"){
_playerManage.getExplod();
} else {
if (event.propName == "addTime"){
_timeManage.addTime(5);
new PopupData("addTime", _mc, 5, new Point(315, 72));
} else {
if (event.propName == "rapidArrow"){
_playerManage.rapid();
} else {
if (event.propName == "cow"){
_cowIf = true;
};
};
};
};
};
}
private function initDis():void{
_timeNumText = _mc["timeNum"];
_timeNumText.selectable = false;
_killNumText = _mc["killNum"];
_killNumText.selectable = false;
_killNumText.text = String(_killNum);
_scoreNumText = _mc["scoreNum"];
_scoreNumText.selectable = false;
}
private function removeTargetBox():void{
if (_danceNeedKillNum == 3){
_fatManManage.appearFatman();
};
}
private function mouseDown(event:MouseEvent):void{
if ((((_pause == true)) || (_danceGameIf))){
return;
};
_mouseDown = true;
}
private function keyDownHandler(event:KeyboardEvent):void{
if (_pause){
return;
};
if (event.keyCode == 80){
pauseGame();
};
if (_danceGameIf){
if (_danceGameManage != null){
_danceGameManage.keyDown(event.keyCode);
};
return;
};
if ((((event.keyCode == 65)) || ((event.keyCode == 37)))){
_leftMove = true;
} else {
if ((((event.keyCode == 68)) || ((event.keyCode == 39)))){
_rightMove = true;
} else {
if ((((event.keyCode == 87)) || ((event.keyCode == 38)))){
_napoleonJumpIf = true;
};
};
};
}
private function frameRun(event:Event):void{
_mc.stage.focus = _mc;
if (_pause){
return;
};
if (_danceGameIf){
if (_danceGameManage != null){
_danceGameManage.frameRun();
};
_playerManage.frameRun();
return;
};
gameFlow();
playerOperation();
_hitDetect.frameRun();
_timeManage.frameRun();
_backdropManage.frameRun();
_playerManage.frameRun();
_fatManManage.frameRun();
_propManage.frameRun();
if (_cow != null){
_cow.frameRun();
};
}
public function pauseOver():void{
_pause = false;
}
private function gameOver():void{
_pause = true;
new TimeUpUI(_root, scoreNum, _killNum, score_kill, _shootFatmanCount, score_shootFatman, _shootPropCount, score_prop, _hitNoteCount, score_dance);
SoundsManager.instance.playSound("whist_timeup", 1);
}
private function losePlayer(event:Event):void{
_leftMove = false;
_rightMove = false;
if (!_pause){
pauseGame();
};
}
private function cowOver():void{
if (_cow != null){
_cow = null;
};
}
}
}//package game
Section 128
//GameProp (game.GameProp)
package game {
import flash.display.*;
import tools.*;
import zlong.breathxue.utils.*;
public class GameProp {
private var _howToPlayShootProp:Boolean;
private var _getPropName:String;
private var _timeLag:int;
private var _gameMc:MovieClip;
private var _propRollMc:MovieClip;
private var _timeLagMax:int;
private var _propRollTime:int;
private var _timeLagMin:int;
private var _arrowArr:Array;
private var _howToPlayIf:Boolean;
private var _propSky:MovieClip;
public function GameProp(upMc:MovieClip):void{
super();
_arrowArr = HitCheck.ARROWS_SKY;
_gameMc = upMc;
initData();
}
private function propRoll():void{
var i:Number;
if (_propRollTime == 0){
return;
};
_propRollMc.nextFrame();
if (_propRollMc.currentFrame == _propRollMc.totalFrames){
_propRollMc.gotoAndStop(1);
};
_propRollTime--;
if (_propRollTime == 0){
if (_howToPlayIf){
_getPropName = "flamingArrow";
_propRollMc.gotoAndStop(20);
_gameMc.dispatchEvent(new EventProp(EventProp.SET_PROP, _getPropName));
return;
};
i = Math.random();
if (i <= 0.3){
_getPropName = "addTime";
_propRollMc.gotoAndStop(1);
} else {
if ((((0.3 < i)) && ((i <= 0.55)))){
_getPropName = "rapidArrow";
_propRollMc.gotoAndStop(39);
} else {
if ((((0.55 < i)) && ((i <= 0.75)))){
_getPropName = "flamingArrow";
_propRollMc.gotoAndStop(20);
} else {
if ((((0.75 < i)) && ((i <= 0.9)))){
_getPropName = "explodingArrow";
_propRollMc.gotoAndStop(10);
} else {
if ((((0.9 < i)) && ((i < 1)))){
_getPropName = "cow";
_propRollMc.gotoAndStop(30);
};
};
};
};
};
_gameMc.dispatchEvent(new EventProp(EventProp.SET_PROP, _getPropName));
};
}
private function propSky():void{
if (_propSky == null){
return;
};
_propSky.nextFrame();
if (_propSky.currentFrame == 62){
_propSky.gotoAndStop(1);
};
if (_propSky.currentFrame == 79){
_gameMc.removeChild(_propSky);
_propSky = null;
return;
};
_propSky.x = (_propSky.x - XmlManage.FIRST_BACKDROP_SPEED);
if (_propSky.x < -100){
_gameMc.removeChild(_propSky);
_propSky = null;
};
}
private function hit():void{
if ((((_propSky == null)) || ((_propSky.currentFrame >= 63)))){
return;
};
var i:int;
while (i < _arrowArr.length) {
if (_propSky.hitTestObject(_arrowArr[i].mc)){
shootProp();
};
i++;
};
}
public function propOver():void{
_gameMc.removeChild(_propRollMc);
_getPropName = null;
_propRollMc = null;
}
private function appearProp():void{
var _indicateMc:MovieClip;
var explainText:MovieClip;
if (_propRollMc != null){
return;
};
_timeLag--;
if (_timeLag == 0){
if (_propSky != null){
_gameMc.removeChild(_propSky);
_propSky = null;
};
_propSky = Attach.getMovieClip("prop");
if (_howToPlayIf){
_indicateMc = Attach.getMovieClip("indicate");
explainText = Attach.getMovieClip("shootProp");
_propSky.addChild(explainText);
explainText.x = -260;
explainText.y = -30;
_propSky.addChild(_indicateMc);
_indicateMc.x = -90;
};
_propSky.gotoAndStop(1);
_propSky.x = 650;
_propSky.y = 100;
_gameMc.addChild(_propSky);
_timeLag = ((Math.random() * ((_timeLagMax - _timeLagMin) + 1)) + _timeLagMin);
};
}
private function initData():void{
_timeLagMax = XmlManage.PROP_TIMELAG_MAX;
_timeLagMin = XmlManage.PROP_TIMELAG_MIN;
_timeLag = ((Math.random() * (200 - 150)) + 150);
}
public function frameRun():void{
if (((_howToPlayIf) && (!(_howToPlayShootProp)))){
return;
};
appearProp();
propSky();
propRoll();
hit();
}
public function howToPlay():void{
_howToPlayIf = true;
}
public function shootProp():void{
_gameMc.dispatchEvent(new EventScore(EventScore.SCORE_ADD, "shootProp", 200));
_propSky.gotoAndStop(63);
_propRollTime = (XmlManage.PROP_ROLL_TIME - 6);
_propRollMc = Attach.getMovieClip("propRoll");
_propRollMc.x = 50;
_propRollMc.y = 100;
_propRollMc.gotoAndStop(1);
_gameMc.addChild(_propRollMc);
SoundsManager.instance.playSound("Collectpowerup", 1);
SoundsManager.instance.playSound("Powerupslotmachine", 1);
}
public function howToPlayShootProp():void{
_timeLag = 1;
_howToPlayShootProp = true;
}
public function howToPlayShootPropOver():void{
_howToPlayShootProp = false;
}
}
}//package game
Section 129
//HitCheck (game.HitCheck)
package game {
public class HitCheck {
public static var BOMB:Array;
public static var RUBBISH:Array;
public static var ARROWS_SKY:Array;
public function HitCheck():void{
super();
ARROWS_SKY = new Array();
BOMB = new Array();
RUBBISH = new Array();
}
private function arrowAndBomb():void{
var j:int;
var i:int;
while (i < ARROWS_SKY.length) {
j = 0;
for (;j < BOMB.length;j++) {
if ((ARROWS_SKY[i] as ArrowManage).mc.hitTestObject(BOMB[j].hit)){
BOMB[j].hitNa();
(ARROWS_SKY[i] as ArrowManage).remove();
ARROWS_SKY.splice(i, 1);
i--;
continue;
};
};
i++;
};
}
private function bombRun():void{
var i:int;
while (i < BOMB.length) {
BOMB[i].frameRun();
if (BOMB[i].removeIf){
BOMB.splice(i, 1);
i--;
};
i++;
};
}
private function arrowSkyRun():void{
var temp:ArrowManage;
var i:int;
while (i < ARROWS_SKY.length) {
temp = ARROWS_SKY[i];
if (temp.moveSky() == true){
ARROWS_SKY.splice(i, 1);
i--;
};
i++;
};
}
public function frameRun():void{
arrowSkyRun();
bombRun();
arrowAndBomb();
}
}
}//package game
Section 130
//HowToPlay (game.HowToPlay)
package game {
import flash.display.*;
import flash.events.*;
import tools.*;
import zlong.breathxue.utils.*;
import flash.text.*;
import ui.*;
public class HowToPlay {
private var _scoreHit:int;
private var _danceGameIf:Boolean;
private var _playerManage:Napoleon;
private var _scoreKill:int;
private var _timeNumText:TextField;
private var _hitDetect:HitCheck;
private var _keyDownMc:MovieClip;
private var _fatManManage:FatManManage;
private var _napoleonJumpIf:Boolean;
private var _mc:MovieClip;
private var _rightMove:Boolean;
private var _aimMc:MovieClip;
private var _iutorial_aim_time:int;// = 150
private var _shootArrowMc:MovieClip;
private var _scoreNumText:TextField;
private var _root:Sprite;
private var _propManage:GameProp;
private var _keyUpTime:int;
private var _keyUpMc:MovieClip;
public var _iutorialName:String;
private var _killNumText:TextField;
private var _leftMove:Boolean;
private var _keyUpIf:Boolean;
private var _mouseDown:Boolean;
private var _pause:Boolean;
private var _backdropManage:BackdropManage;
public static const FAT_MAN_DEAD:String = "FAT_MAN_DEAD";
public function HowToPlay(root:Sprite, mc:MovieClip):void{
super();
_root = root;
_mc = mc;
initDis();
_hitDetect = new HitCheck();
_backdropManage = new BackdropManage(_mc);
_playerManage = new Napoleon(_mc["napoleonMc"]);
_fatManManage = new FatManManage(_mc["fatmanMc"], _playerManage);
_fatManManage.howToPlay();
_propManage = new GameProp(_mc);
_propManage.howToPlay();
_fatManManage.appearFatman();
initEvent();
aim();
SoundsManager.instance.playMusic("关卡");
}
private function howPauseOver():void{
startGame();
}
private function pauseGame():void{
if (!_pause){
_pause = true;
};
new PauseUI(_root);
}
private function addScore(event:EventScore):void{
}
private function howPause():void{
_iutorialName = "howPause";
pauseGame();
}
private function keyDownOver():void{
_mc.removeChild(_keyDownMc);
_keyDownMc = null;
keyUp();
}
private function shootArrowOver():void{
_mc.removeChild(_shootArrowMc);
_shootArrowMc = null;
keyDown();
}
private function keyUpHandler(event:KeyboardEvent):void{
if ((((event.keyCode == 65)) || ((event.keyCode == 37)))){
_leftMove = false;
} else {
if ((((event.keyCode == 68)) || ((event.keyCode == 39)))){
_rightMove = false;
} else {
if ((((event.keyCode == 87)) || ((event.keyCode == 38)))){
_napoleonJumpIf = false;
} else {
if ((((event.keyCode == 83)) || ((event.keyCode == 40)))){
if (_iutorialName == "keyDown"){
keyDownOver();
};
_playerManage.addArrow();
};
};
};
};
}
private function mouseUp(event:MouseEvent):void{
if ((((((_pause == true)) || ((_mouseDown == false)))) || (_danceGameIf))){
return;
};
_mouseDown = false;
_playerManage.shooting();
if (_iutorialName == "shootArrow"){
shootArrowOver();
};
}
private function keyDown():void{
_iutorialName = "keyDown";
_keyDownMc = Attach.getMovieClip("keyDown");
_mc.addChild(_keyDownMc);
_keyDownMc.x = 325;
_keyDownMc.y = 175;
_playerManage.howToPlayKeyDown();
}
private function playerOperation():void{
if (_mouseDown == true){
_playerManage.drawBow();
};
if (_leftMove == true){
_playerManage.move(-6);
};
if ((((_rightMove == true)) && ((_leftMove == false)))){
_playerManage.move(6);
};
if (_napoleonJumpIf == true){
_napoleonJumpIf = false;
if (_iutorialName == "keyUp"){
_keyUpIf = true;
};
_playerManage.jump();
};
}
private function shootArrow():void{
_iutorialName = "shootArrow";
_shootArrowMc = Attach.getMovieClip("mouseClick");
_mc.addChild(_shootArrowMc);
_shootArrowMc.x = 325;
_shootArrowMc.y = 175;
}
private function shootProp():void{
_iutorialName = "shootProp";
_propManage.howToPlayShootProp();
}
private function shootPropOver():void{
howPause();
}
private function aimOver():void{
_mc.removeChild(_aimMc);
_aimMc = null;
shootArrow();
}
private function flow():void{
if (_iutorialName == "aim"){
_iutorial_aim_time--;
if (_iutorial_aim_time == 0){
aimOver();
};
};
if ((((_iutorialName == "keyUp")) && (_keyUpIf))){
_keyUpTime--;
if (_keyUpTime == 0){
keyUpOver();
};
};
}
private function onFatManDead(event:Event):void{
_fatManManage.fatManDead();
new PopupBox(_mc, "dead");
}
private function aim():void{
_iutorialName = "aim";
_iutorial_aim_time = 150;
_aimMc = Attach.getMovieClip("mouseMove");
_mc.addChild(_aimMc);
_aimMc.x = 100;
_aimMc.y = 260;
}
private function keyUpOver():void{
_fatManManage.howToPlayAtkOver();
_mc.removeChild(_keyUpMc);
_keyUpMc = null;
shootProp();
}
public function delEvent():void{
_mc.removeEventListener(Event.ENTER_FRAME, frameRun);
_mc.addEventListener(FAT_MAN_DEAD, onFatManDead);
_mc.stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_mc.stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
_mc.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
_mc.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
_mc.removeEventListener(EventScore.SCORE_ADD, addScore);
_mc.removeEventListener(EventProp.SET_PROP, getProp);
_mc.removeEventListener(EventProp.PROP_OVER, propOver);
}
private function getProp(event:EventProp):void{
if (event.propName == "flamingArrow"){
_playerManage.getFlam();
};
}
private function keyUp():void{
_keyUpTime = 300;
_iutorialName = "keyUp";
_keyUpMc = Attach.getMovieClip("keyUp");
_mc.addChild(_keyUpMc);
_keyUpMc.x = 325;
_keyUpMc.y = 175;
_fatManManage.howToPlayAtk();
}
private function initDis():void{
_timeNumText = _mc["timeNum"];
_timeNumText.selectable = false;
_killNumText = _mc["killNum"];
_killNumText.selectable = false;
_scoreNumText = _mc["scoreNum"];
_scoreNumText.selectable = false;
}
private function frameRun(event:Event):void{
_mc.stage.focus = _mc;
if (_pause){
return;
};
playerOperation();
_hitDetect.frameRun();
_backdropManage.frameRun();
_playerManage.frameRun();
_fatManManage.frameRun();
_propManage.frameRun();
flow();
}
private function propOver(event:EventProp):void{
_propManage.propOver();
shootPropOver();
}
private function mouseDown(event:MouseEvent):void{
if ((((_pause == true)) || (_danceGameIf))){
return;
};
_mouseDown = true;
}
private function keyDownHandler(event:KeyboardEvent):void{
if (_pause){
return;
};
if (event.keyCode == 80){
pauseGame();
};
if ((((event.keyCode == 65)) || ((event.keyCode == 37)))){
_leftMove = true;
} else {
if ((((event.keyCode == 68)) || ((event.keyCode == 39)))){
_rightMove = true;
} else {
if ((((event.keyCode == 87)) || ((event.keyCode == 38)))){
_napoleonJumpIf = true;
};
};
};
}
public function pauseOver():void{
_pause = false;
if (_iutorialName == "howPause"){
howPauseOver();
};
}
private function initEvent():void{
_mc.addEventListener(Event.ENTER_FRAME, frameRun);
_mc.addEventListener(FAT_MAN_DEAD, onFatManDead);
_mc.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
_mc.stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
_mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown);
_mc.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
_mc.addEventListener(EventScore.SCORE_ADD, addScore);
_mc.addEventListener(EventProp.SET_PROP, getProp);
_mc.addEventListener(EventProp.PROP_OVER, propOver);
}
private function startGame():void{
new StartUi(_root);
}
}
}//package game
Section 131
//MusicalNote (game.MusicalNote)
package game {
import flash.display.*;
import tools.*;
import zlong.breathxue.utils.*;
public class MusicalNote {
private var _noteSeed:Number;
private var _rotationNum:int;
private var _mc:MovieClip;
private var _type:String;
public function MusicalNote(upMc:MovieClip, speed:Number):void{
super();
_noteSeed = speed;
_rotationNum = (Math.random() * 4);
_mc = Attach.getMovieClip("note");
_mc.rotation = (90 * _rotationNum);
_mc.gotoAndStop(1);
_mc.x = 550;
_mc.y = 311;
upMc.addChild(_mc);
_mc.addFrameScript(19, walk);
_mc.addFrameScript(48, remove);
_mc.addFrameScript(77, remove);
_type = "walk";
}
private function walk():void{
_mc.gotoAndPlay(1);
//unresolved jump
var _slot1 = e;
}
private function remove():void{
_mc.parent.removeChild(_mc);
_mc = null;
//unresolved jump
var _slot1 = e;
}
public function lose():void{
SoundsManager.instance.playSound("Dropacowcrush", 1);
_type = "lose";
_mc.gotoAndPlay(50);
DanceGame.LOSE_IF++;
}
public function get mc():MovieClip{
return (_mc);
}
public function judge(num:int):void{
if ((((((_mc.x >= 313)) && ((_mc.x <= 338)))) && ((_rotationNum == num)))){
win();
} else {
lose();
};
}
public function get type():String{
return (_type);
}
public function win():void{
SoundsManager.instance.playSound("seconds", 1);
_type = "win";
_mc.gotoAndPlay(21);
_mc.parent.dispatchEvent(new EventScore(EventScore.SCORE_ADD, "hitNote", 100));
}
public function frameRun():void{
_mc.x = (_mc.x + _noteSeed);
if ((((_mc.x < 300)) && ((_type == "walk")))){
lose();
};
}
}
}//package game
Section 132
//Napoleon (game.Napoleon)
package game {
import flash.display.*;
import tools.*;
import zlong.breathxue.utils.*;
import flash.geom.*;
public class Napoleon {
private const TUMBLE:String = "napoleon_tumble";
private const RUN:String = "napoleon_run";
private const DANCE_SITE:Number = 330;
private var _hitMc:MovieClip;
private var _napoleonX:Number;
private var _napoleonY:Number;
private var _jumpIf:Boolean;
private var _speedX:Number;
private var _danceFunc:Function;
private var _stepTime:int;
private var _minX:Number;
private var _humTime:int;
private var _mc:MovieClip;
private var _defendTime:int;
private var _missA:Number;// = 1.4
private var _gameMc:MovieClip;
private var _bowManage:Bow;
private var _maxX:Number;
private var _action:String;
private var _hitCd:int;
private var _danceIf:Boolean;
public function Napoleon(upMc:MovieClip):void{
super();
_gameMc = upMc;
_bowManage = new Bow(_gameMc);
initData();
refurbishAction();
}
private function jumpAction():void{
if (!_jumpIf){
return;
};
_mc.y = (_mc.y + _speedX);
_speedX = (_speedX + _missA);
if (_mc.y >= 300){
_mc.y = 300;
_speedX = 0;
_jumpIf = false;
SoundsManager.instance.playSound("fat_setlandmine", 1);
};
}
public function hitFat():void{
if (_danceIf){
return;
};
if ((((_action == TUMBLE)) || ((_hitCd > 0)))){
return;
};
if (_speedX > 0){
_speedX = -15;
_jumpIf = true;
_mc.gotoAndStop(7);
_hitCd = 2;
SoundsManager.instance.playSound("jumponfat", 1);
} else {
tumble();
};
}
public function get hitMc():MovieClip{
return (_hitMc);
}
public function get mc():MovieClip{
return (_mc);
}
private function refurbishAction():void{
if (_mc != null){
_gameMc.removeChild(_mc);
};
_mc = Attach.getMovieClip(_action);
_hitMc = _mc["hitMc"];
_mc.x = _napoleonX;
_mc.y = _napoleonY;
_gameMc.addChild(_mc);
_mc.gotoAndStop(1);
_bowManage.changeState(_action);
}
private function hitIf():void{
if (_danceIf){
return;
};
if (_defendTime > 0){
_defendTime--;
return;
};
var arr:Array = HitCheck.BOMB;
var i:int;
while (i < arr.length) {
if (_hitMc.hitTestObject(arr[i].hit)){
tumble();
arr[i].hitNa();
return;
};
i++;
};
}
private function shadow():void{
(_mc["shadow"] as MovieClip).y = (300 - _mc.y);
}
public function dance(danceFunc:Function):void{
_danceIf = true;
_danceFunc = danceFunc;
}
public function danceOver():void{
_defendTime = 60;
_mc.visible = true;
_danceIf = false;
_bowManage.show();
}
private function bowMove():void{
if (_action == TUMBLE){
_bowManage.frameRun(new Point(-200, -200));
return;
};
var point:Point = (_mc["bowPoint"] as MovieClip).localToGlobal(new Point(0, 0));
_bowManage.frameRun(point);
handMove();
}
public function jump():void{
if (_danceIf){
return;
};
if (_action == TUMBLE){
return;
};
if (_jumpIf){
return;
};
_speedX = -15;
_jumpIf = true;
_mc.gotoAndStop(7);
SoundsManager.instance.playSound("pig_jump", 1);
}
public function move(num:Number):void{
if (_danceIf){
return;
};
if (_action == TUMBLE){
return;
};
_napoleonX = (_napoleonX + num);
if (num > 0){
if (_napoleonX > _maxX){
_napoleonX = (_napoleonX - num);
};
};
if (_napoleonX < _minX){
_napoleonX = _minX;
};
_mc.x = _napoleonX;
}
private function danceRun():void{
if (_napoleonX < DANCE_SITE){
_napoleonX = (_napoleonX + 5);
_mc.x = _napoleonX;
if (_napoleonX >= DANCE_SITE){
_mc.visible = false;
_bowManage.hide();
_danceFunc();
};
};
}
private function initData():void{
_action = RUN;
_maxX = XmlManage.NAPOLEON_MAX_X;
_minX = XmlManage.NAPOLEON_MIN_X;
_napoleonX = 100;
_napoleonY = 300;
}
public function frameRun():void{
if (!_danceIf){
if (_humTime == 0){
_humTime = 90;
SoundsManager.instance.playSound("pig_hum", 1);
};
if (_stepTime == 0){
_stepTime = 45;
SoundsManager.instance.playSound("pig_step", 1);
};
_humTime--;
_stepTime--;
};
if (_action == TUMBLE){
_napoleonX = (_napoleonX - 5);
_mc.x = _napoleonX;
};
jumpAction();
shadow();
actionRun();
bowMove();
hitIf();
if (_danceIf){
danceRun();
};
if (_hitCd > 0){
_hitCd--;
};
}
private function handMove():void{
var point2:Point = (_mc["handPoint"] as MovieClip).localToGlobal(new Point(0, 0));
var point1:Point = _bowManage.mc.localToGlobal(new Point(38.8, 4.5));
var dx2:int = (point1.x - point2.x);
var dy2:int = (point1.y - point2.y);
_mc["lifeHand"].rotation = ((Math.atan2(dy2, dx2) * 180) / Math.PI);
_mc["lifeHand"].x = _mc["handPoint"].x;
_mc["lifeHand"].y = _mc["handPoint"].y;
_mc["lifeHand"]["hand"].width = (Math.sqrt(((dx2 * dx2) + (dy2 * dy2))) + 5);
}
public function shooting():void{
_bowManage.shoot();
}
public function tumble():void{
if (_danceIf){
return;
};
if (_defendTime > 0){
return;
};
_defendTime = 120;
_action = TUMBLE;
refurbishAction();
SoundsManager.instance.playSound(String(("napoleon_Buzzer" + int(((Math.random() * 2) + 1)))), 1);
}
public function getFlam():void{
_bowManage.getFlam();
}
public function howToPlayKeyDown():void{
_bowManage.howToPlayKeyDown();
}
public function drawBow():void{
_bowManage.drawBow();
}
public function addArrow():void{
_bowManage.addArrow();
}
private function actionRun():void{
if (_mc.currentFrame == _mc.totalFrames){
if (_napoleonX < _minX){
_napoleonX = _minX;
};
_mc.x = _napoleonX;
if (_action != RUN){
_action = RUN;
refurbishAction();
return;
};
_mc.gotoAndStop(1);
return;
};
if (_jumpIf){
return;
};
_mc.nextFrame();
}
public function getExplod():void{
_bowManage.getExplod();
}
public function rapid():void{
_bowManage.rapid();
}
}
}//package game
Section 133
//PopupBox (game.PopupBox)
package game {
import flash.display.*;
import flash.events.*;
import tools.*;
import zlong.breathxue.utils.*;
public class PopupBox {
private var _mc:MovieClip;
public function PopupBox(upMc:MovieClip, type:String):void{
var i:int;
super();
SoundsManager.instance.playSound("Popuptext", 1);
if (type == "dead"){
i = ((Math.random() * 5) + 1);
_mc = Attach.getMovieClip(("text_dead_" + i));
};
if (type == "flaming"){
_mc = Attach.getMovieClip("text_flaming");
};
if (type == "exploding"){
_mc = Attach.getMovieClip("text_exploding");
};
if (type == "cow1"){
_mc = Attach.getMovieClip("text_cow1");
};
if (type == "cow2"){
_mc = Attach.getMovieClip("text_cow2");
};
if (type == "cow3"){
_mc = Attach.getMovieClip("text_cow3");
};
if (type == "dance"){
_mc = Attach.getMovieClip("text_dance");
_mc.addEventListener(Event.ENTER_FRAME, onRun);
};
_mc.x = 325;
_mc.y = 100;
upMc.addChild(_mc);
_mc.addFrameScript((_mc.totalFrames - 1), del);
}
private function del():void{
_mc.parent.removeChild(_mc);
_mc.gotoAndStop(1);
_mc = null;
//unresolved jump
var _slot1 = e;
}
private function onRun(event:Event):void{
_mc.parent.setChildIndex(_mc, (_mc.parent.numChildren - 1));
if (_mc.currentFrame == (_mc.totalFrames - 10)){
_mc.removeEventListener(Event.ENTER_FRAME, onRun);
};
}
}
}//package game
Section 134
//PopupData (game.PopupData)
package game {
import flash.display.*;
import zlong.breathxue.utils.*;
import flash.geom.*;
import flash.text.*;
public class PopupData {
private var _mc:MovieClip;
private var _num:int;
private var _type:String;
public function PopupData(type:String, upMc:MovieClip, num:int, point:Point, addScoreByHitIf:Boolean=false):void{
super();
_num = num;
_type = type;
_mc = Attach.getMovieClip(type);
upMc.addChild(_mc);
_mc.x = point.x;
_mc.y = point.y;
if (addScoreByHitIf){
_mc.scaleX = 2;
_mc.scaleY = 2;
};
(_mc["mc"]["text"] as TextField).selectable = false;
if (_type == "addScore"){
(_mc["mc"]["text"] as TextField).text = String(("+" + num));
} else {
if (_type == "loseLife"){
(_mc["mc"]["text"] as TextField).text = String(("-" + num));
} else {
if (_type == "addTime"){
if (num == 5){
(_mc["mc"]["text"] as TextField).text = String(("+ 00:0" + num));
} else {
if (num == 10){
(_mc["mc"]["text"] as TextField).text = String(("+ 00:" + num));
};
};
};
};
};
_mc.addFrameScript((_mc.totalFrames - 1), remove);
}
private function remove():void{
if ((((_type == "addTime")) && ((_num == 5)))){
_mc.parent.dispatchEvent(new EventProp(EventProp.PROP_OVER));
};
_mc.parent.removeChild(_mc);
_mc.gotoAndStop(1);
_mc = null;
//unresolved jump
var _slot1 = e;
}
}
}//package game
Section 135
//StartUi (game.StartUi)
package game {
import flash.display.*;
import flash.events.*;
import zlong.breathxue.utils.*;
import ui.*;
public class StartUi {
private var _root:Sprite;
private var _mc:MovieClip;
private var _startBtn:MovieClip;
public function StartUi(r:Sprite):void{
super();
_root = r;
_mc = Attach.getMovieClip("startGame");
_startBtn = _mc["start"];
_startBtn.gotoAndStop(1);
_startBtn.buttonMode = true;
_startBtn.mouseChildren = false;
_root.addChild(_mc);
initEvent();
}
private function overMc(event:MouseEvent):void{
_startBtn.gotoAndStop(3);
}
private function clickStart(event:MouseEvent):void{
_startBtn.gotoAndStop(4);
del();
}
private function outMc(event:MouseEvent):void{
_startBtn.gotoAndStop(1);
}
private function initEvent():void{
_startBtn.addEventListener(MouseEvent.CLICK, clickStart);
_startBtn.addEventListener(MouseEvent.ROLL_OVER, overMc);
_startBtn.addEventListener(MouseEvent.ROLL_OUT, outMc);
}
private function del():void{
_startBtn.removeEventListener(MouseEvent.CLICK, clickStart);
_startBtn.removeEventListener(MouseEvent.ROLL_OVER, overMc);
_startBtn.removeEventListener(MouseEvent.ROLL_OUT, outMc);
_root.removeChild(_mc);
_mc = null;
_root.dispatchEvent(new Event(EventIn.START_GAME));
}
}
}//package game
Section 136
//TargetBox (game.TargetBox)
package game {
import flash.display.*;
import zlong.breathxue.utils.*;
import flash.text.*;
public class TargetBox {
private var _needKillNum:int;
private var _mc:MovieClip;
private var _gameMc:MovieClip;
private var _backFunction:Function;
public function TargetBox(mc:MovieClip, num:int, backFunction:Function):void{
super();
_gameMc = mc;
_needKillNum = num;
_backFunction = backFunction;
initDis();
_mc.addFrameScript((_mc.totalFrames - 1), remove);
}
private function initDis():void{
_mc = Attach.getMovieClip("target");
_mc.x = 400;
_mc.y = 100;
_mc["targetMc"]["targetNum"].text = String(_needKillNum);
(_mc["targetMc"]["targetNum"] as TextField).selectable = false;
_gameMc.addChild(_mc);
}
private function remove():void{
_mc.gotoAndStop(1);
_gameMc.removeChild(_mc);
_mc = null;
_backFunction();
//unresolved jump
var _slot1 = e;
}
}
}//package game
Section 137
//XmlManage (game.XmlManage)
package game {
import flash.events.*;
import flash.net.*;
import ui.*;
public class XmlManage extends EventDispatcher {
private var _xmlData:XML;
private var ldr:URLLoader;
public static var FAT_MAN_MIN_X:Number;
public static var ARROW_MASS:Number;
public static var FIRST_BACKDROP_SPEED:Number;
public static var NAPOLEONX:Number;
public static var NAPOLEONY:Number;
public static var FIRE_CD:int;
public static var FAT_MAN_MAX_X:Number;
private static var _xmlInstance:XmlManage;
public static var NAPOLEON_MIN_X:Number;
public static var NOTE_SPEED:Number;
public static var NAPOLEON_MAX_X:Number;
public static var SECOND_BACKDROP_SPEED:Number;
public static var PROP_TIMELAG_MIN:int;
public static var PROP_TIMELAG_MAX:int;
public static var BACK_DROP_SPEED:Number;
public static var NAPOLEON_SPEED:Number;
public static var BEGIN_STAY_TIME:int;
public static var NOTE_SHOW_TIME:int;
public static var MAX_ARROW_NUM:int;
public static var ARROW_ANGLE_MIN:Number;
public static var ARROW_ANGLE_MAX:Number;
public static var FAT_MANY:Number;
public static var FAT_MANX:Number;
public static var PROP_ROLL_TIME:int;
public static var DANCE_TIME:int;
public function XmlManage(){
super();
initNapoleon();
}
private function initData(event:Event):void{
_xmlData = XML(ldr.data);
ldr = null;
initNapoleon();
dispatchEvent(new Event(Manage.XML_FINISH));
}
private function initNapoleon():void{
ARROW_MASS = 0.33;
BACK_DROP_SPEED = 6;
NAPOLEON_SPEED = 4;
NAPOLEONX = 75;
NAPOLEONY = 300;
FAT_MANX = 700;
FAT_MANY = 282;
NAPOLEON_MAX_X = 300;
NAPOLEON_MIN_X = 0;
FIRE_CD = 15;
NOTE_SHOW_TIME = 30;
NOTE_SPEED = 3;
MAX_ARROW_NUM = 10;
ARROW_ANGLE_MIN = -60;
ARROW_ANGLE_MAX = 30;
FIRST_BACKDROP_SPEED = 5;
SECOND_BACKDROP_SPEED = 1;
FAT_MAN_MAX_X = 650;
FAT_MAN_MIN_X = 400;
PROP_TIMELAG_MIN = 150;
PROP_TIMELAG_MAX = 300;
PROP_ROLL_TIME = 60;
DANCE_TIME = 450;
BEGIN_STAY_TIME = 30;
}
public function setGameData():void{
ldr = new URLLoader();
ldr.load(new URLRequest("Napoleon_Stupid.xml"));
ldr.addEventListener(Event.COMPLETE, initData, false, 0, true);
}
public static function get xmlInstance():XmlManage{
if (_xmlInstance == null){
_xmlInstance = new (XmlManage);
};
return (_xmlInstance);
}
}
}//package game
Section 138
//Stats (net.hires.debug.Stats)
package net.hires.debug {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
public class Stats extends Sprite {
protected const WIDTH:uint = 70;
protected const HEIGHT:uint = 100;
protected var xml:XML;
protected var text:TextField;
protected var style:StyleSheet;
protected var timer:uint;
protected var fps:uint;
protected var ms:uint;
protected var ms_prev:uint;
protected var mem:Number;
protected var mem_max:Number;
protected var graph:Bitmap;
protected var rectangle:Rectangle;
protected var fps_graph:uint;
protected var mem_graph:uint;
protected var mem_max_graph:uint;
protected var theme:Object;
public function Stats(_theme:Object=null):void{
this.theme = {bg:51, fps:0xFFFF00, ms:0xFF00, mem:0xFFFF, memmax:0xFF0070};
super();
this.mouseChildren = false;
this.mouseEnabled = false;
if (_theme){
if (_theme.bg != null){
this.theme.bg = _theme.bg;
};
if (_theme.fps != null){
this.theme.fps = _theme.fps;
};
if (_theme.ms != null){
this.theme.ms = _theme.ms;
};
if (_theme.mem != null){
this.theme.mem = _theme.mem;
};
if (_theme.memmax != null){
this.theme.memmax = _theme.memmax;
};
};
this.mem_max = 0;
this.xml = <xml><fps>FPS:</fps><ms>MS:</ms><mem>MEM:</mem><memMax>MAX:</memMax></xml>
;
this.style = new StyleSheet();
this.style.setStyle("xml", {fontSize:"9px", fontFamily:"_sans", leading:"-2px"});
this.style.setStyle("fps", {color:this.hex2css(this.theme.fps)});
this.style.setStyle("ms", {color:this.hex2css(this.theme.ms)});
this.style.setStyle("mem", {color:this.hex2css(this.theme.mem)});
this.style.setStyle("memMax", {color:this.hex2css(this.theme.memmax)});
this.text = new TextField();
this.text.width = this.WIDTH;
this.text.height = 50;
this.text.styleSheet = this.style;
this.text.condenseWhite = true;
this.text.selectable = false;
this.text.mouseEnabled = false;
this.graph = new Bitmap();
this.graph.alpha = 0.3;
this.graph.y = 50;
this.rectangle = new Rectangle((this.WIDTH - 1), 0, 1, (this.HEIGHT - 50));
addEventListener(Event.ADDED_TO_STAGE, this.init, false, 0, true);
addEventListener(Event.REMOVED_FROM_STAGE, this.destroy, false, 0, true);
}
private function init(e:Event):void{
graphics.beginFill(this.theme.bg, 0.3);
graphics.drawRect(0, 0, this.WIDTH, this.HEIGHT);
graphics.endFill();
addChild(this.text);
this.graph.bitmapData = new BitmapData(this.WIDTH, (this.HEIGHT - 50), false, this.theme.bg);
addChild(this.graph);
addEventListener(Event.ENTER_FRAME, this.update);
}
private function destroy(e:Event):void{
graphics.clear();
while (numChildren > 0) {
removeChildAt(0);
};
this.graph.bitmapData.dispose();
removeEventListener(Event.ENTER_FRAME, this.update);
}
private function update(e:Event):void{
this.timer = getTimer();
if ((this.timer - 1000) > this.ms_prev){
this.ms_prev = this.timer;
this.mem = Number((System.totalMemory * 9.54E-7).toFixed(3));
this.mem_max = ((this.mem_max > this.mem)) ? this.mem_max : this.mem;
this.fps_graph = Math.min(this.graph.height, ((this.fps / stage.frameRate) * this.graph.height));
this.mem_graph = (Math.min(this.graph.height, Math.sqrt(Math.sqrt((this.mem * 5000)))) - 2);
this.mem_max_graph = (Math.min(this.graph.height, Math.sqrt(Math.sqrt((this.mem_max * 5000)))) - 2);
this.graph.bitmapData.scroll(-1, 0);
this.graph.bitmapData.fillRect(this.rectangle, this.theme.bg);
this.graph.bitmapData.setPixel((this.graph.width - 1), (this.graph.height - this.fps_graph), this.theme.fps);
this.graph.bitmapData.setPixel((this.graph.width - 1), (this.graph.height - ((this.timer - this.ms) >> 1)), this.theme.ms);
this.graph.bitmapData.setPixel((this.graph.width - 1), (this.graph.height - this.mem_graph), this.theme.mem);
this.graph.bitmapData.setPixel((this.graph.width - 1), (this.graph.height - this.mem_max_graph), this.theme.memmax);
this.xml.fps = ((("FPS: " + this.fps) + " / ") + stage.frameRate);
this.xml.mem = ("MEM: " + this.mem);
this.xml.memMax = ("MAX: " + this.mem_max);
this.fps = 0;
};
this.fps++;
this.xml.ms = ("MS: " + (this.timer - this.ms));
this.ms = this.timer;
this.text.htmlText = this.xml;
}
private function onClick(e:MouseEvent):void{
if (((mouseY / height) > 0.5)){
stage.frameRate--;
} else {
stage.frameRate++;
};
this.xml.fps = ((("FPS: " + this.fps) + " / ") + stage.frameRate);
this.text.htmlText = this.xml;
}
private function hex2css(color:int):String{
return (("#" + color.toString(16)));
}
}
}//package net.hires.debug
Section 139
//AbstractScreen (tools.AbstractScreen)
package tools {
import flash.display.*;
import flash.utils.*;
public class AbstractScreen {
protected var _root:Sprite;
public function AbstractScreen(r:Sprite){
super();
if (getQualifiedClassName(this) == "main::AbstractScreen"){
throw (new ArgumentError("can't be constructed"));
};
_root = r;
}
public function destroy():void{
throw (new Error("Abstract Method!"));
}
}
}//package tools
Section 140
//Cookie (tools.Cookie)
package tools {
import flash.net.*;
public class Cookie {
private const NAME:String = "Napoleon_Stipid";
private static var _instance:Cookie;
private static var _share:SharedObject;
private static var _data:Object;
public function Cookie(){
super();
}
private function initAwards():void{
var player_awards:Object;
if (_data["player_awards"] == null){
player_awards = {awards:[false, false, false, false, false]};
_data["player_awards"] = player_awards;
};
}
public function del():void{
_share.close();
}
private function initTutorial():void{
var temp:Object;
if (_data["player_tutorial"] == null){
temp = {toTutorial:true};
_data["player_tutorial"] = temp;
};
}
private function initShare():void{
_share = SharedObject.getLocal(NAME, "/");
}
public function init():void{
initShare();
initData();
}
private function initOptions():void{
var temp:Object;
if (_data["options"] == null){
temp = {sound:true, music:true, quality:"BEST"};
_data["options"] = temp;
};
}
public function get playerAwards():Object{
return (_data["player_awards"]);
}
private function initData():void{
_data = _share.data;
initOptions();
initTutorial();
initAwards();
}
public function get playerOptions():Object{
return (_data["options"]);
}
public function get playerTutorial():Object{
return (_data["player_tutorial"]);
}
public static function get instance():Cookie{
if (_instance == null){
_instance = new (Cookie);
};
return (_instance);
}
public static function get data():Object{
return (_data);
}
public static function flush():void{
_share.flush();
}
public static function clear():void{
_share.clear();
}
}
}//package tools
Section 141
//SoundsManager (tools.SoundsManager)
package tools {
import flash.events.*;
import flash.media.*;
import zlong.breathxue.utils.*;
import flash.utils.*;
public class SoundsManager {
private const VALUE_FADE:Number = 0.02;
private var fadeInTimer:Timer;
public var curMusic_sc:SoundChannel;
private var curMusic_so:Sound;
private var valueSound:Number;
private var valueGroupSound:Number;
private var curMusic_st:String;
private var fadeTimes:int;
private var fadeOutTimer:Timer;
private var valueMusic:Number;
private var enabled:Boolean;
private var fadeInLabel:String;
private var soundArr:Array;
private var musicEnabled:Boolean;
private var currGroupSoundId:int;
private var groupSoundArr:Array;
private var pausePos:Number;
private static var currentInstance:SoundsManager;
public function SoundsManager(){
super();
init();
}
private function initGroupSound():void{
var obj:Object = groupSoundArr[currGroupSoundId];
obj["soundChannel"] = obj["sound"].play(0, 0, new SoundTransform(valueGroupSound));
initGroupSoundChannelEvent(obj["soundChannel"]);
}
public function get ValueGroupSound():Number{
return (valueGroupSound);
}
private function stopFadeIn():void{
var transform:SoundTransform = curMusic_sc.soundTransform;
transform.volume = valueMusic;
curMusic_sc.soundTransform = transform;
delFadeInTimer();
}
public function set ValueGroupSound(n:Number):void{
var transform:SoundTransform;
valueGroupSound = n;
if (groupSoundArr != null){
transform = groupSoundArr[currGroupSoundId]["soundChannel"].soundTransform;
transform.volume = n;
groupSoundArr[currGroupSoundId]["soundChannel"].soundTransform = transform;
};
}
private function remSoundArr(sc:SoundChannel):void{
var obj:Object;
var i:int;
while (i < soundArr.length) {
obj = soundArr[i];
if (obj["soundChannel"] == sc){
obj["soundChannel"].stop();
obj["label"] = null;
obj["sound"] = null;
obj["soundChannel"] = null;
soundArr.splice(i, 1);
};
i++;
};
}
public function stopAllSound():void{
var i:int;
while (i < soundArr.length) {
delSound(soundArr[i]["soundChannel"]);
i++;
};
}
public function get FadeTimes():int{
return (fadeTimes);
}
public function fadeOutMusic():void{
if (curMusic_sc != null){
startFadeOut();
};
}
public function set FadeTimes(v:int):void{
fadeTimes = v;
}
private function init():void{
FadeTimes = 200;
Enabled = true;
MusicEnable = true;
ValueMusic = 1;
ValueSound = 1;
valueGroupSound = 1;
soundArr = new Array();
groupSoundArr = new Array();
}
private function addSoundArr(obj:Object):void{
soundArr.push(obj);
}
public function overOldSound(s:String, v:Number, loops:int=0):void{
var same:Boolean;
var obj:Object;
var i:int;
if (enabled){
same = false;
i = 0;
while (i < soundArr.length) {
obj = soundArr[i];
if (obj["label"] == s){
same = true;
break;
};
i++;
};
if (same){
delSound(obj["soundChannel"]);
};
playSound(s, v, loops);
};
}
private function startFadeIn(s:String):void{
initMusic(s, 0);
initFadeInTimer();
}
public function set ValueMusic(n:Number):void{
var transform:SoundTransform;
valueMusic = n;
if (curMusic_sc != null){
transform = curMusic_sc.soundTransform;
transform.volume = n;
curMusic_sc.soundTransform = transform;
};
}
public function stopSound(s:String):void{
var obj:Object;
var i:int;
while (i < soundArr.length) {
obj = soundArr[i];
if (obj["label"] == s){
delSound(obj["soundChannel"]);
break;
};
i++;
};
}
public function get Enabled():Boolean{
return (enabled);
}
private function delGroupSoundChannelEvent(sc:SoundChannel):void{
sc.removeEventListener(Event.SOUND_COMPLETE, groupSoundCompleteHandler);
}
private function fadeOut(e:TimerEvent):void{
var transform:SoundTransform = curMusic_sc.soundTransform;
transform.volume = (transform.volume - VALUE_FADE);
curMusic_sc.soundTransform = transform;
if (curMusic_sc.soundTransform.volume <= 0){
stopFadeOut();
};
}
public function playSound(s:String, v:Number, loops:int=0):void{
if (enabled){
initSound(s, v, loops);
};
}
public function get ValueSound():Number{
return (valueSound);
}
public function get currentMusic_sc():String{
if (curMusic_sc == null){
return (null);
};
return (curMusic_st);
}
private function delSound(sc:SoundChannel):void{
delSoundChannelEvent(sc);
remSoundArr(sc);
}
private function fadeIn(e:TimerEvent):void{
var transform:SoundTransform = curMusic_sc.soundTransform;
transform.volume = (transform.volume + VALUE_FADE);
curMusic_sc.soundTransform = transform;
if (curMusic_sc.soundTransform.volume >= valueMusic){
stopFadeIn();
};
}
public function set Enabled(b:Boolean):void{
enabled = b;
if (b){
} else {
stopAllSound();
};
}
public function overNewSound(s:String, v:Number, loops:int=0):void{
var same:Boolean;
var obj:Object;
var i:int;
if (enabled){
same = false;
i = 0;
while (i < soundArr.length) {
obj = soundArr[i];
if (obj["label"] == s){
same = true;
break;
};
i++;
};
if (!same){
playSound(s, v, loops);
};
};
}
public function pauseMusic():void{
if (curMusic_sc != null){
pausePos = curMusic_sc.position;
curMusic_sc.stop();
curMusic_sc = null;
};
}
public function set MusicEnable(b:Boolean):void{
musicEnabled = b;
if (curMusic_st != null){
if (b){
restartMusic();
} else {
pauseMusic();
};
};
}
public function playMusic(s:String, v:Number=0.6):void{
if (curMusic_sc != null){
stopMusic();
};
initMusic(s, v);
if (!musicEnabled){
pauseMusic();
};
}
private function delGroupSound():void{
var obj:Object = groupSoundArr[currGroupSoundId];
obj["soundChannel"].stop();
obj["soundChannel"] = null;
}
public function restartMusic():void{
if (!musicEnabled){
return;
};
curMusic_sc = curMusic_so.play(pausePos, int.MAX_VALUE, new SoundTransform(valueMusic));
if (curMusic_sc == null){
curMusic_sc = curMusic_so.play(1, int.MAX_VALUE, new SoundTransform(valueMusic));
};
pausePos = NaN;
}
private function stopFadeOut():void{
delFadeOutTimer();
delMusic();
if (fadeInLabel != null){
initMusic(fadeInLabel, 0);
initFadeInTimer();
fadeInLabel = null;
};
}
public function overNewMusic(s:String, v:Number):void{
if (((!((curMusic_st == s))) && (musicEnabled))){
playMusic(s, v);
};
}
private function delMusic():void{
curMusic_sc.stop();
curMusic_st = null;
curMusic_so = null;
curMusic_sc = null;
}
private function delFadeOutTimer():void{
fadeOutTimer.removeEventListener(TimerEvent.TIMER, fadeOut);
fadeOutTimer = null;
}
private function initSound(s:String, v:Number, loops:int):void{
var obj:Object = new Object();
obj["label"] = s;
obj["sound"] = Attach.getSound(s);
obj["soundChannel"] = obj["sound"].play(0, loops, new SoundTransform(v));
initSoundChannelEvent(obj["soundChannel"]);
addSoundArr(obj);
}
private function groupSoundCompleteHandler(e:Event):void{
delGroupSound();
currGroupSoundId++;
if (currGroupSoundId == groupSoundArr.length){
currGroupSoundId = 0;
};
initGroupSound();
}
public function setOneValueSound(s:String, n:Number):void{
var transform:SoundTransform;
var i:int;
while (i < soundArr.length) {
if (s == soundArr[i]["label"]){
transform = soundArr[i]["soundChannel"].soundTransform;
};
transform.volume = n;
soundArr[i]["soundChannel"].soundTransform = transform;
i++;
};
}
public function get ValueMusic():Number{
return (valueMusic);
}
public function fadeInMusic(s:String):void{
if (musicEnabled){
if (curMusic_sc != null){
startFadeOut();
fadeInLabel = s;
} else {
startFadeIn(s);
};
};
}
public function stopMusic():void{
if (curMusic_sc != null){
delMusic();
};
}
private function initFadeOutTimer():void{
fadeOutTimer = new Timer((fadeTimes / (valueMusic / VALUE_FADE)));
fadeOutTimer.addEventListener(TimerEvent.TIMER, fadeOut);
fadeOutTimer.start();
}
private function initFadeInTimer():void{
fadeInTimer = new Timer((fadeTimes / (valueMusic / VALUE_FADE)));
fadeInTimer.addEventListener(TimerEvent.TIMER, fadeIn);
fadeInTimer.start();
}
private function initSoundChannelEvent(sc:SoundChannel):void{
sc.addEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
}
public function get MusicEnable():Boolean{
return (musicEnabled);
}
private function startFadeOut():void{
initFadeOutTimer();
}
public function stopGroupSound():void{
var obj:Object;
if (groupSoundArr != null){
obj = groupSoundArr[currGroupSoundId];
if (obj != null){
delGroupSoundChannelEvent(obj["soundChannel"]);
delGroupSound();
};
groupSoundArr = new Array();
currGroupSoundId = NaN;
};
}
private function delSoundChannelEvent(sc:SoundChannel):void{
sc.removeEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);
}
private function initMusic(s:String, v:Number):void{
curMusic_st = s;
curMusic_so = Attach.getSound(s);
curMusic_sc = curMusic_so.play(0, int.MAX_VALUE, new SoundTransform(v));
}
private function initGroupSoundChannelEvent(sc:SoundChannel):void{
sc.addEventListener(Event.SOUND_COMPLETE, groupSoundCompleteHandler);
}
private function delFadeInTimer():void{
fadeInTimer.removeEventListener(TimerEvent.TIMER, fadeIn);
fadeInTimer = null;
}
private function soundCompleteHandler(e:Event):void{
delSound((e.target as SoundChannel));
}
public function set ValueSound(n:Number):void{
var i:int;
var transform:SoundTransform;
valueSound = n;
if (soundArr != null){
i = 0;
while (i < soundArr.length) {
transform = soundArr[i]["soundChannel"].soundTransform;
transform.volume = n;
soundArr[i]["soundChannel"].soundTransform = transform;
i++;
};
};
}
public static function get instance():SoundsManager{
if (currentInstance == null){
currentInstance = new (SoundsManager);
};
return (currentInstance);
}
}
}//package tools
Section 142
//TimeManage (tools.TimeManage)
package tools {
import zlong.spilSystemTool.*;
import flash.text.*;
public class TimeManage {
private var _timeText:TextField;
private var _timeLose:int;
private var _timeType:String;
private var _timeShow:int;
private var _overFunction:Function;
private var _frameNum:int;
private var GoogleEventIf:Boolean;
private var useFunction:Function;
public static const COUNT_DOWN:String = "COUNT_DOWN";
public static const COUNT_UP:String = "COUNT_UP";
public function TimeManage(timeText:TextField, timeType:String, timeLimit:int=0, overFunction:Function=null, frameNum:int=30):void{
super();
_timeText = timeText;
_timeText.selectable = false;
_timeType = timeType;
_timeShow = timeLimit;
_frameNum = frameNum;
_overFunction = overFunction;
if (timeType == COUNT_DOWN){
useFunction = countDown;
};
if (timeType == COUNT_UP){
useFunction = countUp;
};
showTime();
}
private function countUp():void{
_timeLose++;
if (_timeLose == _frameNum){
_timeLose = 0;
_timeShow++;
showTime();
};
}
public function frameRun():void{
useFunction();
if ((((_timeShow == 60)) && (!(GoogleEventIf)))){
GoogleEventIf = true;
GoogleEvent.instance.gaTrackEvent("50%_complete", true);
};
}
public function addTime(i:int):void{
SoundsManager.instance.playSound("seconds", 1);
_timeShow = (_timeShow + i);
}
private function countDown():void{
_timeLose++;
if (_timeLose == _frameNum){
_timeLose = 0;
_timeShow--;
showTime();
if (_timeShow == 0){
_overFunction();
};
};
}
private function showTime():void{
var m:int = int((_timeShow / 60));
var i:String = String(m);
var j:String = String((_timeShow - (m * 60)));
if (i.length == 1){
i = ("0" + i);
};
if (j.length == 1){
j = ("0" + j);
};
_timeText.text = String(((i + ":") + j));
}
}
}//package tools
Section 143
//EventIn (ui.EventIn)
package ui {
public class EventIn {
public static const PLAYER_DATA:String = "PLAYER_DATA";
public static const LOW_AEENA:String = "LOW_AEENA";
public static const START_GAME:String = "START_GAME";
public static const HIGH_ARENA:String = "HIGH_ARENA";
public static const TOWN:String = "TOWN";
public static const FREE_MODE:String = "FREE_MODE";
public static const PAUSE_OVER:String = "PAUSE_OVER";
public static const MAIN_MENU:String = "MAIN_MENU";
public static const TRAIN:String = "TRAIN";
public static const HOW_TO_PLAY:String = "HOW_TO_PLAY";
public static const BEGIN_MATCH:String = "BEGIN_MATCH";
public static const LOAD_COMPLETE:String = "LOAD_COMPLETE";
public static const OPTION:String = "OPTION";
public static const SHOP:String = "SHOP";
public static const MAKER:String = "MAKER";
public function EventIn(){
super();
}
}
}//package ui
Section 144
//GameSceneUI (ui.GameSceneUI)
package ui {
import flash.display.*;
import flash.events.*;
import game.*;
import tools.*;
import zlong.breathxue.utils.*;
public class GameSceneUI extends AbstractScreen {
private var _mc:MovieClip;
private var _gameManage;
public function GameSceneUI(r:Sprite){
super(r);
initDis();
if (Cookie.instance.playerTutorial["toTutorial"]){
Cookie.instance.playerTutorial["toTutorial"] = false;
_gameManage = new HowToPlay(_root, _mc);
} else {
_gameManage = new GameManage(_root, _mc);
};
}
private function pauseOver(event:Event):void{
_gameManage.pauseOver();
}
private function delDis():void{
_root.removeEventListener(EventIn.PAUSE_OVER, pauseOver);
_root.removeChild(_mc);
_mc = null;
}
override public function destroy():void{
_gameManage.delEvent();
delDis();
}
private function initDis():void{
_mc = Attach.getMovieClip("gameScene");
_root.addChild(_mc);
_root.addEventListener(EventIn.PAUSE_OVER, pauseOver);
}
}
}//package ui
Section 145
//MainMenuUI (ui.MainMenuUI)
package ui {
import flash.display.*;
import flash.events.*;
import zlong.spilSystemTool.*;
import tools.*;
import zlong.breathxue.utils.*;
public class MainMenuUI extends AbstractScreen {
private var _howToPlay:MovieClip;
private var _quality:MovieClip;
private var _music:MovieClip;
private var _sound:MovieClip;
private var _newGame:MovieClip;
private var _mc:MovieClip;
private static var googleIf:Boolean;
public function MainMenuUI(r:Sprite){
super(r);
initDis();
initEvent();
if (!googleIf){
GoogleEvent.instance.gaTrackEvent("mainscreen_viewed", true);
googleIf = true;
};
SoundsManager.instance.playMusic("主界面");
}
override public function destroy():void{
delEvent();
delDis();
}
private function overMc(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_touch", 1);
(event.target as MovieClip).gotoAndStop(2);
}
private function clickQuality(event:MouseEvent):void{
SoundsManager.instance.playSound("otherclick", 1);
if (Cookie.instance.playerOptions["quality"] == "LOW"){
Cookie.instance.playerOptions["quality"] = "HIGH";
_mc.stage.quality = "HIGH";
_quality.gotoAndStop(2);
} else {
if (Cookie.instance.playerOptions["quality"] == "HIGH"){
Cookie.instance.playerOptions["quality"] = "BEST";
_mc.stage.quality = "BEST";
_quality.gotoAndStop(1);
} else {
if (Cookie.instance.playerOptions["quality"] == "BEST"){
Cookie.instance.playerOptions["quality"] = "LOW";
_mc.stage.quality = "LOW";
_quality.gotoAndStop(3);
};
};
};
}
private function outMc(event:MouseEvent):void{
(event.target as MovieClip).gotoAndStop(1);
}
private function clickSound(event:MouseEvent):void{
if (Cookie.instance.playerOptions["sound"]){
Cookie.instance.playerOptions["sound"] = false;
SoundsManager.instance.Enabled = false;
_sound.gotoAndStop(2);
} else {
Cookie.instance.playerOptions["sound"] = true;
SoundsManager.instance.Enabled = true;
_sound.gotoAndStop(1);
};
SoundsManager.instance.playSound("otherclick", 1);
}
private function initEvent():void{
_newGame.addEventListener(MouseEvent.CLICK, clickNewGame);
_newGame.addEventListener(MouseEvent.ROLL_OVER, overMc);
_newGame.addEventListener(MouseEvent.ROLL_OUT, outMc);
_howToPlay.addEventListener(MouseEvent.CLICK, clickHowToPlay);
_howToPlay.addEventListener(MouseEvent.ROLL_OVER, overMc);
_howToPlay.addEventListener(MouseEvent.ROLL_OUT, outMc);
_sound.addEventListener(MouseEvent.CLICK, clickSound);
_music.addEventListener(MouseEvent.CLICK, clickMusic);
_quality.addEventListener(MouseEvent.CLICK, clickQuality);
}
private function delDis():void{
_root.removeChild(_mc);
_mc = null;
}
private function delEvent():void{
_newGame.removeEventListener(MouseEvent.CLICK, clickNewGame);
_newGame.removeEventListener(MouseEvent.ROLL_OVER, overMc);
_newGame.removeEventListener(MouseEvent.ROLL_OUT, outMc);
_howToPlay.removeEventListener(MouseEvent.CLICK, clickHowToPlay);
_howToPlay.removeEventListener(MouseEvent.ROLL_OVER, overMc);
_howToPlay.removeEventListener(MouseEvent.ROLL_OUT, outMc);
_sound.removeEventListener(MouseEvent.CLICK, clickSound);
_music.removeEventListener(MouseEvent.CLICK, clickMusic);
_quality.removeEventListener(MouseEvent.CLICK, clickQuality);
}
private function clickHowToPlay(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_press", 1);
_howToPlay.gotoAndStop(3);
Cookie.instance.playerTutorial["toTutorial"] = true;
_root.dispatchEvent(new Event(EventIn.START_GAME));
}
private function clickNewGame(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_press", 1);
SoundsManager.instance.playSound("napoleonstupid_menu", 1);
_newGame.gotoAndStop(3);
_root.dispatchEvent(new Event(EventIn.START_GAME));
}
private function clickMusic(event:MouseEvent):void{
SoundsManager.instance.playSound("otherclick", 1);
if (Cookie.instance.playerOptions["music"]){
Cookie.instance.playerOptions["music"] = false;
SoundsManager.instance.MusicEnable = false;
_music.gotoAndStop(2);
} else {
Cookie.instance.playerOptions["music"] = true;
SoundsManager.instance.MusicEnable = true;
_music.gotoAndStop(1);
};
}
private function initDis():void{
_mc = Attach.getMovieClip("MainMenu");
_root.addChild(_mc);
_newGame = _mc["newGame"];
_newGame.gotoAndStop(1);
_newGame.buttonMode = true;
_newGame.mouseChildren = false;
_howToPlay = _mc["howToPlay"];
_howToPlay.gotoAndStop(1);
_howToPlay.buttonMode = true;
_howToPlay.mouseChildren = false;
_sound = _mc["soundSwitch"];
if (Cookie.instance.playerOptions["sound"]){
_sound.gotoAndStop(1);
} else {
SoundsManager.instance.Enabled = false;
_sound.gotoAndStop(2);
};
_sound.buttonMode = true;
_sound.mouseChildren = false;
_music = _mc["musicSwitch"];
if (Cookie.instance.playerOptions["music"]){
_music.gotoAndStop(1);
} else {
SoundsManager.instance.MusicEnable = false;
_music.gotoAndStop(2);
};
_music.buttonMode = true;
_music.mouseChildren = false;
_quality = _mc["qualitySwitch"];
if (Cookie.instance.playerOptions["quality"] == "LOW"){
_quality.gotoAndStop(3);
_mc.stage.quality = "LOW";
} else {
if (Cookie.instance.playerOptions["quality"] == "HIGH"){
_quality.gotoAndStop(2);
_mc.stage.quality = "HIGH";
} else {
if (Cookie.instance.playerOptions["quality"] == "BEST"){
_quality.gotoAndStop(1);
_mc.stage.quality = "BEST";
};
};
};
_quality.buttonMode = true;
_quality.mouseChildren = false;
}
}
}//package ui
Section 146
//Maker_ui (ui.Maker_ui)
package ui {
import flash.display.*;
import flash.events.*;
import tools.*;
import zlong.breathxue.utils.*;
public class Maker_ui extends AbstractScreen {
private var b_back:MovieClip;
private var _mc:MovieClip;
public function Maker_ui(r:Sprite){
super(r);
initDis();
initEvent();
}
override public function destroy():void{
delEvent();
delDis();
}
private function delDis():void{
_root.removeChild(_mc);
_mc = null;
}
private function onClick(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_press", 1);
b_back.gotoAndStop(3);
_root.dispatchEvent(new Event(EventIn.MAIN_MENU));
}
private function delEvent():void{
b_back.removeEventListener(MouseEvent.CLICK, onClick);
b_back.removeEventListener(MouseEvent.MOUSE_OVER, onOver);
b_back.removeEventListener(MouseEvent.MOUSE_OUT, onOut);
}
private function initEvent():void{
b_back.addEventListener(MouseEvent.CLICK, onClick);
b_back.addEventListener(MouseEvent.MOUSE_OVER, onOver);
b_back.addEventListener(MouseEvent.MOUSE_OUT, onOut);
}
private function onOver(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_touch", 1);
(event.target as MovieClip).gotoAndStop(2);
}
private function onOut(event:MouseEvent):void{
(event.target as MovieClip).gotoAndStop(1);
}
private function initDis():void{
_mc = Attach.getMovieClip("maker");
b_back = _mc["b_back"];
b_back.gotoAndStop(1);
b_back.buttonMode = true;
b_back.mouseChildren = false;
_root.addChild(_mc);
}
}
}//package ui
Section 147
//Manage (ui.Manage)
package ui {
import flash.display.*;
import flash.events.*;
import game.*;
import tools.*;
public class Manage {
private var _root:Sprite;
private var _screen:AbstractScreen;
public static const XML_FINISH:String = "XML_FINISH";
public function Manage(root:Sprite):void{
super();
_root = root;
initData();
initEvent();
_screen = new MainMenuUI(_root);
}
private function clearScreen():void{
_screen.destroy();
}
private function onStartGame(event:Event):void{
clearScreen();
_screen = new GameSceneUI(_root);
}
private function onMaker(event:Event):void{
clearScreen();
_screen = new Maker_ui(_root);
}
private function onMainMene(event:Event):void{
clearScreen();
_screen = new MainMenuUI(_root);
}
private function initEvent():void{
_root.addEventListener(EventIn.MAIN_MENU, onMainMene);
_root.addEventListener(EventIn.MAKER, onMaker);
_root.addEventListener(EventIn.START_GAME, onStartGame);
}
private function initData():void{
Cookie.instance.init();
XmlManage.xmlInstance;
}
private function xmlFinish(event:Event):void{
_screen = new MainMenuUI(_root);
}
}
}//package ui
Section 148
//PauseUI (ui.PauseUI)
package ui {
import flash.display.*;
import flash.events.*;
import tools.*;
import zlong.breathxue.utils.*;
public class PauseUI extends AbstractScreen {
private var _howToPlay:MovieClip;
private var _quality:MovieClip;
private var _sound:MovieClip;
private var _backGame:MovieClip;
private var _music:MovieClip;
private var _ui:MovieClip;
private var _mc:MovieClip;
private var _quitGame:MovieClip;
public function PauseUI(r:Sprite):void{
super(r);
initDis();
SoundsManager.instance.pauseMusic();
}
override public function destroy():void{
delEvent();
delDis();
}
private function stop():void{
_ui.stop();
initEvent();
}
private function delDis():void{
_root.removeChild(_ui);
_ui = null;
}
private function outMc(event:MouseEvent):void{
(event.target as MovieClip).gotoAndStop(1);
}
private function clickQuitGame(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_press", 1);
_quitGame.gotoAndStop(3);
destroy();
_root.dispatchEvent(new Event(EventIn.MAIN_MENU));
}
private function overMc(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_touch", 1);
(event.target as MovieClip).gotoAndStop(2);
}
private function delEvent():void{
_sound.removeEventListener(MouseEvent.CLICK, clickSound);
_quality.removeEventListener(MouseEvent.CLICK, clickQuality);
_music.removeEventListener(MouseEvent.CLICK, clickMusic);
_howToPlay.removeEventListener(MouseEvent.CLICK, clickHowToPlay);
_howToPlay.removeEventListener(MouseEvent.ROLL_OVER, overMc);
_howToPlay.removeEventListener(MouseEvent.ROLL_OUT, outMc);
_quitGame.removeEventListener(MouseEvent.CLICK, clickQuitGame);
_quitGame.removeEventListener(MouseEvent.ROLL_OVER, overMc);
_quitGame.removeEventListener(MouseEvent.ROLL_OUT, outMc);
_backGame.removeEventListener(MouseEvent.CLICK, clickBackGame);
_backGame.removeEventListener(MouseEvent.ROLL_OVER, overMc);
_backGame.removeEventListener(MouseEvent.ROLL_OUT, outMc);
}
private function clickHowToPlay(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_press", 1);
_howToPlay.gotoAndStop(3);
destroy();
Cookie.instance.playerTutorial["toTutorial"] = true;
_root.dispatchEvent(new Event(EventIn.START_GAME));
}
private function initDis():void{
_ui = Attach.getMovieClip("pauseGame");
_ui.x = 325;
_ui.y = 175;
_ui.addFrameScript((_ui.totalFrames - 1), stop);
_root.addChild(_ui);
_mc = _ui["box"];
_sound = _mc["soundSwitch"];
if (Cookie.instance.playerOptions["sound"]){
_sound.gotoAndStop(1);
} else {
_sound.gotoAndStop(2);
};
_sound.buttonMode = true;
_sound.mouseChildren = false;
_music = _mc["musicSwitch"];
if (Cookie.instance.playerOptions["music"]){
_music.gotoAndStop(1);
} else {
_music.gotoAndStop(2);
};
_music.buttonMode = true;
_music.mouseChildren = false;
_quality = _mc["qualitySwitch"];
if (Cookie.instance.playerOptions["quality"] == "LOW"){
_quality.gotoAndStop(3);
} else {
if (Cookie.instance.playerOptions["quality"] == "HIGH"){
_quality.gotoAndStop(2);
} else {
if (Cookie.instance.playerOptions["quality"] == "BEST"){
_quality.gotoAndStop(1);
};
};
};
_quality.buttonMode = true;
_quality.mouseChildren = false;
_howToPlay = _mc["howToPlay"];
_howToPlay.gotoAndStop(1);
_howToPlay.buttonMode = true;
_howToPlay.mouseChildren = false;
_quitGame = _mc["quitGame"];
_quitGame.gotoAndStop(1);
_quitGame.buttonMode = true;
_quitGame.mouseChildren = false;
_backGame = _mc["backGame"];
_backGame.gotoAndStop(1);
_backGame.buttonMode = true;
_backGame.mouseChildren = false;
}
private function clickBackGame(event:MouseEvent):void{
SoundsManager.instance.restartMusic();
SoundsManager.instance.playSound("menu_press", 1);
_backGame.gotoAndStop(3);
destroy();
_root.dispatchEvent(new Event(EventIn.PAUSE_OVER));
}
private function clickSound(event:MouseEvent):void{
if (Cookie.instance.playerOptions["sound"]){
Cookie.instance.playerOptions["sound"] = false;
SoundsManager.instance.Enabled = false;
_sound.gotoAndStop(2);
} else {
Cookie.instance.playerOptions["sound"] = true;
SoundsManager.instance.Enabled = true;
_sound.gotoAndStop(1);
};
SoundsManager.instance.playSound("otherclick", 1);
}
private function clickQuality(event:MouseEvent):void{
SoundsManager.instance.playSound("otherclick", 1);
if (Cookie.instance.playerOptions["quality"] == "LOW"){
Cookie.instance.playerOptions["quality"] = "HIGH";
_mc.stage.quality = "HIGH";
_quality.gotoAndStop(2);
} else {
if (Cookie.instance.playerOptions["quality"] == "HIGH"){
Cookie.instance.playerOptions["quality"] = "BEST";
_mc.stage.quality = "BEST";
_quality.gotoAndStop(1);
} else {
if (Cookie.instance.playerOptions["quality"] == "BEST"){
Cookie.instance.playerOptions["quality"] = "LOW";
_mc.stage.quality = "LOW";
_quality.gotoAndStop(3);
};
};
};
}
private function initEvent():void{
_sound.addEventListener(MouseEvent.CLICK, clickSound);
_music.addEventListener(MouseEvent.CLICK, clickMusic);
_quality.addEventListener(MouseEvent.CLICK, clickQuality);
_howToPlay.addEventListener(MouseEvent.CLICK, clickHowToPlay);
_howToPlay.addEventListener(MouseEvent.ROLL_OVER, overMc);
_howToPlay.addEventListener(MouseEvent.ROLL_OUT, outMc);
_quitGame.addEventListener(MouseEvent.CLICK, clickQuitGame);
_quitGame.addEventListener(MouseEvent.ROLL_OVER, overMc);
_quitGame.addEventListener(MouseEvent.ROLL_OUT, outMc);
_backGame.addEventListener(MouseEvent.CLICK, clickBackGame);
_backGame.addEventListener(MouseEvent.ROLL_OVER, overMc);
_backGame.addEventListener(MouseEvent.ROLL_OUT, outMc);
}
private function clickMusic(event:MouseEvent):void{
SoundsManager.instance.playSound("otherclick", 1);
if (Cookie.instance.playerOptions["music"]){
Cookie.instance.playerOptions["music"] = false;
SoundsManager.instance.MusicEnable = false;
_music.gotoAndStop(2);
} else {
Cookie.instance.playerOptions["music"] = true;
SoundsManager.instance.MusicEnable = true;
SoundsManager.instance.pauseMusic();
_music.gotoAndStop(1);
};
}
}
}//package ui
Section 149
//TimeUpUI (ui.TimeUpUI)
package ui {
import flash.display.*;
import flash.events.*;
import zlong.spilSystemTool.*;
import tools.*;
import zlong.breathxue.utils.*;
import flash.text.*;
public class TimeUpUI extends AbstractScreen {
private var _scoreNum:int;
private var _shootFatmanCountText:TextField;
private var _hitNoteCountText:TextField;
private var _killCountText:TextField;
private var score_hitNoteCur:int;
private var _shootFatmanCount:int;
private var score_propCur:int;
private var _ui:MovieClip;
private var _mc:MovieClip;
private var score_killText:TextField;
private var _propCountText:TextField;
private var score_propText:TextField;
private var _menu:MovieClip;
private var score_shootFatmanText:TextField;
private var _tryAgain:MovieClip;
private var score_hitNoteText:TextField;
private var _scoreNumText:TextField;
private var _hitNoteCount:int;
private var _maker:MovieClip;
private var score_shootFatmanCur:int;
private var _killCount:int;
private var _scoreNumCur:int;
private var score_killCur:int;
private var score_kill:int;
private var score_shootFatman:int;
private var _propCount:int;
private var score_hitNote:int;
private var score_prop:int;
public function TimeUpUI(r:Sprite, scoreNum:int, killNum:int, score_kill:int, _shootFatmanCount:int, score_shootFatman:int, _shootPropCount:int, score_prop:int, _hitNoteCount:int, score_dance:int):void{
super(r);
this._scoreNum = scoreNum;
this._killCount = killNum;
this.score_kill = score_kill;
this._propCount = _shootPropCount;
this.score_prop = score_prop;
this._shootFatmanCount = _shootFatmanCount;
this.score_shootFatman = score_shootFatman;
this._hitNoteCount = _hitNoteCount;
this.score_hitNote = score_dance;
initDis();
SoundsManager.instance.playSound("游戏结束", 0.68);
SoundsManager.instance.stopMusic();
Award_HighScore.instance.submitScore(_scoreNum);
}
override public function destroy():void{
delEvent();
delDis();
}
private function delDis():void{
_root.removeChild(_ui);
_ui = null;
}
private function stop():void{
_ui.stop();
initEvent();
}
private function outMc(event:MouseEvent):void{
(event.target as MovieClip).gotoAndStop(1);
}
private function clickTryAgain(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_press", 1);
GoogleEvent.instance.gaTrackEvent("Press try again", true);
_tryAgain.gotoAndStop(1);
destroy();
_root.dispatchEvent(new Event(EventIn.START_GAME));
}
private function clickMenu(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_press", 1);
_menu.gotoAndStop(1);
destroy();
_root.dispatchEvent(new Event(EventIn.MAIN_MENU));
}
private function overMc(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_touch", 1);
(event.target as MovieClip).gotoAndStop(2);
}
private function clickMaker(event:MouseEvent):void{
SoundsManager.instance.playSound("menu_press", 1);
_maker.gotoAndStop(3);
_root.dispatchEvent(new Event(EventIn.MAKER));
}
private function run(event:Event):void{
score();
}
private function score():void{
if (score_killCur < score_kill){
score_killCur = (score_killCur + (score_kill / 10));
if (score_killCur > score_kill){
score_killCur = score_kill;
};
score_killText.text = String(score_killCur);
return;
};
if (score_propCur < score_prop){
score_propCur = (score_propCur + (score_prop / 10));
if (score_propCur >= score_prop){
score_propCur = score_prop;
};
score_propText.text = String(score_propCur);
return;
};
if (score_shootFatmanCur < score_shootFatman){
score_shootFatmanCur = (score_shootFatmanCur + (score_shootFatman / 10));
if (score_shootFatmanCur > score_shootFatman){
score_shootFatmanCur = score_shootFatman;
};
score_shootFatmanText.text = String(score_shootFatmanCur);
return;
};
if (score_hitNoteCur < score_hitNote){
score_hitNoteCur = (score_hitNoteCur + (score_hitNote / 10));
if (score_hitNoteCur > score_hitNote){
score_hitNoteCur = score_hitNote;
};
score_hitNoteText.text = String(score_hitNoteCur);
return;
};
if (_scoreNumCur < _scoreNum){
_scoreNumCur = (_scoreNumCur + (_scoreNum / 10));
if (_scoreNumCur > _scoreNum){
_scoreNumCur = _scoreNum;
};
_scoreNumText.text = String(_scoreNumCur);
return;
};
}
private function delEvent():void{
_mc.addEventListener(Event.ENTER_FRAME, run);
_menu.removeEventListener(MouseEvent.CLICK, clickMenu);
_menu.removeEventListener(MouseEvent.ROLL_OVER, overMc);
_menu.removeEventListener(MouseEvent.ROLL_OUT, outMc);
_tryAgain.removeEventListener(MouseEvent.CLICK, clickTryAgain);
_tryAgain.removeEventListener(MouseEvent.ROLL_OVER, overMc);
_tryAgain.removeEventListener(MouseEvent.ROLL_OUT, outMc);
_maker.removeEventListener(MouseEvent.CLICK, clickMaker);
_maker.removeEventListener(MouseEvent.ROLL_OVER, overMc);
_maker.removeEventListener(MouseEvent.ROLL_OUT, outMc);
}
private function initDis():void{
_ui = Attach.getMovieClip("TimeUp");
_ui.x = 325;
_ui.y = 175;
_ui.addFrameScript((_ui.totalFrames - 1), stop);
_root.addChild(_ui);
_mc = _ui["box"];
_menu = _mc["menu"];
_menu.gotoAndStop(1);
_menu.buttonMode = true;
_menu.mouseChildren = false;
_tryAgain = _mc["tryAgain"];
_tryAgain.gotoAndStop(1);
_tryAgain.buttonMode = true;
_tryAgain.mouseChildren = false;
_killCountText = _mc["killCount"];
_killCountText.selectable = false;
_killCountText.text = String(_killCount);
score_killText = _mc["score_kill"];
score_killText.selectable = false;
_propCountText = _mc["propCount"];
_propCountText.selectable = false;
_propCountText.text = String(_propCount);
score_propText = _mc["score_prop"];
score_propText.selectable = false;
_shootFatmanCountText = _mc["shootFatmanCount"];
_shootFatmanCountText.selectable = false;
_shootFatmanCountText.text = String(_shootFatmanCount);
score_shootFatmanText = _mc["score_shootFatman"];
score_shootFatmanText.selectable = false;
_hitNoteCountText = _mc["hitNoteCount"];
_hitNoteCountText.selectable = false;
_hitNoteCountText.text = String(_hitNoteCount);
score_hitNoteText = _mc["score_hitNote"];
score_hitNoteText.selectable = false;
_scoreNumText = _mc["scoreNum"];
_scoreNumText.selectable = false;
_maker = _mc["b_maker"];
_maker.gotoAndStop(1);
_maker.buttonMode = true;
_maker.mouseChildren = false;
}
private function initEvent():void{
_mc.addEventListener(Event.ENTER_FRAME, run);
_menu.addEventListener(MouseEvent.CLICK, clickMenu);
_menu.addEventListener(MouseEvent.ROLL_OVER, overMc);
_menu.addEventListener(MouseEvent.ROLL_OUT, outMc);
_tryAgain.addEventListener(MouseEvent.CLICK, clickTryAgain);
_tryAgain.addEventListener(MouseEvent.ROLL_OVER, overMc);
_tryAgain.addEventListener(MouseEvent.ROLL_OUT, outMc);
_maker.addEventListener(MouseEvent.CLICK, clickMaker);
_maker.addEventListener(MouseEvent.ROLL_OVER, overMc);
_maker.addEventListener(MouseEvent.ROLL_OUT, outMc);
}
}
}//package ui
Section 150
//AbstractEffect (zlong.breathxue.utils.animationEffect.AbstractEffect)
package zlong.breathxue.utils.animationEffect {
import flash.display.*;
import zlong.breathxue.utils.*;
import flash.utils.*;
public class AbstractEffect {
protected var _mc:DisplayObject;
protected var _id:uint;
protected var _isMerge:Boolean;
protected var _runframe:uint;
protected var _stepframe:uint;
protected var _frameTimerId:uint;
protected var _running:Boolean;
breathxue_utils_internal static const VERSION:String = "v1.14.201007011934";
public function AbstractEffect(){
super();
if (getQualifiedClassName(this) == "zlong::breathxue::utils::animationEffect::AbstractEffect"){
throw (new ArgumentError("can't be constructed"));
};
}
protected function initAbSet(id:uint, mc:DisplayObject, runframe:uint, isMerge:Boolean):void{
this._id = id;
this._mc = mc;
this._isMerge = isMerge;
this._runframe = runframe;
this._stepframe = 0;
this._frameTimerId = 0;
this._running = true;
if (this._mc == null){
throw (new ArgumentError("mc can't = null"));
};
}
function checkFinish():Boolean{
return (true);
}
function step():void{
}
function dispatchEvent():void{
}
function pause():void{
this._running = false;
if (this._frameTimerId != 0){
FrameTimer.pauseById(this._frameTimerId);
};
}
function reStart():void{
this._running = true;
if (this._frameTimerId != 0){
FrameTimer.reStartById(this._frameTimerId);
};
}
function del():void{
}
protected function delMeByFrameTimer():void{
this._frameTimerId = 0;
var _local1 = getDefinitionByName(getQualifiedClassName(this));
_local1["del"](this._id);
this.dispatchEvent();
}
function get mc():DisplayObject{
return (this._mc);
}
function get isMerge():Boolean{
return (this._isMerge);
}
function get id():uint{
return (this._id);
}
}
}//package zlong.breathxue.utils.animationEffect
Section 151
//EffectManager (zlong.breathxue.utils.animationEffect.EffectManager)
package zlong.breathxue.utils.animationEffect {
import flash.display.*;
import flash.events.*;
import zlong.breathxue.utils.animationEffect.*;
import zlong.breathxue.utils.*;
class EffectManager {
public var IdCount:uint;
private var _arr:Array;
breathxue_utils_internal static const VERSION:String = "v1.14.201007011934";
function EffectManager():void{
super();
this.IdCount = 0;
this._arr = new Array();
}
public function push(effect:AbstractEffect):uint{
this._arr.push(effect);
if (this._arr.length > 0){
GoddenEnterFrame.instance.addEventListener(Event.ENTER_FRAME, this.run);
};
return (this.IdCount++);
}
function findAndDeleteSameMcEffect(mc:DisplayObject, isMerge:Boolean):AbstractEffect{
var tempEffect:AbstractEffect;
var i:int = (this._arr.length - 1);
while (i >= 0) {
tempEffect = this._arr[i];
if (tempEffect.mc == mc){
if (((isMerge) && (tempEffect.isMerge))){
return (tempEffect);
};
this._arr.splice(i, 1);
};
i--;
};
return (null);
}
private function run(event:Event):void{
var tempEffect:AbstractEffect;
var tmc:AbstractEffect;
var i:int;
while (i < this._arr.length) {
tempEffect = this._arr[i];
if (tempEffect.checkFinish()){
tmc = (this._arr[i] as AbstractEffect);
this._arr.splice(i, 1);
tmc.dispatchEvent();
i--;
if (this._arr.length <= 0){
GoddenEnterFrame.instance.removeEventListener(Event.ENTER_FRAME, this.run);
};
} else {
tempEffect.step();
};
i++;
};
}
public function del(id:uint):void{
var i:int;
while (i < this._arr.length) {
if ((this._arr[i] as AbstractEffect).id == id){
(this._arr[i] as AbstractEffect).del();
this._arr.splice(i, 1);
if (this._arr.length <= 0){
GoddenEnterFrame.instance.removeEventListener(Event.ENTER_FRAME, this.run);
};
return;
};
i++;
};
}
public function delByMc(mc:DisplayObject):void{
var temp:AbstractEffect;
var i:int = (this._arr.length - 1);
while (i >= 0) {
temp = this._arr[i];
if (temp.mc == mc){
temp.del();
this._arr.splice(i, 1);
};
i--;
};
}
public function delAll():void{
var i:int;
while (i < this._arr.length) {
(this._arr[i] as AbstractEffect).del();
i++;
};
this._arr = new Array();
GoddenEnterFrame.instance.removeEventListener(Event.ENTER_FRAME, this.run);
}
public function pauseAll():void{
var i:int;
while (i < this._arr.length) {
(this._arr[i] as AbstractEffect).pause();
i++;
};
GoddenEnterFrame.instance.removeEventListener(Event.ENTER_FRAME, this.run);
}
public function reStartAll():void{
var i:int;
while (i < this._arr.length) {
(this._arr[i] as AbstractEffect).reStart();
i++;
};
GoddenEnterFrame.instance.addEventListener(Event.ENTER_FRAME, this.run);
}
}
}//package zlong.breathxue.utils.animationEffect
Section 152
//MoveEffect (zlong.breathxue.utils.animationEffect.MoveEffect)
package zlong.breathxue.utils.animationEffect {
import flash.display.*;
import flash.events.*;
import zlong.breathxue.utils.math.*;
import zlong.breathxue.utils.*;
public class MoveEffect extends AbstractEffect {
private var _position:mVector;
private var _EndPoint:mVector;
private var _stepVector:mVector;
breathxue_utils_internal static const VERSION:String = "v1.14.201007011934";
public static const Move_EFFECT_FINISH:String = "Move_EFFECT_FINISH";
private static var _effectManager:EffectManager = new EffectManager();
private function initSet(id:uint, mc:DisplayObject, StartPoint:mVector, EndPoint:mVector, stepDistance:Number, runframe:uint=0, stepVector:mVector=null, isMerge:Boolean=false, sameMcEffect:AbstractEffect=null):void{
super.initAbSet(id, mc, runframe, isMerge);
this._EndPoint = EndPoint;
this._stepVector = stepVector;
if ((((stepDistance == 0)) && ((runframe == 0)))){
throw (new ArgumentError("one of stepDistance or runframe need be setting"));
};
if (((!(this._EndPoint)) && (((!(stepVector)) || ((_runframe == 0)))))){
throw (new ArgumentError("if EndAlpha == NaN,then stepVector and runframe must be setting"));
};
if (StartPoint == null){
StartPoint = new mVector(_mc.x, _mc.y);
};
if (((isMerge) && (sameMcEffect))){
this._position = (sameMcEffect as MoveEffect)._position;
} else {
this._position = new mVector();
_mc.x = (this._position.x = StartPoint.x);
_mc.y = (this._position.y = StartPoint.y);
};
if (!this._EndPoint){
_frameTimerId = FrameTimer.push(new FrameTimer(_runframe), delMeByFrameTimer);
} else {
this._stepVector = this._EndPoint.minus(this._position);
if (_runframe > 0){
this._stepVector.multEquals((1 / (_runframe - _stepframe)));
} else {
this._stepVector.length = Math.abs(stepDistance);
};
};
}
override function step():void{
var tempStepDistance:Number;
if (!_running){
return;
};
if (this._EndPoint){
if (_runframe > 0){
this._stepVector = this._EndPoint.minus(this._position);
this._stepVector.multEquals((1 / (_runframe - _stepframe)));
_stepframe++;
} else {
tempStepDistance = this._stepVector.length;
this._stepVector = this._EndPoint.minus(this._position);
this._stepVector.length = Math.abs(tempStepDistance);
};
};
_mc.x = (this._position.x = (this._position.x + this._stepVector.x));
_mc.y = (this._position.y = (this._position.y + this._stepVector.y));
}
override function checkFinish():Boolean{
if (((this._EndPoint) && ((((((_runframe > 0)) && ((_stepframe >= _runframe)))) || ((this._EndPoint.minus(this._position).length <= Math.abs(this._stepVector.length))))))){
_mc.x = (this._position.x = this._EndPoint.x);
_mc.y = (this._position.y = this._EndPoint.y);
return (true);
};
return (false);
}
override function dispatchEvent():void{
_mc.dispatchEvent(new Event(Move_EFFECT_FINISH));
}
override function del():void{
this._position = null;
this._EndPoint = null;
this._stepVector = null;
if (_frameTimerId != 0){
FrameTimer.delById(_frameTimerId);
};
}
public static function push(mc:DisplayObject, StartPoint:mVector, EndPoint:mVector, stepDistance:Number, runframe:uint=0, stepVector:mVector=null, isMerge:Boolean=false):uint{
var sameMcEffect:AbstractEffect = _effectManager.findAndDeleteSameMcEffect(mc, isMerge);
var tempMoveEffect:MoveEffect = new (MoveEffect);
tempMoveEffect.initSet(_effectManager.IdCount, mc, StartPoint, EndPoint, stepDistance, runframe, stepVector, isMerge, sameMcEffect);
return (_effectManager.push(tempMoveEffect));
}
public static function del(id:uint):void{
_effectManager.del(id);
}
public static function delByMc(mc:DisplayObject):void{
_effectManager.delByMc(mc);
}
public static function delAll():void{
_effectManager.delAll();
}
public static function pauseAll():void{
_effectManager.pauseAll();
}
public static function reStartAll():void{
_effectManager.reStartAll();
}
}
}//package zlong.breathxue.utils.animationEffect
Section 153
//TC (zlong.breathxue.utils.debug.TC)
package zlong.breathxue.utils.debug {
import flash.display.*;
import flash.events.*;
import zlong.breathxue.utils.math.*;
import zlong.breathxue.utils.animationEffect.*;
import zlong.breathxue.utils.*;
import flash.text.*;
public class TC {
breathxue_utils_internal static const VERSION:String = "v1.14.201007011934";
static const TITLE_HEIGHT:int = 20;
private static var _tabArr:Array;
private static var _tabArrNum:Array;
static var _width:int;
static var _height:int;
private static var _MC:Sprite;
private static var _showMc:Sprite;
private static var _smallMc:Sprite;
private static var _nowEffect:Boolean;
public static function InitTC(mc:Sprite, width:int=0, height:int=0):void{
if (mc.stage == null){
return;
};
TcShow = true;
if (width == 0){
width = ((mc.stage.stageWidth / 3) * 2);
};
if (height == 0){
height = ((mc.stage.stageHeight / 3) * 2);
};
_width = width;
_height = height;
_MC = new Sprite();
mc.addChild(_MC);
_MC.alpha = 0.5;
_tabArr = new Array();
_tabArrNum = new Array();
createShow();
createSmall(width);
}
private static function createShow():void{
_showMc = new Sprite();
_MC.addChild(_showMc);
_showMc.addChild(maketitle(_width));
var temp:TC_Tab = new TC_Tab(_showMc, "*", 0, 2);
_tabArr["*"] = temp;
_tabArrNum.push("*");
temp = new TC_Tab(_showMc, "&NT&", 1, 2);
temp.visible = true;
_tabArr["&NT&"] = temp;
_tabArrNum.push("&NT&");
_MC.stage.addEventListener(KeyboardEvent.KEY_DOWN, openAndClose);
}
private static function maketitle(w:int):DisplayObject{
var handMc:Sprite = new Sprite();
handMc.graphics.beginFill(11187199);
handMc.graphics.drawRect(0, 0, w, TITLE_HEIGHT);
handMc.graphics.endFill();
handMc.doubleClickEnabled = true;
var titleText:TextField = new TextField();
titleText.text = "Debug Text ('ctrl + d' open and close it)";
titleText.width = w;
titleText.height = TITLE_HEIGHT;
titleText.mouseEnabled = false;
titleText.selectable = false;
handMc.addChild(titleText);
var closeButton:Sprite = new Sprite();
closeButton.graphics.beginFill(0, 0);
closeButton.graphics.drawRect(0, 0, 18, 18);
closeButton.graphics.endFill();
closeButton.graphics.lineStyle(2, 4084223);
closeButton.graphics.moveTo(6, 6);
closeButton.graphics.lineTo(12, 12);
closeButton.graphics.moveTo(12, 6);
closeButton.graphics.lineTo(6, 12);
closeButton.x = (w - 19);
closeButton.y = 1;
handMc.addChild(closeButton);
closeButton.addEventListener(MouseEvent.CLICK, openAndClose);
handMc.addEventListener(MouseEvent.DOUBLE_CLICK, openAndClose);
handMc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
handMc.addEventListener(MouseEvent.MOUSE_UP, endMove);
return (handMc);
}
private static function createSmall(w:int):void{
_smallMc = new Sprite();
_smallMc.y = -20;
var handMc:Sprite = new Sprite();
handMc.y = 0;
handMc.graphics.beginFill(11187199);
handMc.graphics.drawRect(0, 0, (w / 2), TITLE_HEIGHT);
handMc.graphics.endFill();
handMc.doubleClickEnabled = true;
var titleText:TextField = new TextField();
titleText.text = "Debug Text";
titleText.width = (w / 2);
titleText.height = TITLE_HEIGHT;
titleText.mouseEnabled = false;
titleText.selectable = false;
handMc.addChild(titleText);
_smallMc.addChild(handMc);
handMc.addEventListener(MouseEvent.DOUBLE_CLICK, openAndClose);
}
private static function openAndClose(event:Event):void{
var e:KeyboardEvent = (event as KeyboardEvent);
if (((!(_nowEffect)) && (((!(e)) || (((e.ctrlKey) && ((e.keyCode == 68)))))))){
if (_showMc.parent == null){
MoveEffect.push(_smallMc, new mVector(0, -20), new mVector(_showMc.x, _showMc.y), 0, 5);
_smallMc.addEventListener(MoveEffect.Move_EFFECT_FINISH, EffectFinish);
_nowEffect = true;
} else {
_showMc.visible = false;
_MC.addChild(_smallMc);
MoveEffect.push(_smallMc, new mVector(_showMc.x, _showMc.y), new mVector(0, -20), 0, 5);
_smallMc.addEventListener(MoveEffect.Move_EFFECT_FINISH, EffectFinish);
_nowEffect = true;
};
};
}
private static function EffectFinish(event:Event):void{
_smallMc.removeEventListener(MoveEffect.Move_EFFECT_FINISH, EffectFinish);
_nowEffect = false;
if (_showMc.parent == null){
_showMc.visible = true;
_MC.addChild(_showMc);
_MC.removeChild(_smallMc);
} else {
_MC.removeChild(_showMc);
};
}
private static function endMove(event:MouseEvent):void{
_showMc.stopDrag();
}
private static function startMove(event:MouseEvent):void{
_showMc.startDrag();
}
public static function SHOW(type:String, arg:Array):void{
var i:int;
if (_MC){
if (type != ""){
if (!(_tabArr[type] is TC_Tab)){
_tabArr[type] = new TC_Tab(_showMc, type, _tabArrNum.length, (_tabArrNum.length + 1));
_tabArrNum.push(type);
i = 0;
while (i < _tabArrNum.length) {
(_tabArr[_tabArrNum[i]] as TC_Tab).updateTabTitle(i, _tabArrNum.length);
i++;
};
};
(_tabArr[type] as TC_Tab).show((((Tools.getNowTimeAndMileSecond_1() + ": ") + arg.join(" ")) + "\n"));
} else {
(_tabArr["&NT&"] as TC_Tab).show((((Tools.getNowTimeAndMileSecond_1() + ": ") + arg.join(" ")) + "\n"));
};
(_tabArr["*"] as TC_Tab).show((((Tools.getNowTimeAndMileSecond_1() + ": ") + arg.join(" ")) + "\n"));
_MC.parent.setChildIndex(_MC, (_MC.parent.numChildren - 1));
};
}
public static function onTabTitle(name:String):void{
var i:String;
for (i in _tabArr) {
if ((_tabArr[i] is TC_Tab)){
(_tabArr[i] as TC_Tab).visible = false;
};
};
(_tabArr[name] as TC_Tab).visible = true;
}
}
}//package zlong.breathxue.utils.debug
Section 154
//TC_Tab (zlong.breathxue.utils.debug.TC_Tab)
package zlong.breathxue.utils.debug {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class TC_Tab {
private var _pmc:DisplayObjectContainer;
private var _name:String;
private var _tabTitle:Sprite;
private var _Text:TextField;
private var _tabBaby:Sprite;
private static const colorArr:Array = [14541311, 10079385, 16777164, 13434828, 16724889, 6710988, 14541311, 10079385, 16777164, 13434828, 16724889, 6710988, 14541311, 10079385, 16777164, 13434828, 16724889, 6710988, 14541311, 10079385, 16777164, 13434828, 16724889, 6710988, 14541311, 10079385, 16777164, 13434828, 16724889, 6710988, 14541311, 10079385, 16777164, 13434828, 16724889, 6710988, 14541311, 10079385, 16777164, 13434828, 16724889, 6710988, 14541311, 10079385, 16777164, 13434828, 16724889, 6710988, 14541311, 10079385, 16777164, 13434828, 16724889, 6710988, 14541311, 10079385, 16777164, 13434828, 16724889, 6710988];
static var TabTitleHeight:Number = 20;
static var maxWidth:Number = 80;
public function TC_Tab(pmc:DisplayObjectContainer, name:String, id:uint, totalNum:uint){
super();
this._pmc = pmc;
this._name = name;
this.createTabTitle(id, totalNum);
this.createTabBady(id);
}
private function createTabTitle(id:uint, totalNum:uint):void{
this._tabTitle = new Sprite();
this._pmc.addChild(this._tabTitle);
this._tabTitle.y = TC.TITLE_HEIGHT;
this._tabTitle.addEventListener(MouseEvent.CLICK, this.onTabTitle);
this.updateTabTitle(id, totalNum);
var tabtitle:TextField = new TextField();
this._tabTitle.addChild(tabtitle);
tabtitle.text = this._name;
tabtitle.mouseEnabled = false;
tabtitle.selectable = false;
}
private function onTabTitle(event:MouseEvent):void{
TC.onTabTitle(this._name);
}
function updateTabTitle(id:uint, totalNum:uint):void{
var tabWidth:Number = (((TC._width / totalNum) > maxWidth)) ? maxWidth : (TC._width / totalNum);
this._tabTitle.graphics.clear();
this._tabTitle.graphics.beginFill(colorArr[id]);
this._tabTitle.graphics.drawRect(0, 0, tabWidth, TabTitleHeight);
this._tabTitle.graphics.endFill();
this._tabTitle.x = (tabWidth * id);
}
private function createTabBady(id:uint):void{
this._tabBaby = new Sprite();
this._pmc.addChild(this._tabBaby);
this._tabBaby.visible = false;
this._tabBaby.y = (TC.TITLE_HEIGHT + TabTitleHeight);
this._tabBaby.graphics.beginFill(colorArr[id]);
this._tabBaby.graphics.drawRect(0, 0, TC._width, ((TC._height - TC.TITLE_HEIGHT) - TabTitleHeight));
this._tabBaby.graphics.endFill();
this._Text = new TextField();
this._Text.width = TC._width;
this._Text.height = ((TC._height - TC.TITLE_HEIGHT) - TabTitleHeight);
this._tabBaby.addChild(this._Text);
this._Text.multiline = true;
this._Text.mouseWheelEnabled = true;
this._Text.wordWrap = true;
}
public function show(string:String):void{
var t:int = this._Text.scrollV;
this._Text.appendText(string);
if (this._Text.length != this._Text.selectionEndIndex){
this._Text.scrollV = t;
} else {
this._Text.scrollV = this._Text.numLines;
};
}
public function set visible(v:Boolean):void{
this._tabBaby.visible = v;
}
public function get name():String{
return (this._name);
}
public function set name(value:String):void{
this._name = value;
}
}
}//package zlong.breathxue.utils.debug
Section 155
//TcShow (zlong.breathxue.utils.debug.TcShow)
package zlong.breathxue.utils.debug {
public var TcShow:Boolean = false;
}//package zlong.breathxue.utils.debug
Section 156
//mVector (zlong.breathxue.utils.math.mVector)
package zlong.breathxue.utils.math {
public class mVector {
private var m_x:Number;
private var m_y:Number;
breathxue_utils_internal static const VERSION:String = "v1.14.201007011934";
public function mVector(px:Number=0, py:Number=0){
super();
this.m_x = px;
this.m_y = py;
}
public function setTo(px:Number, py:Number):void{
this.m_x = px;
this.m_y = py;
}
public function copyFrom(v:mVector):void{
this.m_x = v.m_x;
this.m_y = v.m_y;
}
public function toString():String{
var rx:Number = (Math.round((this.m_x * 1000)) / 1000);
var ry:Number = (Math.round((this.m_y * 1000)) / 1000);
return ((((("[" + rx) + ", ") + ry) + "]"));
}
public function clone():mVector{
return (new mVector(this.m_x, this.m_y));
}
public function plus(v:mVector):mVector{
return (new mVector((this.m_x + v.m_x), (this.m_y + v.m_y)));
}
public function plusEquals(v:mVector):mVector{
this.m_x = (this.m_x + v.m_x);
this.m_y = (this.m_y + v.m_y);
return (this);
}
public function minus(v:mVector):mVector{
return (new mVector((this.m_x - v.m_x), (this.m_y - v.m_y)));
}
public function minusEquals(v:mVector):mVector{
this.m_x = (this.m_x - v.m_x);
this.m_y = (this.m_y - v.m_y);
return (this);
}
public function negate():mVector{
return (new mVector(-(this.m_x), -(this.m_y)));
}
public function negateEquals():void{
this.m_x = -(this.m_x);
this.m_y = -(this.m_y);
}
public function mult(s:Number):mVector{
return (new mVector((this.m_x * s), (this.m_y * s)));
}
public function multEquals(s:Number):mVector{
this.m_x = (this.m_x * s);
this.m_y = (this.m_y * s);
return (this);
}
public function rotate(ang:Number):mVector{
var v:mVector = new mVector(this.m_x, this.m_y);
v.rotateEquals(ang);
return (v);
}
public function rotateEquals(ang:Number):void{
var ca:Number = TF_Class.cosD(ang);
var sa:Number = TF_Class.sinD(ang);
var rx:Number = ((this.m_x * ca) - (this.m_y * sa));
var ry:Number = ((this.m_x * sa) + (this.m_y * ca));
this.m_x = rx;
this.m_y = ry;
}
public function dot(v:mVector):Number{
return (((this.m_x * v.m_x) + (this.m_y * v.m_y)));
}
public function cross(v:mVector):Number{
return (((this.m_x * v.m_y) - (this.m_y * v.m_x)));
}
public function times(v:mVector):mVector{
return (new mVector((this.m_x * v.m_x), (this.m_y * v.m_y)));
}
public function divEquals(s:Number):mVector{
if (s == 0){
s = 0.0001;
};
this.m_x = (this.m_x / s);
this.m_y = (this.m_y / s);
return (this);
}
public function distance(v:mVector):Number{
var delta:mVector = this.minus(v);
return (delta.length);
}
public function normalize():mVector{
var m:Number = this.length;
if (m == 0){
m = 0.0001;
};
return (this.mult((1 / m)));
}
public function getNormal():mVector{
return (new mVector(-(this.m_y), this.m_x));
}
public function isNormalTo(v:mVector):Boolean{
return ((this.dot(v) == 0));
}
public function angleBetween(v:mVector):Number{
var dp:Number = this.dot(v);
var cosAngle:Number = (dp / (this.length * v.length));
return (TF_Class.acosD(cosAngle));
}
public function get length():Number{
return (Math.sqrt(((this.m_x * this.m_x) + (this.m_y * this.m_y))));
}
public function set length(len:Number):void{
var r:Number = this.length;
if (r){
this.multEquals((len / r));
} else {
this.m_x = len;
};
}
public function set angle(ang:Number):void{
var r:Number = this.length;
this.m_x = (r * TF_Class.cosD(ang));
this.m_y = (r * TF_Class.sinD(ang));
}
public function get angle():Number{
return (TF_Class.atan2D(this.m_y, this.m_x));
}
public function set x(x:Number):void{
this.m_x = x;
}
public function get x():Number{
return (this.m_x);
}
public function set y(y:Number):void{
this.m_y = y;
}
public function get y():Number{
return (this.m_y);
}
}
}//package zlong.breathxue.utils.math
Section 157
//TF_Class (zlong.breathxue.utils.math.TF_Class)
package zlong.breathxue.utils.math {
public class TF_Class {
breathxue_utils_internal static const VERSION:String = "v1.14.201007011934";
public static function sinD(angle:Number):Number{
return (Math.sin((angle * (Math.PI / 180))));
}
public static function cosD(angle:Number):Number{
return (Math.cos((angle * (Math.PI / 180))));
}
public static function tanD(angle:Number):Number{
return (Math.tan((angle * (Math.PI / 180))));
}
public static function asinD(ratio:Number):Number{
return ((Math.asin(ratio) * (180 / Math.PI)));
}
public static function acosD(ratio:Number):Number{
return ((Math.acos(ratio) * (180 / Math.PI)));
}
public static function atanD(ratio:Number):Number{
return ((Math.atan(ratio) * (180 / Math.PI)));
}
public static function atan2D(y:Number, x:Number):Number{
return ((Math.atan2(y, x) * (180 / Math.PI)));
}
public static function distance(x1:Number, y1:Number, x2:Number, y2:Number):Number{
var dx:Number = (x2 - x1);
var dy:Number = (y2 - y1);
return (Math.sqrt(((dx * dx) + (dy * dy))));
}
public static function angleOfLine(x1:Number, y1:Number, x2:Number, y2:Number):Number{
return (atan2D((y2 - y1), (x2 - x1)));
}
public static function degreesToRadians(angle:Number):Number{
return ((angle * (Math.PI / 180)));
}
public static function radiansToDegrees(angle:Number):Number{
return ((angle * (180 / Math.PI)));
}
public static function fixAngle(angle:Number):Number{
angle = (angle % 360);
return (((angle)<0) ? (angle + 360) : angle);
}
public static function cartesianToPolar(p:mVector):Object{
var radius:Number = Math.sqrt(((p.x * p.x) + (p.y * p.y)));
var theta:Number = atan2D(p.y, p.x);
return ({r:radius, t:theta});
}
public static function FormatAngle(r:Number):Number{
r = (r % 360);
if (r > 180){
r = (r - 360);
};
if (r < -180){
r = (r + 360);
};
return (r);
}
public static function FormatAngle90(r:Number):Number{
r = (r % 180);
if (r > 90){
r = (180 - r);
};
if (r < -90){
r = (r + 180);
};
return (r);
}
}
}//package zlong.breathxue.utils.math
Section 158
//Attach (zlong.breathxue.utils.Attach)
package zlong.breathxue.utils {
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class Attach {
breathxue_utils_internal static const VERSION:String = "v1.14.201007011934";
public static function getDisplayObject(s:String):DisplayObject{
var temp:Class = (getDefinitionByName(s) as Class);
var returnObj:DisplayObject = new (temp);
return (returnObj);
}
public static function getSprite(s:String):Sprite{
var temp:Class = (getDefinitionByName(s) as Class);
var returnObj:Sprite = new (temp);
return (returnObj);
}
public static function getMovieClip(s:String):MovieClip{
var temp:Class = (getDefinitionByName(s) as Class);
var returnObj:MovieClip = new (temp);
return (returnObj);
}
public static function getBitmapData(s:String):BitmapData{
var temp:Class = (getDefinitionByName(s) as Class);
var returnObj:BitmapData = new temp(null, null);
return (returnObj);
}
public static function getSound(s:String):Sound{
var temp:Class = (getDefinitionByName(s) as Class);
var returnObj:Sound = new (temp);
return (returnObj);
}
}
}//package zlong.breathxue.utils
Section 159
//breathxue_utils_internal (zlong.breathxue.utils.breathxue_utils_internal)
package zlong.breathxue.utils {
public namespace breathxue_utils_internal = "http://www.zlonggames.com/flash/breathxue/utils/internal";
}//package zlong.breathxue.utils
Section 160
//FrameTimer (zlong.breathxue.utils.FrameTimer)
package zlong.breathxue.utils {
import flash.display.*;
import flash.events.*;
public class FrameTimer implements IEventDispatcher {
private var _ED:EventDispatcher;
private var _running:Boolean;
private var _runframe:uint;
private var _cycleNum:uint;
private var _step:uint;
private var _id:uint;
private var _returnFunctionAlarm:Function;
private var _returnFunctionFinish:Function;
breathxue_utils_internal static const VERSION:String = "v1.14.201007011934";
public static const FRAMETIMER_ALARM:String = "FRAMETIMER_ALARM";
public static const FRAMETIMER_FINISH:String = "FRAMETIMER_FINISH";
private static var IdCount:uint = 1;
private static var _arr:Array = new Array();
public function FrameTimer(runframe:uint, cycleNum:uint=0, Millisecond:uint=0, mc:DisplayObject=null){
super();
this._running = true;
this._step = 0;
this._runframe = runframe;
this._cycleNum = cycleNum;
this._ED = new EventDispatcher(this);
if ((((Millisecond > 0)) && (mc))){
if (!mc.stage){
throw (new ArgumentError("mc didn`t connect stage"));
};
this._runframe = uint(((Millisecond / 1000) * mc.stage.frameRate));
};
this._id = FrameTimer.add(this);
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
this._ED.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
this._ED.removeEventListener(type, listener, useCapture);
}
public function dispatchEvent(event:Event):Boolean{
return (this._ED.dispatchEvent(event));
}
public function hasEventListener(type:String):Boolean{
return (this._ED.hasEventListener(type));
}
public function willTrigger(type:String):Boolean{
return (this._ED.willTrigger(type));
}
public function pause():void{
this._running = false;
}
public function reStart():void{
this._running = true;
}
public function del():void{
FrameTimer.delById(this._id);
}
public function get id():uint{
return (this._id);
}
public static function push(fTimer:FrameTimer, returnFunctionAlarm:Function=null, returnFunctionFinish:Function=null):uint{
fTimer._returnFunctionAlarm = returnFunctionAlarm;
fTimer._returnFunctionFinish = returnFunctionFinish;
return (fTimer._id);
}
private static function add(fTimer:FrameTimer, returnFunctionAlarm:Function=null, returnFunctionFinish:Function=null):uint{
_arr.push(fTimer);
if (_arr.length > 0){
GoddenEnterFrame.instance.addEventListener(Event.ENTER_FRAME, run);
};
return (IdCount++);
}
private static function run(event:Event):void{
var tempFrameTimer:FrameTimer;
var i:int;
while (i < _arr.length) {
tempFrameTimer = _arr[i];
if (!tempFrameTimer._running){
} else {
if (tempFrameTimer._step >= tempFrameTimer._runframe){
tempFrameTimer._ED.dispatchEvent(new Event(FRAMETIMER_ALARM));
if (tempFrameTimer._returnFunctionAlarm != null){
tempFrameTimer._returnFunctionAlarm();
};
tempFrameTimer._step = 0;
tempFrameTimer._step++;
if (tempFrameTimer._cycleNum <= 0){
tempFrameTimer._ED.dispatchEvent(new Event(FRAMETIMER_FINISH));
if (tempFrameTimer._returnFunctionFinish != null){
tempFrameTimer._returnFunctionFinish();
};
_arr.splice(i, 1);
i--;
if (_arr.length <= 0){
GoddenEnterFrame.instance.removeEventListener(Event.ENTER_FRAME, run);
};
} else {
tempFrameTimer._cycleNum--;
};
} else {
tempFrameTimer._step++;
};
};
i++;
};
}
public static function pauseById(id:uint):void{
var i:int;
while (i < _arr.length) {
if ((_arr[i] as FrameTimer)._id == id){
(_arr[i] as FrameTimer).pause();
};
i++;
};
}
public static function reStartById(id:uint):void{
var i:int;
while (i < _arr.length) {
if ((_arr[i] as FrameTimer)._id == id){
(_arr[i] as FrameTimer).reStart();
};
i++;
};
}
public static function delById(id:uint):void{
var i:int;
while (i < _arr.length) {
if ((_arr[i] as FrameTimer)._id == id){
_arr.splice(i, 1);
if (_arr.length <= 0){
GoddenEnterFrame.instance.removeEventListener(Event.ENTER_FRAME, run);
};
return;
};
i++;
};
}
public static function delAll():void{
_arr = new Array();
GoddenEnterFrame.instance.removeEventListener(Event.ENTER_FRAME, run);
}
public static function pauseAll():void{
GoddenEnterFrame.instance.removeEventListener(Event.ENTER_FRAME, run);
}
public static function reStartAll():void{
GoddenEnterFrame.instance.addEventListener(Event.ENTER_FRAME, run);
}
}
}//package zlong.breathxue.utils
Section 161
//GoddenEnterFrame (zlong.breathxue.utils.GoddenEnterFrame)
package zlong.breathxue.utils {
import flash.display.*;
import flash.events.*;
public class GoddenEnterFrame extends EventDispatcher {
private var _listenerMc:DisplayObject;
private var _controlFunction:Function;
private static var _instance:GoddenEnterFrame;
public function GoddenEnterFrame(target:IEventDispatcher=null){
super(target);
this._controlFunction = this.undefinedControlFunction;
this._listenerMc = new Bitmap();
this._listenerMc.addEventListener(Event.ENTER_FRAME, this.run);
}
private function run(event:Event):void{
this._controlFunction(event);
}
private function undefinedControlFunction(event:Event):void{
dispatchEvent(event);
}
public function set controlFunction(f:Function):void{
this._controlFunction = f;
}
public static function get instance():GoddenEnterFrame{
if (!_instance){
_instance = new (GoddenEnterFrame);
};
return (_instance);
}
}
}//package zlong.breathxue.utils
Section 162
//Tools (zlong.breathxue.utils.Tools)
package zlong.breathxue.utils {
import flash.display.*;
import flash.geom.*;
public class Tools {
breathxue_utils_internal static const VERSION:String = "v1.14.201007011934";
public static function getNowTimeAndMileSecond_1():String{
var time:Date = new Date();
var h:int = time.getHours();
var m:int = time.getMinutes();
var s:int = time.getSeconds();
var ms:int = time.getMilliseconds();
return (((((((((h < 10)) ? ("0" + h) : h + ":") + ((m < 10)) ? ("0" + m) : m) + ":") + ((s < 10)) ? ("0" + s) : s) + ":") + ((ms < 10)) ? ("00" + ms) : ((ms < 100)) ? ("0" + ms) : ms));
}
public static function cutBmp(_mc:DisplayObject, _bmpDataWidth:int, _bmpDataHeight:int, _cutStartX:int, _cutStartY:int, _cutBmpWidth:int, _cutBmpHeight:int):BitmapData{
var bitmapData:BitmapData;
var rectangle:Rectangle;
var matrix:Matrix = new Matrix();
matrix.tx = -(_cutStartX);
matrix.ty = -(_cutStartY);
rectangle = new Rectangle(0, 0, _cutBmpWidth, _cutBmpHeight);
bitmapData = new BitmapData(_bmpDataWidth, _bmpDataHeight, true, 0);
bitmapData.draw(_mc, matrix, null, null, rectangle, true);
return (bitmapData);
}
}
}//package zlong.breathxue.utils
Section 163
//Countries (zlong.country.Countries)
package zlong.country {
import zlong.country.*;
import zlong.*;
class Countries {
private var _countries:Object;
private var _portal:String;
private var _portalGroup:Array;
private var _country:String;
private var _countryGroup:Array;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
function Countries(){
super();
this.initPortalGroup();
}
function set portal(gameType:String):void{
if (!this.inArray(gameType, this._portalGroup)){
throw (new ArgumentError(("Please set portal with value : " + this._portalGroup.toString())));
};
this._portal = gameType;
this.initCountries();
if (((!((this._country == null))) && (!(this.inArray(this._country, this._countryGroup))))){
throw (new ArgumentError(("Please reset country with value : " + this._countryGroup.toString())));
};
}
function get portal():String{
return (this._portal);
}
function set country(name:String):void{
if (((!((this._countryGroup == null))) && (!(this.inArray(name, this._countryGroup))))){
this._country = this._countryGroup[0];
trace(("Error in the country value,set country with default value : " + this._countryGroup[0]));
trace(("Please set country with value : " + this._countryGroup.toString()));
} else {
this._country = name;
};
}
function get current():CountryItem{
if (this._portal == null){
throw (new ArgumentError("Please set portal"));
};
if (this._country == null){
throw (new ArgumentError("Please set country"));
};
return (this._countries[this._country]);
}
function get countryGroup():Array{
if (this._countryGroup == null){
throw (new ArgumentError("Please set portal"));
};
return (this._countryGroup);
}
private function initCountries():void{
var countryItem:CountryItem;
var name:String;
var domain:String;
var game:String;
var language:int;
this._countries = new Object();
this._countryGroup = new Array();
var i:int;
while (i < CountriesData.DATA[this._portal]["country"].length()) {
name = CountriesData.DATA[this._portal]["country"][i].@name;
domain = CountriesData.DATA[this._portal]["country"][i].@domain;
game = CountriesData.DATA[this._portal]["country"][i].@game;
language = int(CountriesData.DATA[this._portal]["country"][i].@language);
countryItem = new CountryItem();
countryItem.name = name;
countryItem.domain = domain;
countryItem.game = game;
countryItem.language = language;
this._countries[countryItem.name] = countryItem;
this._countryGroup.push(name);
i++;
};
}
private function initPortalGroup():void{
this._portalGroup = new Array();
var i:int;
while (i < CountriesData.DATA.children().length()) {
this._portalGroup.push(CountriesData.DATA.children()[i].name());
i++;
};
}
private function inArray(str:String, arr:Array):Boolean{
var i:int;
while (i < arr.length) {
if (str == arr[i]){
return (true);
};
i++;
};
return (false);
}
}
}//package zlong.country
Section 164
//CountriesData (zlong.country.CountriesData)
package zlong.country {
import zlong.*;
class CountriesData {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
static const DATA:XML = <data>
<family>
<!-- new -->
<country name="arg" domain="www.juegos.com.ar" game="game" language="6"/><!-- Argentina -->
<country name="mx" domain="www.juegos.mx" game="game" language="6"/><!-- Mexico -->
<country name="ar" domain="www.dailygame.com" game="game" language="1"/><!-- Arabic(English US) 2009.07.14-->
<country name="br" domain="www.ojogos.com.br" game="jogo" language="7"/><!-- Brazillian -->
<country name="cn" domain="www.game.com.cn" game="moregames" language="17"/><!-- Chinese -->
<country name="de" domain="www.jetztspielen.de" game="spiel" language="5"/><!-- German -->
<country name="es" domain="www.juegos.com" game="juego" language="6"/><!-- Spanish -->
<country name="fr" domain="www.jeux.fr" game="jeu" language="4"/><!-- French -->
<country name="id" domain="www.games.co.id" game="permainanme" language="14"/><!-- Indonesian -->
<country name="in" domain="www.game.co.in" game="game" language="2"/><!-- English UK -->
<country name="it" domain="www.gioco.it" game="gioco" language="9"/><!-- Italian -->
<country name="jp" domain="www.egames.jp" game="game" language="16"/><!-- Japanese -->
<country name="nl" domain="www.spelletjes.nl" game="spel" language="3"/><!-- Dutch -->
<country name="pl" domain="www.gry.pl" game="gra" language="11"/><!-- Polish -->
<country name="pt" domain="www.ojogos.pt" game="jogo" language="8"/><!-- Portuguese -->
<country name="ru" domain="www.ourgames.ru" game="igra" language="12"/><!-- Russian -->
<country name="se" domain="www.spela.se" game="spel_" language="10"/><!-- Swedish -->
<country name="en_uk" domain="www.games.co.uk" game="game" language="2"/><!-- English UK -->
<country name="en_us" domain="www.gamesgames.com" game="game" language="1"/><!-- English US -->
<!-- removed -->
<!-- country name="ph" domain="www.laro.com.ph" game="game" language="2"/ --><!-- English UK -->
<!-- country name="tr" domain="www.asoyun.com" game="oyun" language="13"/ --><!-- Turkish -->
<!-- country name="my" domain="www.game.com.my" game="permainan_" language="15"/ --><!-- Malaysian -->
</family>
<tween>
<!-- new -->
<country name="arg" domain="www.juegos.com.ar" game="game" language="6"/><!-- Argentina -->
<country name="mx" domain="www.juegos.mx" game="game" language="6"/><!-- Mexico -->
<country name="ar" domain="www.dailygame.com" game="game" language="1"/><!-- Arabic(English US) 2009.07.14 -->
<country name="br" domain="www.clickjogos.com" game="jogo" language="7"/><!-- Brazillian -->
<country name="cn" domain="www.game.com.cn" game="moregames" language="17"/><!-- Chinese -->
<country name="de" domain="www.spielen.com" game="spiel" language="5"/><!-- German -->
<country name="es" domain="www.zapjuegos.com" game="juego" language="6"/><!-- Spanish -->
<country name="fr" domain="www.jeu.fr" game="jeu" language="4"/><!-- French -->
<country name="id" domain="www.games.co.id" game="permainanme" language="14"/><!-- Indonesian -->
<country name="in" domain="www.game.co.in" game="game" language="2"/><!-- English UK -->
<country name="it" domain="www.gioco.it" game="gioco" language="9"/><!-- Italian 2009.08.10 -->
<country name="jp" domain="www.egames.jp" game="game" language="16"/><!-- Japanese -->
<country name="nl" domain="www.spel.nl" game="spel" language="3"/><!-- Dutch -->
<country name="pl" domain="www.gry.pl" game="gra" language="11"/><!-- Polish 2009.08.10-->
<country name="pt" domain="www.ojogos.pt" game="jogo" language="8"/><!-- Portuguese -->
<country name="ru" domain="www.flashgames.ru" game="igra" language="12"/><!-- Russian -->
<country name="se" domain="www.spel.se" game="spel_" language="10"/><!-- Swedish -->
<country name="en_uk" domain="www.agame.com" game="game" language="2"/><!-- English UK 2009.08.28-->
<country name="en_us" domain="www.agame.com" game="game" language="1"/><!-- English US -->
<!-- removed -->
<!-- country name="ph" domain="www.laro.com.ph" game="game" language="2"/ --><!-- English UK -->
<!-- country name="tr" domain="www.asoyun.com" game="oyun" language="13"/ --><!-- Turkish -->
<!-- country name="my" domain="www.game.com.my" game="permainan_" language="15"/ --><!-- Malaysian -->
</tween>
<girl>
<!-- new -->
<country name="arg" domain="www.juegosdechicas.com.ar" game="game" language="6"/><!-- Argentina -->
<country name="mx" domain="www.juegosdechicas.mx" game="game" language="6"/><!-- Mexico -->
<country name="ar" domain="www.dailygame.com" game="game" language="1"/><!-- Arabic(English US) 2009.07.14-->
<country name="br" domain="www.girlsgogames.com.br" game="jogo" language="7"/><!-- Brazillian -->
<country name="cn" domain="www.game.com.cn" game="moregames" language="17"/><!-- Chinese -->
<country name="de" domain="www.girlsgogames.de" game="spiel" language="5"/><!-- German -->
<country name="es" domain="www.girlsgogames.es" game="juego" language="6"/><!-- Spanish -->
<country name="fr" domain="www.girlsgogames.fr" game="jeu" language="4"/><!-- French -->
<country name="id" domain="www.games.co.id" game="permainanme" language="14"/><!-- Indonesian -->
<country name="in" domain="www.game.co.in" game="game" language="2"/><!-- English UK -->
<country name="it" domain="www.girlsgogames.it" game="gioco" language="9"/><!-- Italian -->
<country name="jp" domain="www.egames.jp" game="game" language="16"/><!-- Japanese -->
<country name="nl" domain="www.girlsgogames.nl" game="spel" language="3"/><!-- Dutch -->
<country name="pl" domain="www.girlsgogames.pl" game="gra" language="11"/><!-- Polish -->
<country name="pt" domain="www.ojogos.pt" game="jogo" language="8"/><!-- Portuguese -->
<country name="ru" domain="www.girlsgogames.ru" game="igra" language="12"/><!-- Russian -->
<country name="se" domain="www.girlsgogames.se" game="spel_" language="10"/><!-- Swedish -->
<country name="en_uk" domain="www.girlsgogames.co.uk" game="game" language="2"/><!-- English UK -->
<country name="en_us" domain="www.girlsgogames.com" game="game" language="1"/><!-- English US -->
<!-- removed -->
<!-- country name="ph" domain="www.laro.com.ph" game="game" language="2"/ --><!-- English UK -->
<!-- country name="tr" domain="www.girlsgogamestr.com" game="oyun" language="13"/ --><!-- Turkish -->
<!-- country name="my" domain="www.game.com.my" game="permainan_" language="15"/ --><!-- Malaysian -->
</girl>
<teen>
<!-- new -->
<!--country name="arg" domain="www.juegosdechicas.com.ar" game="game" language="6"/ --><!-- Argentina -->
<!--country name="mx" domain="www.juegosdechicas.mx" game="game" language="6"/ --><!-- Mexico -->
<!--country name="ar" domain="www.dailygame.com" game="game" language="1"/ --><!-- Arabic(English US) 2009.07.14-->
<!--country name="br" domain="www.a10.com" game="jogo" language="7"/ --><!-- Brazillian -->
<!--country name="cn" domain="www.game.com.cn" game="moregames" language="17"/ --><!-- Chinese -->
<!--country name="de" domain="www.a10.com" game="spiel" language="5"/ --><!-- German -->
<!--country name="es" domain="www.a10.com" game="juego" language="6"/ --><!-- Spanish -->
<!--country name="fr" domain="www.a10.com" game="jeu" language="4"/ --><!-- French -->
<!--country name="id" domain="www.a10.com" game="permainanme" language="14"/ --><!-- Indonesian -->
<!--country name="in" domain="www.a10.com" game="game" language="2"/ --><!-- English UK -->
<!--country name="it" domain="www.a10.com" game="gioco" language="9"/ --><!-- Italian -->
<!--country name="jp" domain="www.a10.com" game="game" language="16"/ --><!-- Japanese -->
<!--country name="nl" domain="www.a10.com" game="spel" language="3"/ --><!-- Dutch -->
<!--country name="pl" domain="www.a10.com" game="gra" language="11"/ --><!-- Polish -->
<!--country name="pt" domain="www.a10.com" game="jogo" language="8"/ --><!-- Portuguese -->
<!--country name="ru" domain="www.a10.com" game="igra" language="12"/ --><!-- Russian -->
<!--country name="se" domain="www.a10.com" game="spel_" language="10"/ --><!-- Swedish -->
<!--country name="en_uk" domain="www.a10.com" game="game" language="2"/ --><!-- English UK -->
<country name="en_us" domain="www.a10.com" game="game" language="1"/><!-- English US -->
<!-- removed -->
<!-- country name="ph" domain="www.a10.com" game="game" language="2"/ --><!-- English UK -->
<!-- country name="tr" domain="www.a10.com" game="oyun" language="13"/ --><!-- Turkish -->
<!-- country name="my" domain="www.a10.com" game="permainan_" language="15"/ --><!-- Malaysian -->
</teen>
<zapapa>
<!-- new -->
<country name="arg" domain="www.zapapa.com" game="game" language="6"/><!-- Argentina -->
<country name="mx" domain="www.zapapa.com" game="game" language="6"/><!-- Mexico -->
<country name="ar" domain="www.zapapa.com" game="game" language="1"/><!-- Arabic(English US) 2009.07.14-->
<country name="br" domain="www.zapapa.com" game="game" language="7"/><!-- Brazillian -->
<country name="cn" domain="www.zapapa.com" game="game" language="17"/><!-- Chinese -->
<country name="de" domain="www.zapapa.com" game="game" language="5"/><!-- German -->
<country name="es" domain="www.zapapa.com" game="game" language="6"/><!-- Spanish -->
<country name="fr" domain="www.zapapa.com" game="game" language="4"/><!-- French -->
<country name="id" domain="www.zapapa.com" game="game" language="14"/><!-- Indonesian -->
<country name="in" domain="www.zapapa.com" game="game" language="2"/><!-- English UK -->
<country name="it" domain="www.zapapa.com" game="game" language="9"/><!-- Italian -->
<country name="jp" domain="www.zapapa.com" game="game" language="16"/><!-- Japanese -->
<country name="nl" domain="www.zapapa.com" game="game" language="3"/><!-- Dutch -->
<country name="pl" domain="www.zapapa.com" game="game" language="11"/><!-- Polish -->
<country name="pt" domain="www.zapapa.com" game="game" language="8"/><!-- Portuguese -->
<country name="ru" domain="www.zapapa.com" game="game" language="12"/><!-- Russian -->
<country name="se" domain="www.zapapa.com" game="game" language="10"/><!-- Swedish -->
<country name="en_uk" domain="www.zapapa.com" game="game" language="2"/><!-- English UK -->
<country name="en_us" domain="www.zapapa.com" game="game" language="1"/><!-- English US -->
</zapapa>
<hyves>
<!-- new -->
<country name="nl" domain="www.zapapa.nl" game="game" language="3"/><!-- Dutch -->
</hyves>
</data>
;
}
}//package zlong.country
Section 165
//CountryInfo (zlong.country.CountryInfo)
package zlong.country {
import zlong.domain.*;
import zlong.*;
import zlong.data.*;
public class CountryInfo {
private var countries:Countries;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
private static var _instance:CountryInfo;
public function CountryInfo(){
super();
this.countries = new Countries();
}
public function set portal(portal:String):void{
this.countries.portal = portal;
}
public function get portal():String{
return (this.countries.portal);
}
public function set country(country:String):void{
this.countries.country = country;
}
public function get country():String{
return (this.countries.current.name);
}
public function get domain():String{
return (this.countries.current.domain);
}
public function get language():int{
return (this.countries.current.language);
}
public function get countryGroup():Array{
return (this.countries.countryGroup);
}
public function get moreGameLink():String{
var str:String;
str = ("http://" + this.domain);
if (this.countries.current.name != "cn"){
str = (str + "/");
str = (str + ("?utm_medium=brandedgames_" + (DomainInfo.instance.allowed) ? "internal" : "external"));
str = (str + ("&utm_campaign=" + GameInfo.name));
str = (str + ("&utm_source=" + DomainInfo.instance.domainAb));
} else {
str = (str + "/");
str = (str + "moregames");
str = (str + "/");
};
return (str);
}
public function get thisGameLink():String{
var str:String;
str = ("http://" + this.domain);
str = (str + ((("/" + this.countries.current.game) + "/") + GameInfo.html));
if (this.countries.current.name != "cn"){
str = (str + ("?utm_medium=brandedgames_" + (DomainInfo.instance.allowed) ? "internal" : "external"));
str = (str + ("&utm_campaign=" + GameInfo.name));
str = (str + ("&utm_source=" + DomainInfo.instance.domainAb));
};
return (str);
}
public function get sendToFriendLink():String{
var str:String = this.thisGameLink;
if (this.countries.current.name != "cn"){
str = (str + "&utm_content=send_to_friend");
};
return (str);
}
public static function get instance():CountryInfo{
if (_instance == null){
_instance = new (CountryInfo);
};
return (_instance);
}
}
}//package zlong.country
Section 166
//CountryItem (zlong.country.CountryItem)
package zlong.country {
import zlong.*;
final class CountryItem {
var name:String;
var domain:String;
var game:String;
var language:int;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
}
}//package zlong.country
Section 167
//CountryCookie (zlong.data.CountryCookie)
package zlong.data {
import flash.net.*;
import zlong.*;
public class CountryCookie {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
private static const name:String = "spilgames_language_v100";
private static const countryName:String = "savedLang";
private static var so:SharedObject;
public function CountryCookie():void{
super();
so = SharedObject.getLocal(name, "/");
}
localComponent_internal static function set country(_value:String):void{
so.data[countryName] = _value;
}
localComponent_internal static function get country():String{
return (so.data[countryName]);
}
}
}//package zlong.data
Section 168
//GameInfo (zlong.data.GameInfo)
package zlong.data {
import zlong.*;
public class GameInfo {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
localComponent_internal static var cnversion:Boolean = false;
localComponent_internal static var portal:String = "family";
localComponent_internal static var name:String = "game_name";
localComponent_internal static var html:String = "Game-Name.html";
localComponent_internal static var width:int = 550;
localComponent_internal static var height:int = 400;
}
}//package zlong.data
Section 169
//AbstractBindingDisplay (zlong.display.AbstractBindingDisplay)
package zlong.display {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class AbstractBindingDisplay extends MovieClip {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public function AbstractBindingDisplay(){
super();
if (getQualifiedClassName(this) == "zlong::display::AbstractBindingDisplay"){
throw (new ArgumentError("can't be constructed"));
};
}
public function initEvent(e:Event=null):void{
}
public function delEvent(e:Event=null):void{
}
}
}//package zlong.display
Section 170
//BindingDisplayEvent (zlong.display.BindingDisplayEvent)
package zlong.display {
import flash.events.*;
public class BindingDisplayEvent extends Event {
private var _BD:AbstractBindingDisplay;
private var _displayType:String;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public static const BINDING_DISPLAY_INIT:String = "BINDING_DISPLAY_INIT";
public static const BINDING_DISPLAY_DEL_EVENT:String = "BINDING_DISPLAY_DEL_EVENT";
public static const BINDING_DISPLAY_ADDED_TO_STAGE:String = "BINDING_DISPLAY_ADDED_TO_STAGE";
public static const BINDING_DISPLAY_REMOVE_TO_STAGE:String = "BINDING_DISPLAY_REMOVE_TO_STAGE";
public function BindingDisplayEvent(type:String, BD:AbstractBindingDisplay, displayType:String, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
this._BD = BD;
this._displayType = displayType;
}
public function get bindingDisplay():AbstractBindingDisplay{
return (this._BD);
}
public function get displayType():String{
return (this._displayType);
}
}
}//package zlong.display
Section 171
//BindingDisplayManager (zlong.display.BindingDisplayManager)
package zlong.display {
import flash.events.*;
public class BindingDisplayManager extends EventDispatcher {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
private static var _instance:BindingDisplayManager;
public function BindingDisplayManager():void{
super();
}
public static function get Instance():BindingDisplayManager{
if (_instance == null){
_instance = new (BindingDisplayManager);
};
return (_instance);
}
}
}//package zlong.display
Section 172
//Copyright (zlong.display.Copyright)
package zlong.display {
import flash.events.*;
import zlong.navigate.*;
public class Copyright extends AbstractBindingDisplay {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public function Copyright(){
super();
this.gotoAndStop(1);
this.buttonMode = true;
this.mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_INIT, this, "Copyright"));
}
private function addToStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_ADDED_TO_STAGE, this, "Copyright"));
this.initEvent();
}
private function removeFromStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_REMOVE_TO_STAGE, this, "Copyright"));
this.delEvent();
}
override public function initEvent(e:Event=null):void{
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
this.addEventListener(MouseEvent.CLICK, Handler.click_copyright);
this.addEventListener(MouseEvent.ROLL_OVER, this.rollOverHandler);
this.addEventListener(MouseEvent.MOUSE_DOWN, this.mouseDownHandler);
this.addEventListener(MouseEvent.MOUSE_UP, this.mouseUpHandler);
this.addEventListener(MouseEvent.ROLL_OUT, this.rollOutHandler);
this.addEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
}
override public function delEvent(e:Event=null):void{
this.removeEventListener(MouseEvent.CLICK, Handler.click_copyright);
this.removeEventListener(MouseEvent.ROLL_OVER, this.rollOverHandler);
this.removeEventListener(MouseEvent.MOUSE_DOWN, this.mouseDownHandler);
this.removeEventListener(MouseEvent.MOUSE_UP, this.mouseUpHandler);
this.removeEventListener(MouseEvent.ROLL_OUT, this.rollOutHandler);
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
if (this.hasEventListener(Event.REMOVED_FROM_STAGE)){
removeEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
};
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_DEL_EVENT, this, "Copyright"));
}
private function rollOverHandler(evt:MouseEvent):void{
this.gotoAndStop(2);
}
private function mouseDownHandler(evt:MouseEvent):void{
this.gotoAndStop(3);
}
private function mouseUpHandler(evt:MouseEvent):void{
this.gotoAndStop(2);
}
private function rollOutHandler(evt:MouseEvent):void{
this.gotoAndStop(1);
}
}
}//package zlong.display
Section 173
//CountriesBox (zlong.display.CountriesBox)
package zlong.display {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import zlong.data.*;
import zlong.country.*;
public class CountriesBox extends AbstractBindingDisplay {
private var i:uint;
private var mul:int;// = 1
private var baseX:Number;// = 0
private var baseY:Number;// = 0
private var nameGroup:Array;
private var obj:Object;
private var pop:Sprite;
private var flagMc:MovieClip;
private var selectBox:MovieClip;
private var country_name:MovieClip;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public function CountriesBox(){
this.nameGroup = [];
super();
addEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_INIT, this, "CountriesBox"));
}
private function addToStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_ADDED_TO_STAGE, this, "CountriesBox"));
this.initEvent();
}
private function removeFromStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_REMOVE_TO_STAGE, this, "CountriesBox"));
this.delEvent();
}
override public function initEvent(e:Event=null):void{
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
this.initShow();
addEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
}
override public function delEvent(e:Event=null):void{
removeEventListener(MouseEvent.ROLL_OVER, this.overHandler);
removeEventListener(MouseEvent.ROLL_OUT, this.outHandler);
removeEventListener(MouseEvent.CLICK, this.clickHandler);
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
if (this.hasEventListener(Event.REMOVED_FROM_STAGE)){
removeEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
};
this.delPoPEvent();
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_DEL_EVENT, this, "CountriesBox"));
}
private function initShow():void{
this.obj = new Object();
this.initPos();
this.setFlag();
this.setPop();
this.initFlagEvent();
this.initPoPEvent();
if (GameInfo.cnversion){
this.visible = false;
this.setLanguage("cn");
};
}
private function initPos():void{
var p:Point = new Point();
p = this.parent.localToGlobal(new Point(x, y));
if (p.y > (GameInfo.height / 2)){
this.mul = 1;
} else {
this.mul = -1;
};
}
private function setFlag():void{
this.country_name = (getChildByName("countryName") as MovieClip);
this.flagMc = (getChildByName("flag") as MovieClip);
this.flagMc.gotoAndStop(CountryInfo.instance.country);
this.country_name.gotoAndStop(CountryInfo.instance.country);
}
private function setPop():void{
var unitW:Number;
var unitH:Number;
var pop_flag:MovieClip;
var _name:String;
var pop_flag_flag:MovieClip;
var dx:Number = 0;
var dy:Number = 0;
this.pop = (getChildByName("popList") as Sprite);
this.selectBox = (getChildByName("selectbox") as MovieClip);
unitW = this.pop.getChildByName("_blank").width;
unitH = (this.pop.getChildByName("_blank").height - 1);
this.baseX = this.selectBox.x;
this.nameGroup = CountryInfo.instance.countryGroup;
var len:int = this.nameGroup.length;
if (this.mul == 1){
this.baseY = ((this.selectBox.y - (Math.round((len / 2)) * unitH)) + unitH);
} else {
this.baseY = ((this.selectBox.y + this.selectBox.height) + unitH);
};
this.pop.y = this.baseY;
this.pop.visible = false;
this.pop.getChildByName("_blank").visible = false;
this.i = 0;
while (this.i < len) {
_name = this.nameGroup[this.i];
if (this.pop.getChildByName(("l_" + _name)) != null){
pop_flag = (this.pop.getChildByName(("l_" + _name)) as MovieClip);
pop_flag.mouseChildren = false;
pop_flag.buttonMode = true;
pop_flag.stop();
pop_flag_flag = (pop_flag.getChildByName("flag") as MovieClip);
pop_flag_flag.mouseEnabled = false;
pop_flag_flag.mouseChildren = false;
pop_flag_flag.gotoAndStop(_name);
this.obj[("l_" + _name)] = true;
dx = (((this.i % 2) == 0)) ? 0 : 1;
pop_flag.x = ((unitW * (this.i % 2)) - dx);
pop_flag.y = ((unitH * Math.floor((this.i / 2))) - unitH);
};
this.i++;
};
this.i = 0;
while (this.i < this.pop.numChildren) {
if (this.pop.getChildAt(this.i).name.indexOf("l_") != -1){
if (this.obj[this.pop.getChildAt(this.i).name] == undefined){
this.pop.getChildAt(this.i).visible = false;
};
};
this.i++;
};
if ((this.nameGroup.length % 2) == 0){
this.pop.getChildByName("_blank").visible = false;
} else {
this.pop.getChildByName("_blank").visible = true;
this.pop.getChildByName("_blank").x = (unitW - 1);
this.pop.getChildByName("_blank").y = (((unitH * Math.floor((this.nameGroup.length / 2))) - unitH) - dy);
};
}
private function initFlagEvent():void{
addEventListener(MouseEvent.ROLL_OVER, this.overHandler, false, 0, true);
addEventListener(MouseEvent.ROLL_OUT, this.outHandler, false, 0, true);
addEventListener(MouseEvent.CLICK, this.clickHandler, false, 0, true);
}
private function clickHandler(e:MouseEvent):void{
var _flag:MovieClip;
var _name:String = e.target["name"];
if (_name == "_blank"){
return;
};
if (_name.indexOf("l_") != -1){
_flag = (e.target["getChildByName"]("flag") as MovieClip);
this.flagMc.gotoAndStop(_name.substr(2));
this.country_name.gotoAndStop(_flag.currentFrame);
this.setLanguage(_name.substr(2));
this.pop.visible = false;
};
}
private function setLanguage(_cnm:String):void{
CountryInfo.instance.country = _cnm;
CountryCookie.country = _cnm;
Dispatcher.langChanged();
}
private function overHandler(e:MouseEvent):void{
this.pop.visible = true;
}
private function outHandler(e:MouseEvent):void{
this.pop.visible = false;
}
private function initPoPEvent():void{
this.pop.addEventListener(MouseEvent.MOUSE_OVER, this.overPoPHandler);
this.pop.addEventListener(MouseEvent.MOUSE_OUT, this.outPoPHandler);
}
private function delPoPEvent():void{
this.pop.removeEventListener(MouseEvent.MOUSE_OVER, this.overPoPHandler);
this.pop.removeEventListener(MouseEvent.MOUSE_OUT, this.outPoPHandler);
}
private function overPoPHandler(e:MouseEvent):void{
var _local2 = e.target;
_local2["gotoAndStop"](2);
}
private function outPoPHandler(e:MouseEvent):void{
var _local2 = e.target;
_local2["gotoAndStop"](1);
}
}
}//package zlong.display
Section 174
//Dispatcher (zlong.display.Dispatcher)
package zlong.display {
import flash.events.*;
import zlong.*;
class Dispatcher {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
static const LANGUAGE_CHANGED:String = "languageChanged";
static var dispatcher:EventDispatcher = new EventDispatcher();
static function langChanged():void{
dispatcher.dispatchEvent(new Event(LANGUAGE_CHANGED));
}
}
}//package zlong.display
Section 175
//ExtButton (zlong.display.ExtButton)
package zlong.display {
import flash.events.*;
import zlong.navigate.*;
public class ExtButton extends AbstractBindingDisplay {
private var _type:String;// = "moregames"
private var _position:String;// = "button_preloader"
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public function ExtButton(){
super();
this.gotoAndStop(1);
this.buttonMode = true;
this.mouseChildren = false;
addEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_INIT, this, "ExtButton"));
}
private function addToStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_ADDED_TO_STAGE, this, "ExtButton"));
this.initEvent();
}
private function removeFromStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_REMOVE_TO_STAGE, this, "ExtButton"));
this.delEvent();
}
override public function initEvent(e:Event=null):void{
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
this.addEventListener(MouseEvent.CLICK, this.clickHandler);
this.addEventListener(MouseEvent.ROLL_OVER, this.rollOverHandler);
this.addEventListener(MouseEvent.MOUSE_DOWN, this.mouseDownHandler);
this.addEventListener(MouseEvent.MOUSE_UP, this.mouseUpHandler);
this.addEventListener(MouseEvent.ROLL_OUT, this.rollOutHandler);
this.addEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
}
override public function delEvent(e:Event=null):void{
this.removeEventListener(MouseEvent.CLICK, this.clickHandler);
this.removeEventListener(MouseEvent.ROLL_OVER, this.rollOverHandler);
this.removeEventListener(MouseEvent.MOUSE_DOWN, this.mouseDownHandler);
this.removeEventListener(MouseEvent.MOUSE_UP, this.mouseUpHandler);
this.removeEventListener(MouseEvent.ROLL_OUT, this.rollOutHandler);
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
if (this.hasEventListener(Event.REMOVED_FROM_STAGE)){
removeEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
};
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_DEL_EVENT, this, "ExtButton"));
}
public function set position(_str:String):void{
this._position = _str;
}
public function set type(_str:String):void{
this._type = _str;
}
private function clickHandler(e:MouseEvent):void{
if (this._type == "moregames"){
Handler.click_moregames(this._position);
} else {
Handler.click_thisgame(this._position);
};
}
private function rollOverHandler(evt:MouseEvent):void{
this.gotoAndStop(2);
}
private function mouseDownHandler(evt:MouseEvent):void{
this.gotoAndStop(3);
}
private function mouseUpHandler(evt:MouseEvent):void{
this.gotoAndStop(2);
}
private function rollOutHandler(evt:MouseEvent):void{
this.gotoAndStop(1);
}
}
}//package zlong.display
Section 176
//Logo (zlong.display.Logo)
package zlong.display {
import flash.display.*;
import flash.events.*;
import zlong.country.*;
import zlong.navigate.*;
public class Logo extends AbstractBindingDisplay {
private const MAX_WIDTH:int = 200;
private const Max_HEIGHT:int = 50;
private var _hitArea:Sprite;
private var _position:String;// = "logo_preloader"
private var _alignHorizontal:String;// = "Center"
private var _alignVertical:String;// = "Center"
private var _maxWidth:Number;// = 150
private var _maxHeight:Number;// = 40
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public function Logo(){
super();
this.initDis();
addEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler, false, 0, true);
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_INIT, this, "Logo"));
}
private function addToStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_ADDED_TO_STAGE, this, "Logo"));
this.initEvent();
}
private function removeFromStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_REMOVE_TO_STAGE, this, "Logo"));
this.delEvent();
}
override public function initEvent(e:Event=null):void{
gotoAndStop(CountryInfo.instance.domain);
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
this.addEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
this.addEventListener(MouseEvent.CLICK, this.clickHandler);
Dispatcher.dispatcher.addEventListener(Dispatcher.LANGUAGE_CHANGED, this.langChangeHandler);
this.updateView();
}
override public function delEvent(e:Event=null):void{
this.delDis();
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
if (this.hasEventListener(Event.REMOVED_FROM_STAGE)){
removeEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
};
this.removeEventListener(MouseEvent.CLICK, this.clickHandler);
Dispatcher.dispatcher.removeEventListener(Dispatcher.LANGUAGE_CHANGED, this.langChangeHandler);
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_DEL_EVENT, this, "Logo"));
}
public function set position(_str:String):void{
this._position = _str;
}
public function set alignHorizontal(str:String):void{
this._alignHorizontal = str;
}
public function set alignVertical(str:String):void{
this._alignVertical = str;
}
public function set maxWidth(value:Number):void{
if (value < 0){
value = 0;
} else {
if (value > this.MAX_WIDTH){
value = this.MAX_WIDTH;
};
};
this._maxWidth = value;
}
public function set maxHeight(value:Number):void{
if (value < 0){
value = 0;
} else {
if (value > this.Max_HEIGHT){
value = this.Max_HEIGHT;
};
};
this._maxHeight = value;
}
private function updateView():void{
var scale1:Number;
var scale2:Number;
var scale:Number;
var temp:Sprite = (this.getChildAt(0) as Sprite);
if (!temp){
return;
};
temp.scaleX = 1;
temp.scaleY = 1;
if ((((temp.height > 0)) && ((temp.width > 0)))){
scale1 = (this._maxHeight / temp.height);
scale2 = (this._maxWidth / temp.width);
scale = ((scale1 > scale2)) ? scale2 : scale1;
temp.scaleX = scale;
temp.scaleY = scale;
};
if (this._alignHorizontal){
switch (this._alignHorizontal){
case "Left":
temp.x = 0;
break;
case "Right":
temp.x = (this.MAX_WIDTH - temp.width);
break;
case "Center":
temp.x = ((this.MAX_WIDTH - temp.width) / 2);
break;
};
};
if (this._alignVertical){
switch (this._alignVertical){
case "Up":
temp.y = 0;
break;
case "Down":
temp.y = (this.Max_HEIGHT - temp.height);
break;
case "Center":
temp.y = ((this.Max_HEIGHT - temp.height) / 2);
break;
};
};
this._hitArea.width = temp.width;
this._hitArea.height = temp.height;
this._hitArea.x = temp.x;
this._hitArea.y = temp.y;
}
private function initDis():void{
buttonMode = true;
this._hitArea = new Sprite();
this.addChild(this._hitArea);
this._hitArea.graphics.beginFill(3368601, 0);
this._hitArea.graphics.drawRect(0, 0, 10, 10);
this._hitArea.graphics.endFill();
this.getChildByName("displayArea_mc").visible = false;
var i:int;
while (i < this.totalFrames) {
this.addFrameScript(i, this.updateView);
i++;
};
}
private function delDis():void{
stop();
}
private function clickHandler(e:MouseEvent):void{
Handler.click_moregames(this._position);
}
private function langChangeHandler(e:Event):void{
gotoAndStop(CountryInfo.instance.domain);
}
}
}//package zlong.display
Section 177
//Menu (zlong.display.Menu)
package zlong.display {
import flash.events.*;
import flash.display.*;
import zlong.country.*;
import zlong.*;
import flash.ui.*;
import zlong.navigate.*;
public class Menu {
private var displayObject:InteractiveObject;
private var menu:ContextMenu;
private var item:ContextMenuItem;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public function Menu(doc:InteractiveObject){
super();
this.displayObject = doc;
this.init();
this.initEvent();
}
private function init():void{
this.menu = new ContextMenu();
this.menu.hideBuiltInItems();
var defaultItems:ContextMenuBuiltInItems = this.menu.builtInItems;
defaultItems.print = true;
defaultItems.zoom = true;
defaultItems.quality = true;
this.item = new ContextMenuItem(("MoreGame: " + CountryInfo.instance.domain));
this.menu.customItems.push(this.item);
this.displayObject.contextMenu = this.menu;
}
private function initEvent():void{
this.item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.clickItemHandler);
Dispatcher.dispatcher.addEventListener(Dispatcher.LANGUAGE_CHANGED, this.changeLang);
}
private function changeLang(e:Event):void{
this.item.caption = CountryInfo.instance.domain;
}
private function clickItemHandler(e:ContextMenuEvent):void{
Handler.click_moregames("Contex_Menu");
}
}
}//package zlong.display
Section 178
//TranText (zlong.display.TranText)
package zlong.display {
import flash.events.*;
import zlong.country.*;
public class TranText extends AbstractBindingDisplay {
private var isChange:Boolean;// = true
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public function TranText(){
super();
addEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler, false, 0, true);
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_INIT, this, "TranText"));
}
private function addToStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_ADDED_TO_STAGE, this, "TranText"));
this.initEvent();
}
private function removeFromStageHandler(e:Event):void{
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_REMOVE_TO_STAGE, this, "TranText"));
this.delEvent();
}
override public function initEvent(e:Event=null):void{
this.changeLang();
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
addEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
Dispatcher.dispatcher.addEventListener(Dispatcher.LANGUAGE_CHANGED, this.langChangeHandler);
}
override public function delEvent(e:Event=null):void{
if (this.hasEventListener(Event.ADDED_TO_STAGE)){
removeEventListener(Event.ADDED_TO_STAGE, this.addToStageHandler);
};
if (this.hasEventListener(Event.REMOVED_FROM_STAGE)){
removeEventListener(Event.REMOVED_FROM_STAGE, this.removeFromStageHandler);
};
Dispatcher.dispatcher.removeEventListener(Dispatcher.LANGUAGE_CHANGED, this.langChangeHandler);
BindingDisplayManager.Instance.dispatchEvent(new BindingDisplayEvent(BindingDisplayEvent.BINDING_DISPLAY_DEL_EVENT, this, "TranText"));
}
public function set change(_v:Boolean):void{
this.isChange = _v;
}
private function changeLang():void{
gotoAndStop(CountryInfo.instance.language);
}
private function langChangeHandler(e:Event):void{
if (this.isChange){
this.changeLang();
};
}
}
}//package zlong.display
Section 179
//DomainData (zlong.domain.DomainData)
package zlong.domain {
import zlong.*;
final class DomainData {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
static const allowedDomain:Array = ["www8.agame.com", "www.zlonggamestest.com", "gamedev.dev.spilgames.com"];
}
}//package zlong.domain
Section 180
//DomainInfo (zlong.domain.DomainInfo)
package zlong.domain {
import flash.net.*;
import zlong.*;
public final class DomainInfo {
private var _allowed:Boolean;
private var _domain:String;
private var _domainAb:String;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
private static var _instance:DomainInfo;
public function DomainInfo(){
super();
this._domain = new LocalConnection().domain;
this.initAllowed();
this.initAb();
}
localComponent_internal function get allowed():Boolean{
return (this._allowed);
}
localComponent_internal function get domain():String{
return (this._domain);
}
localComponent_internal function get domainAb():String{
return (this._domainAb);
}
private function initAllowed():void{
var i:int;
while (i < DomainData.allowedDomain.length) {
if (this._domain == DomainData.allowedDomain[i]){
this._allowed = true;
break;
};
i++;
};
}
private function initAb():void{
var temp:Array;
var extention:int;
var name:int;
if (this._domain != "localhost"){
temp = this._domain.split(".");
extention = (temp.length - 1);
name = (temp.length - 2);
this._domainAb = ((temp[name] + ".") + temp[extention]);
} else {
this._domainAb = "offline_play";
};
}
public static function get instance():DomainInfo{
if (_instance == null){
_instance = new (DomainInfo);
};
return (_instance);
}
}
}//package zlong.domain
Section 181
//Handler (zlong.navigate.Handler)
package zlong.navigate {
import flash.events.*;
import zlong.country.*;
import flash.net.*;
import zlong.*;
import flash.external.*;
public class Handler {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public static function click_gamecn(e:Event=null):void{
var request:URLRequest = new URLRequest("http://www.game.com.cn");
navigateToURL(request, "_blank");
}
public static function click_copyright(e:Event=null):void{
var request:URLRequest;
if (CountryInfo.instance.country == "cn"){
request = new URLRequest("http://www.game.com.cn");
} else {
request = new URLRequest("http://www.gameportal.net");
};
navigateToURL(request, "_blank");
}
public static function refurbish(e:Event=null):void{
var e = e;
ExternalInterface.call("location.reload");
navigateToURL(new URLRequest(ExternalInterface.call("window.location.href.toString")), "_top");
//unresolved jump
var _slot1 = myError;
}
public static function click_thisgame(_position:String):void{
var request:URLRequest;
if (CountryInfo.instance.country == "cn"){
request = new URLRequest(CountryInfo.instance.moreGameLink);
} else {
request = new URLRequest(((CountryInfo.instance.thisGameLink + "&utm_content=") + _position));
};
navigateToURL(request, "_blank");
Trace(request.url);
}
public static function click_moregames(_position:String):void{
var request:URLRequest;
if (CountryInfo.instance.country == "cn"){
request = new URLRequest(CountryInfo.instance.moreGameLink);
} else {
request = new URLRequest(((CountryInfo.instance.moreGameLink + "&utm_content=") + _position));
};
navigateToURL(request, "_blank");
Trace(request.url);
}
}
}//package zlong.navigate
Section 182
//LocalSiteDataLoader (zlong.site.LocalSiteDataLoader)
package zlong.site {
import flash.events.*;
import flash.net.*;
import zlong.*;
public class LocalSiteDataLoader {
private var _localSiteDataLoader:URLLoader;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
private static var _localSiteDataLoaderFinish:Boolean = true;
public function LocalSiteDataLoader(){
super();
_localSiteDataLoaderFinish = false;
this._localSiteDataLoader = new URLLoader();
this._localSiteDataLoader.dataFormat = URLLoaderDataFormat.TEXT;
this._localSiteDataLoader.addEventListener(IOErrorEvent.IO_ERROR, this.errorHandler);
this._localSiteDataLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.errorHandler);
this._localSiteDataLoader.addEventListener(Event.COMPLETE, this.LocalSiteDataLoaderFinish);
this._localSiteDataLoader.load(new URLRequest(SiteData.URL));
//unresolved jump
var _slot1 = e;
errorHandler();
}
private function LocalSiteDataLoaderFinish(event:Event):void{
SiteData.allowedSite = new XML(this._localSiteDataLoader.data);
_localSiteDataLoaderFinish = true;
SiteInfo.instance.reInit();
this.delLocalSiteDataLoader();
}
private function errorHandler(e:Event=null):void{
SiteData.allowedSite = <sites></sites>
;
_localSiteDataLoaderFinish = true;
SiteInfo.instance.reInit();
this.delLocalSiteDataLoader();
}
private function delLocalSiteDataLoader():void{
this._localSiteDataLoader.removeEventListener(IOErrorEvent.IO_ERROR, this.errorHandler);
this._localSiteDataLoader.removeEventListener(Event.COMPLETE, this.LocalSiteDataLoaderFinish);
this._localSiteDataLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.errorHandler);
this._localSiteDataLoader = null;
}
public static function get localSiteDataLoaderFinish():Boolean{
return (_localSiteDataLoaderFinish);
}
}
}//package zlong.site
Section 183
//SiteData (zlong.site.SiteData)
package zlong.site {
import zlong.*;
public final class SiteData {
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public static const URL:String = "http://www8.agame.com/games/sitelock/sites.xml";
public static var allowedSite:XML;
}
}//package zlong.site
Section 184
//SiteInfo (zlong.site.SiteInfo)
package zlong.site {
import zlong.*;
import zlong.data.*;
import flash.external.*;
public class SiteInfo {
private var _sites:Array;
private var _link:String;
private var _html:String;
private var _domain:String;
private var _allowed:Boolean;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
private static var _instance:SiteInfo;
public function SiteInfo():void{
super();
this.initSites();
this._link = this.getURL();
this._html = this.getHtml(this._link);
this._domain = this.getDomain(this._link);
this._allowed = this.check(this._domain, this._sites);
}
function reInit():void{
this.initSites();
this._link = this.getURL();
this._html = this.getHtml(this._link);
this._domain = this.getDomain(this._link);
this._allowed = this.check(this._domain, this._sites);
}
public function get allowed():Boolean{
if (GameInfo.cnversion){
return (true);
};
return (this._allowed);
}
public function get link():String{
return (this._link);
}
public function get html():String{
return (this._html);
}
public function get domain():String{
return (this._domain);
}
private function initSites():void{
var siteList:XMLList;
var i:int;
this._sites = new Array();
if (SiteData.allowedSite != null){
siteList = SiteData.allowedSite.child("item");
i = 0;
while (i < siteList.length()) {
this._sites.push(siteList[i]);
i++;
};
};
}
private function getURL():String{
var loc:String;
try {
loc = ExternalInterface.call("window.location.href.toString");
//unresolved jump
var _slot1 = e;
loc = "error";
} finally {
};
if ((((loc == null)) || ((loc == "")))){
loc = "error";
};
if (String(loc).indexOf(".swf") != -1){
loc = "error";
};
return (loc);
}
private function getHtml(str:String):String{
var index:int = str.indexOf("?");
if (index != -1){
return (str);
};
return (str.substr(0, index));
}
private function getDomain(w:String):String{
var temp:String = "";
var j:uint = 7;
while (j < w.length) {
if (w.charAt(j) == "/"){
break;
};
temp = (temp + w.charAt(j));
j++;
};
return (temp);
}
private function check(str:String, arr:Array):Boolean{
var i:uint;
while (i < arr.length) {
if (str == arr[i]){
return (true);
};
i++;
};
return (false);
}
public static function get instance():SiteInfo{
if (_instance == null){
_instance = new (SiteInfo);
};
return (_instance);
}
}
}//package zlong.site
Section 185
//Award_HighScore (zlong.spilSystemTool.Award_HighScore)
package zlong.spilSystemTool {
import flash.events.*;
import flash.display.*;
import com.spilgames.api.*;
import zlong.*;
public class Award_HighScore implements IEventDispatcher {
framework_internal static const VERSION:String = "v1.11.201007011936";
public static const AWORD_HIGHSCORE_TOOL_INITIALIZED_COMPONENT:String = "SPILGAMESSERVICS_INITIALIZED_COMPONENT";
public static const AWORD_HIGHSCORE_TOOL_INITIALIZED_FAILED:String = "SPILGAMESSERVICS_INITIALIZED_FAILED";
static var _instance:Award_HighScore;
public function Award_HighScore(){
super();
}
public function init(gameName:String, container:Sprite, debug:Boolean=false, isLive:Boolean=true):void{
if (!SpilSetting._instance){
SpilSetting.instance.init(container, gameName, debug);
};
if (debug){
container.stage.addEventListener(KeyboardEvent.KEY_DOWN, this.keyBoardSendAwards);
};
}
public function isAwardsServiceAvailable():Boolean{
return (AwardsService.isAvailable());
}
public function isScoreServiceAvailable():Boolean{
return (ScoreService.isAvailable());
}
private function keyBoardSendAwards(event:Event):void{
var e:KeyboardEvent = (event as KeyboardEvent);
if (((((e.ctrlKey) && ((e.keyCode > 48)))) && ((e.keyCode < 58)))){
this.submitAchievement(("award" + String.fromCharCode(e.keyCode)));
};
}
public function requestAchievementList():void{
}
public function requestAchievementInfo(id:int):void{
}
public function requestHighScoreList():void{
}
public function requestUserHighScoreList(target_username:String):void{
}
public function submitScore(score):void{
if (ScoreService.isAvailable()){
ScoreService.submitScore(score);
} else {
Trace("||ZFW||", "No...isAvailable");
};
}
public function submitAchievement(achievement):void{
if (AwardsService.isAvailable()){
AwardsService.submitAward(achievement);
} else {
Trace("||ZFW||", "No...isAvailable");
};
}
public function isComponentInitialized():Boolean{
return (((AwardsService.isAvailable()) && (ScoreService.isAvailable())));
}
public function isDomainAllowed():Boolean{
return (this.isComponentInitialized());
}
public function destroy():void{
}
public function dispatchEvent(event:Event):Boolean{
return (SpilSetting.instance.dispatchEvent(event));
}
public function hasEventListener(type:String):Boolean{
return (SpilSetting.instance.hasEventListener(type));
}
public function willTrigger(type:String):Boolean{
return (SpilSetting.instance.willTrigger(type));
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
SpilSetting.instance.removeEventListener(type, listener, useCapture);
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
SpilSetting.instance.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public static function get instance():Award_HighScore{
if (_instance == null){
_instance = new (Award_HighScore);
};
return (_instance);
}
public static function get initializedFinish():Boolean{
if (SpilSetting._instance){
return (SpilSetting.instance.initSpilGamesServices_finish);
};
return (true);
}
}
}//package zlong.spilSystemTool
Section 186
//GoogleEvent (zlong.spilSystemTool.GoogleEvent)
package zlong.spilSystemTool {
import flash.display.*;
import flash.net.*;
import com.google.analytics.*;
import zlong.utils.*;
public class GoogleEvent {
private var _gaGameName:String;
private var _gaTracker:GATracker;
private var _gaEventArr:Array;
private var _gaSharedObject:SharedObject;
framework_internal static const VERSION:String = "v1.11.201007011936";
private static var _instance:GoogleEvent;
public function GoogleEvent():void{
super();
}
public function init(gameName:String, display:DisplayObject, debug:Boolean):void{
var k:String;
this._gaGameName = gameName;
this._gaTracker = new GATracker(display, "UA-6695967-1", "AS3", debug);
this._gaEventArr = new Array();
this._gaSharedObject = SharedObjectUtil.getLocal("googleEvent");
for (k in this._gaSharedObject.data) {
this._gaEventArr.push(k);
};
}
public function gaTrackEvent(eventName:String, isRepeatedInOneGame:Boolean=false, isRepeatedInOnePC:Boolean=true):void{
var i:int;
if (((!(isRepeatedInOnePC)) || (!(isRepeatedInOneGame)))){
i = 0;
while (i < this._gaEventArr.length) {
if (eventName == this._gaEventArr[i]){
return;
};
i++;
};
if (!isRepeatedInOnePC){
this._gaSharedObject.data[eventName] = 1;
SharedObjectUtil.save(this._gaSharedObject);
};
this._gaEventArr.push(eventName);
};
this._gaTracker.trackEvent(this._gaGameName, eventName, "per session", 0);
}
public static function get instance():GoogleEvent{
if (_instance == null){
_instance = new (GoogleEvent);
};
return (_instance);
}
}
}//package zlong.spilSystemTool
Section 187
//SpilSetting (zlong.spilSystemTool.SpilSetting)
package zlong.spilSystemTool {
import flash.events.*;
import flash.display.*;
import com.spilgames.api.*;
import zlong.*;
import flash.utils.*;
public class SpilSetting implements IEventDispatcher {
private const MAX_CONNECT_TIME:int = 15;
private var _isDebug:Boolean;
private var _spilGamesServices:SpilGamesServices;
public static const SPILGAMESSERVICS_INITIALIZED_COMPONENT:String = "SPILGAMESSERVICS_INITIALIZED_COMPONENT";
public static const SPILGAMESSERVICS_INITIALIZED_FAILED:String = "SPILGAMESSERVICS_INITIALIZED_FAILED";
framework_internal static const VERSION:String = "v1.11.201007011936";
private static var _initSpilGamesServices_finish:Boolean = true;
static var _instance:SpilSetting;
public function SpilSetting(){
super();
}
public function init(disObj:Sprite, gameName:String, isDebug:Boolean=false):void{
if (this._spilGamesServices){
return;
};
this._isDebug = isDebug;
if (disObj.stage == null){
throw (new ArgumentError("disObj need be added in stage"));
};
_initSpilGamesServices_finish = false;
this._spilGamesServices = SpilGamesServices.getInstance();
this._spilGamesServices.addEventListener("servicesReady", this.onServicesReady);
this._spilGamesServices.addEventListener("servicesFailed", this.onServicesFailed);
this._spilGamesServices.connect(disObj);
var timer:Timer = new Timer((this.MAX_CONNECT_TIME * 1000), 1);
timer.start();
timer.addEventListener(TimerEvent.TIMER_COMPLETE, this.onTimerend_initSpilGamesServices);
}
private function onTimerend_initSpilGamesServices(event:TimerEvent):void{
(event.currentTarget as Timer).removeEventListener(TimerEvent.TIMER_COMPLETE, this.onTimerend_initSpilGamesServices);
if (!_initSpilGamesServices_finish){
this._spilGamesServices.dispatchEvent(new ErrorEvent("servicesFailed", false, false, ":connect_Timeout"));
Trace("||ZFW||", "10second TimeOut--onTimerend_initSpilGamesServices");
};
}
private function onServicesReady(event:Event):void{
this._spilGamesServices.removeEventListener("servicesReady", this.onServicesReady);
this._spilGamesServices.removeEventListener("servicesFailed", this.onServicesFailed);
if (this._isDebug){
Trace("||ZFW||", ("SpilSetting_SpilGamesServices_Initialized_Complete::" + event));
};
_initSpilGamesServices_finish = true;
}
private function onServicesFailed(event:ErrorEvent):void{
this._spilGamesServices.removeEventListener("servicesReady", this.onServicesReady);
this._spilGamesServices.removeEventListener("servicesFailed", this.onServicesFailed);
if (this._isDebug){
Trace("||ZFW||", ("SpilSetting_SpilGamesServices_Initialize_Failed:" + event.text));
};
_initSpilGamesServices_finish = true;
}
public function checkUserLogin():Boolean{
if (this._spilGamesServices){
return (!(User.isGuest()));
};
throw (new ArgumentError("SpilSetting didn`t init"));
}
public function get itemId():String{
if (this._spilGamesServices){
return (String(this._spilGamesServices.getItemID()));
};
throw (new ArgumentError("SpilSetting didn`t init"));
}
public function get siteId():String{
if (this._spilGamesServices){
return (String(this._spilGamesServices.getSiteID()));
};
throw (new ArgumentError("SpilSetting didn`t init"));
}
public function get username():String{
if (this._spilGamesServices){
return (User.getUserName());
};
throw (new ArgumentError("SpilSetting didn`t init"));
}
public function get hash():String{
if (this._spilGamesServices){
return (User.getUserHash());
};
throw (new ArgumentError("SpilSetting didn`t init"));
}
public function get initSpilGamesServices_finish():Boolean{
if (this._spilGamesServices){
return (_initSpilGamesServices_finish);
};
throw (new ArgumentError("SpilSetting didn`t init"));
}
public function dispatchEvent(event:Event):Boolean{
if (this._spilGamesServices){
return (this._spilGamesServices.dispatchEvent(event));
};
throw (new ArgumentError("SpilSetting didn`t init"));
}
public function hasEventListener(type:String):Boolean{
if (this._spilGamesServices){
return (this._spilGamesServices.hasEventListener(type));
};
throw (new ArgumentError("SpilSetting didn`t init"));
}
public function willTrigger(type:String):Boolean{
if (this._spilGamesServices){
return (this._spilGamesServices.willTrigger(type));
};
throw (new ArgumentError("SpilSetting didn`t init"));
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
if (this._spilGamesServices){
this._spilGamesServices.removeEventListener(type, listener);
} else {
throw (new ArgumentError("SpilSetting didn`t init"));
};
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
if (this._spilGamesServices){
this._spilGamesServices.addEventListener(type, listener);
} else {
throw (new ArgumentError("SpilSetting didn`t init"));
};
}
public static function get instance():SpilSetting{
if (_instance == null){
_instance = new (SpilSetting);
};
return (_instance);
}
}
}//package zlong.spilSystemTool
Section 188
//UiLoading (zlong.Template.demo.ui.UiLoading)
package zlong.Template.demo.ui {
import flash.display.*;
import flash.events.*;
import zlong.Template.*;
import flash.text.*;
import zlong.breathxue.utils.*;
public class UiLoading extends AbstractLoadingClass {
private var _mc_perBar:MovieClip;
private var _mc_perText:TextField;
private var _mc:Sprite;
private static const MC_CLASS_NAME:String = "Mc_UiLoading";
public function UiLoading(pmc:Sprite):void{
super(pmc);
initDis(pmc);
initEvent();
}
private function delDis():void{
_mc.parent.removeChild(_mc);
}
private function initEvent():void{
_mc.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function delEvent():void{
_mc.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
override public function destroy():void{
delEvent();
delDis();
}
private function enterFrameHandler(event:Event):void{
var percentSWF:Number = (_mc.root.loaderInfo.bytesLoaded / _mc.root.loaderInfo.bytesTotal);
_mc_perBar.gotoAndStop(int((percentSWF * 100)));
_mc_perText.text = ((int((percentSWF * 10000)) / 100) + "%");
Trace((_mc_perText.text + ":LOADING"));
}
private function initDis(pmc:Sprite):void{
_mc = Attach.getSprite(MC_CLASS_NAME);
pmc.addChild(_mc);
_mc_perBar = (_mc.getChildByName("perBar") as MovieClip);
_mc_perText = (_mc.getChildByName("perText") as TextField);
_mc_perText.selectable = false;
}
}
}//package zlong.Template.demo.ui
Section 189
//AbstractLoadingClass (zlong.Template.AbstractLoadingClass)
package zlong.Template {
import flash.display.*;
import flash.utils.*;
public class AbstractLoadingClass {
framework_internal static const VERSION:String = "v1.11.201007011936";
public function AbstractLoadingClass(pmc:Sprite){
super();
if (getQualifiedClassName(this) == "zlong::Template::AbstractLoadingClass"){
throw (new ArgumentError("can't be constructed"));
};
}
public function destroy():void{
throw (new ArgumentError("function destroy must be override"));
}
}
}//package zlong.Template
Section 190
//AbstractMainClass (zlong.Template.AbstractMainClass)
package zlong.Template {
import flash.display.*;
import zlong.spilSystemTool.*;
import flash.text.*;
import net.hires.debug.*;
import zlong.utils.*;
import flash.utils.*;
public class AbstractMainClass {
private var __mainMc:Sprite;
protected var __GameMc:Sprite;
private var _childClass:Class;
framework_internal static const VERSION:String = "v1.11.201007011936";
public function AbstractMainClass(mainMc:Sprite){
super();
if (getQualifiedClassName(this) == "zlong::Template::AbstractMainClass"){
throw (new ArgumentError("can't be constructed"));
};
this._childClass = (getDefinitionByName(getQualifiedClassName(this)) as Class);
this.__mainMc = mainMc;
this.__GameMc = new Sprite();
this.__GameMc.name = "GameMc";
this.__mainMc.addChild(this.__GameMc);
this.initGameSetting();
}
protected function initGameSetting():void{
SpilSetting.instance.init((this.__mainMc.root as Sprite), this.gameNameUnderline, AbstractRootClass.instance._childClass["__debug__"]);
SharedObjectUtil.init(this.gameNameUnderline);
GoogleEvent.instance.init(this.gameNameUnderline, this.__mainMc.root, AbstractRootClass.instance._childClass["__debug__"]);
}
protected function showVersion(v:String):void{
var tempMc:Sprite;
tempMc = new Sprite();
tempMc.name = "VersionMc";
tempMc.mouseEnabled = false;
this.__mainMc.addChild(tempMc);
var _tf:TextField = new TextField();
_tf.selectable = false;
_tf.mouseEnabled = false;
_tf.defaultTextFormat = new TextFormat("_san", 12, 0);
_tf.width = 200;
_tf.height = 50;
_tf.x = 0;
_tf.y = 0;
_tf.text = v;
tempMc.addChild(_tf);
}
protected function showFPS():void{
this.__mainMc.addChild(new Stats());
}
public function get gameNameUnderline():String{
return (AbstractRootClass.cutGameName((AbstractRootClass.instance._childClass["GAME_NAME"] as String)));
}
}
}//package zlong.Template
Section 191
//AbstractRootClass (zlong.Template.AbstractRootClass)
package zlong.Template {
import flash.events.*;
import flash.display.*;
import zlong.spilSystemTool.*;
import zlong.site.*;
import zlong.*;
import flash.utils.*;
import flash.geom.*;
public class AbstractRootClass extends MovieClip {
var _childClass:Class;
private var __mainMc:Sprite;
private var _game:Object;
private var _realLoaderUI:Object;
private var _textLoaderUI:TextLoader;
private var _loadingComplete:Boolean;
framework_internal static const VERSION:String = "v1.11.201007011936";
static var instance:AbstractRootClass;
public function AbstractRootClass(){
super();
instance = this;
this._loadingComplete = false;
this.stop();
if (getQualifiedClassName(this) == "zlong::Template::AbstractRootClass"){
throw (new ArgumentError("can't be constructed"));
};
this._childClass = (getDefinitionByName(getQualifiedClassName(this)) as Class);
if (!(this._childClass["GAME_FRAMERATE"] is int)){
throw (new ArgumentError("Class Root need static const Int 'GAME_FRAMERATE'"));
};
if (!(this._childClass["GAME_NAME"] is String)){
throw (new ArgumentError("Class Root need static const String 'GAME_NAME'"));
};
if (!(this._childClass["STAGE_WIGHT"] is int)){
throw (new ArgumentError("Class Root need static const Int 'STAGE_WIGHT'"));
};
if (!(this._childClass["STAGE_HEIGHT"] is int)){
throw (new ArgumentError("Class Root need static const Int 'STAGE_HEIGHT'"));
};
if (!(this._childClass["PORTAL_TYPE"] is String)){
throw (new ArgumentError("Class Root need static const String 'PORTAL_TYPE'"));
};
if (!(this._childClass["LOADING_CLASS_NAME"] is String)){
throw (new ArgumentError("Class Root need static const String 'LOADING_CLASS_NAME'"));
};
if (!(this._childClass["GAME_CLASS_NAME"] is String)){
throw (new ArgumentError("Class Root need static const String 'GAME_CLASS_NAME'"));
};
if (!(this._childClass["VERSION_NUM"] is String)){
throw (new ArgumentError("Class Root need static const String 'VERSION_NUM'"));
};
if (!(this._childClass["__debug__"] is Boolean)){
throw (new ArgumentError("Class Root need static const Boolean '__debug__'"));
};
stage.frameRate = this._childClass["GAME_FRAMERATE"];
this.__mainMc = new Sprite();
this.__mainMc.name = "__mainMc";
this.addChild(this.__mainMc);
if (!this._childClass["__debug__"]){
this.scrollRect = new Rectangle(0, 0, this._childClass["STAGE_WIGHT"], this._childClass["STAGE_HEIGHT"]);
};
this.addFrameScript(0, this.s0);
this.addFrameScript(1, this.s1);
this.addFrameScript(2, this.s2);
}
private function s0():void{
this.script0();
this.stop();
this.initSettingBeforeLoading();
this.initTextloader();
this.initLoading();
}
private function s1():void{
var realLoadingClass:Class;
this.script1();
this.stop();
this._childClass["LOADING_CLASS_NAME"];
realLoadingClass = (getDefinitionByName(this._childClass["LOADING_CLASS_NAME"]) as Class);
//unresolved jump
var _slot1 = e;
throw (new ArgumentError(("can`t found the Loading Class " + _childClass["LOADING_CLASS_NAME"])));
return;
this._realLoaderUI = new realLoadingClass(this.__mainMc);
if (!(this._realLoaderUI is (getDefinitionByName("zlong.Template.AbstractLoadingClass") as Class))){
throw (new ArgumentError("the Loading Class mush extends Class AbstractLoadingClass"));
};
}
private function s2():void{
var mainClass:Class;
this.script2();
this.stop();
mainClass = (getDefinitionByName(this._childClass["GAME_CLASS_NAME"]) as Class);
//unresolved jump
var _slot1 = e;
throw (new ArgumentError(("can`t found the Main Class " + _childClass["GAME_CLASS_NAME"])));
return;
this._game = new mainClass(this.__mainMc);
if (!(this._game is (getDefinitionByName("zlong.Template.AbstractMainClass") as Class))){
throw (new ArgumentError("the Main Class mush extends Class AbstractMainClass"));
};
}
private function initLoading():void{
this.addEventListener(Event.ENTER_FRAME, this.updateLoading);
this.loaderInfo.addEventListener(Event.COMPLETE, this.LoadingComplete);
}
private function LoadingComplete(event:Event):void{
this._loadingComplete = true;
}
private function updateLoading(event:Event):void{
if (this.framesLoaded == 1){
this._textLoaderUI.update();
};
if ((((this.currentFrame == 1)) && ((this.framesLoaded >= 2)))){
this.realLoaderLoadingFinish();
};
if ((((((((this.currentFrame == 2)) && (((this._loadingComplete) || ((this.totalFrames == this.framesLoaded)))))) && (LocalSiteDataLoader.localSiteDataLoaderFinish))) && (Award_HighScore.initializedFinish))){
this.loadingFinish();
this.delLoading();
};
}
private function delLoading():void{
this.removeEventListener(Event.ENTER_FRAME, this.updateLoading);
}
private function initTextloader():void{
this._textLoaderUI = new TextLoader(this.__mainMc, this._childClass["STAGE_WIGHT"], this._childClass["STAGE_HEIGHT"]);
}
protected function delTextLoader():void{
if (this._textLoaderUI){
this._textLoaderUI.del();
this._textLoaderUI = null;
};
}
protected function delRealLoadingUI():void{
if (this._realLoaderUI){
var _local1 = this._realLoaderUI;
_local1["destroy"]();
};
}
protected function initSettingBeforeLoading():void{
new GameSetting(this, false, this._childClass["PORTAL_TYPE"], cutGameName((this._childClass["GAME_NAME"] as String)), (cutGameName((this._childClass["GAME_NAME"] as String), "-", true) + ".html"), this._childClass["STAGE_WIGHT"], this._childClass["STAGE_HEIGHT"]);
Award_HighScore.instance.init(cutGameName((this._childClass["GAME_NAME"] as String)), this, this._childClass["__debug__"], this._childClass["__debug__"]);
}
protected function realLoaderLoadingFinish():void{
this.delTextLoader();
this.gotoAndStop(2);
}
protected function loadingFinish():void{
this.delRealLoadingUI();
this.gotoAndStop(3);
}
protected function script0():void{
}
protected function script1():void{
}
protected function script2():void{
}
public static function cutGameName(gamename:String, delim:String="_", initialToUpperCase:Boolean=false):String{
var re:RegExp = /[-| |_]/;
var gameNamePartArr:Array = gamename.split(re);
var paraName:String = "";
var paraNamePart:String = "";
var i:int;
while (i < gameNamePartArr.length) {
paraNamePart = ((gameNamePartArr[i] as String).toLowerCase() + delim);
if (initialToUpperCase){
paraName = (paraName + (paraNamePart.charAt(0).toUpperCase() + paraNamePart.substr(1)));
} else {
paraName = (paraName + paraNamePart);
};
i++;
};
paraName = paraName.substr(0, (paraName.length - 1));
return (paraName);
}
}
}//package zlong.Template
Section 192
//TextLoader (zlong.Template.TextLoader)
package zlong.Template {
import flash.display.*;
import flash.text.*;
import zlong.*;
public class TextLoader {
private var _tf:TextField;
private var _loaderInfo:LoaderInfo;
private var _width:Number;
private var _height:Number;
private var _pmc:Sprite;
framework_internal static const VERSION:String = "v1.11.201007011936";
public function TextLoader(pmc:Sprite, width:Number, height:Number){
super();
this._pmc = pmc;
this._width = width;
this._height = height;
this._loaderInfo = pmc.root.loaderInfo;
this._tf = new TextField();
this._tf.autoSize = TextFieldAutoSize.LEFT;
this._tf.defaultTextFormat = new TextFormat("_sans", 16, 0, true);
this._tf.height = 30;
this._pmc.addChild(this._tf);
}
function update():void{
this._tf.text = (("Loading... " + Math.floor(((100 * this._loaderInfo.bytesLoaded) / this._loaderInfo.bytesTotal))) + "%");
this._tf.x = ((this._width - this._tf.width) / 2);
this._tf.y = ((this._height - this._tf.height) / 2);
}
function del():void{
this._pmc.removeChild(this._tf);
this._tf = null;
this._loaderInfo = null;
this._pmc = null;
}
}
}//package zlong.Template
Section 193
//SharedObjectUtil (zlong.utils.SharedObjectUtil)
package zlong.utils {
import flash.events.*;
import flash.net.*;
public class SharedObjectUtil {
framework_internal static const VERSION:String = "v1.11.201007011936";
private static const PREFIX:String = "SpilGames";
private static const GLOBAL:String = "global";
private static var gameName:String;
private static var operatedSharedObject:SharedObject;
public static function init(gameName:String):void{
}
public static function getGlobal(name:String):SharedObject{
var so:SharedObject;
var name = name;
so = SharedObject.getLocal(((((PREFIX + "_") + GLOBAL) + "_") + name), "/");
//unresolved jump
var _slot1 = err;
Trace("||ZFW||", "create error");
return (so);
}
public static function getLocal(name:String):SharedObject{
var so:SharedObject;
var name = name;
so = SharedObject.getLocal(((((PREFIX + "_") + gameName) + "_") + name), "/");
//unresolved jump
var _slot1 = err;
Trace("||ZFW||", "create error");
return (so);
}
public static function save(sharedObject:SharedObject):void{
var flushResult:String;
var sharedObject = sharedObject;
operatedSharedObject = sharedObject;
flushResult = operatedSharedObject.flush();
if (flushResult == SharedObjectFlushStatus.PENDING){
operatedSharedObject.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
} else {
operatedSharedObject = null;
};
//unresolved jump
var _slot1 = err;
}
private static function statusHandler(event:NetStatusEvent):void{
if (event.info["code"] == "SharedObject.Flush.Failed"){
} else {
if (event.info["code"] == "SharedObject.Flush.Success"){
Trace("||ZFW||", "save successed");
};
};
operatedSharedObject.removeEventListener(NetStatusEvent.NET_STATUS, statusHandler);
operatedSharedObject = null;
}
}
}//package zlong.utils
Section 194
//framework_internal (zlong.framework_internal)
package zlong {
public namespace framework_internal = "http://www.zlonggames.com/flash/framework/internal";
}//package zlong
Section 195
//GameSetting (zlong.GameSetting)
package zlong {
import flash.display.*;
import zlong.site.*;
import zlong.country.*;
import zlong.data.*;
import zlong.display.*;
public class GameSetting {
private var _XMLLoader:LocalSiteDataLoader;
localComponent_internal static const VERSION:String = "v1.04.201006241504";
public static const PORTAL_TYPE_FAMILY:String = "family";
public static const PORTAL_TYPE_TWEEN:String = "tween";
public static const PORTAL_TYPE_GIRL:String = "girl";
public static const PORTAL_TYPE_TEEN:String = "teen";
public static const PORTAL_TYPE_ZAPAPA:String = "zapapa";
public static const PORTAL_TYPE_HYVES:String = "hyves";
public function GameSetting(displayObject:InteractiveObject, cnversion:Boolean, portal:String, name:String, html:String, width:int, height:int){
super();
GameInfo.cnversion = cnversion;
GameInfo.portal = portal;
GameInfo.name = name;
GameInfo.html = html;
GameInfo.width = width;
GameInfo.height = height;
this._XMLLoader = new LocalSiteDataLoader();
this.init();
this.initMenu(displayObject);
}
private function init():void{
new CountryCookie();
CountryInfo.instance.portal = GameInfo.portal;
if (CountryCookie.country == null){
CountryInfo.instance.country = "en_us";
} else {
CountryInfo.instance.country = String(CountryCookie.country);
};
}
private function initMenu(p:InteractiveObject):void{
new Menu(p);
}
}
}//package zlong
Section 196
//localComponent_internal (zlong.localComponent_internal)
package zlong {
public namespace localComponent_internal = "http://www.zlonggames.com/flash/localComponent/internal";
}//package zlong
Section 197
//achievement (achievement)
package {
import flash.media.*;
public dynamic class achievement extends Sound {
}
}//package
Section 198
//addScore (addScore)
package {
import flash.display.*;
public dynamic class addScore extends MovieClip {
public var mc:MovieClip;
}
}//package
Section 199
//addTime (addTime)
package {
import flash.display.*;
public dynamic class addTime extends MovieClip {
public var mc:MovieClip;
}
}//package
Section 200
//arrow (arrow)
package {
import flash.display.*;
public dynamic class arrow extends MovieClip {
public var shade:MovieClip;
}
}//package
Section 201
//bag (bag)
package {
import flash.display.*;
public dynamic class bag extends MovieClip {
public var bagHit:MovieClip;
}
}//package
Section 202
//bleed (bleed)
package {
import flash.display.*;
public dynamic class bleed extends MovieClip {
}
}//package
Section 203
//bomb (bomb)
package {
import flash.display.*;
public dynamic class bomb extends MovieClip {
public var bombHit:MovieClip;
}
}//package
Section 204
//bombCountdown (bombCountdown)
package {
import flash.media.*;
public dynamic class bombCountdown extends Sound {
}
}//package
Section 205
//bow (bow)
package {
import flash.display.*;
public dynamic class bow extends MovieClip {
public var point:MovieClip;
}
}//package
Section 206
//burst (burst)
package {
import flash.display.*;
public dynamic class burst extends MovieClip {
}
}//package
Section 207
//Collectpowerup (Collectpowerup)
package {
import flash.media.*;
public dynamic class Collectpowerup extends Sound {
}
}//package
Section 208
//Copyright (Copyright)
package {
import zlong.display.*;
public dynamic class Copyright extends Copyright {
}
}//package
Section 209
//CountriesBox (CountriesBox)
package {
import zlong.display.*;
public dynamic class CountriesBox extends CountriesBox {
}
}//package
Section 210
//countTime (countTime)
package {
import flash.display.*;
public dynamic class countTime extends MovieClip {
}
}//package
Section 211
//cow (cow)
package {
import flash.display.*;
public dynamic class cow extends MovieClip {
public var hitMc:MovieClip;
}
}//package
Section 212
//Cryoffear1 (Cryoffear1)
package {
import flash.media.*;
public dynamic class Cryoffear1 extends Sound {
}
}//package
Section 213
//Cryoffear2 (Cryoffear2)
package {
import flash.media.*;
public dynamic class Cryoffear2 extends Sound {
}
}//package
Section 214
//dance (dance)
package {
import flash.display.*;
public dynamic class dance extends MovieClip {
}
}//package
Section 215
//Dropacowcrush (Dropacowcrush)
package {
import flash.media.*;
public dynamic class Dropacowcrush extends Sound {
}
}//package
Section 216
//Dropacowfall (Dropacowfall)
package {
import flash.media.*;
public dynamic class Dropacowfall extends Sound {
}
}//package
Section 217
//Exploding (Exploding)
package {
import flash.media.*;
public dynamic class Exploding extends Sound {
}
}//package
Section 218
//explodingArrow (explodingArrow)
package {
import flash.display.*;
public dynamic class explodingArrow extends MovieClip {
}
}//package
Section 219
//export (export)
package {
import flash.display.*;
public dynamic class export extends MovieClip {
}
}//package
Section 220
//fat_auch1 (fat_auch1)
package {
import flash.media.*;
public dynamic class fat_auch1 extends Sound {
}
}//package
Section 221
//fat_auch2 (fat_auch2)
package {
import flash.media.*;
public dynamic class fat_auch2 extends Sound {
}
}//package
Section 222
//fat_auch3 (fat_auch3)
package {
import flash.media.*;
public dynamic class fat_auch3 extends Sound {
}
}//package
Section 223
//fat_auch4 (fat_auch4)
package {
import flash.media.*;
public dynamic class fat_auch4 extends Sound {
}
}//package
Section 224
//fat_auch5 (fat_auch5)
package {
import flash.media.*;
public dynamic class fat_auch5 extends Sound {
}
}//package
Section 225
//fat_die1 (fat_die1)
package {
import flash.media.*;
public dynamic class fat_die1 extends Sound {
}
}//package
Section 226
//fat_die2 (fat_die2)
package {
import flash.media.*;
public dynamic class fat_die2 extends Sound {
}
}//package
Section 227
//fat_fireauch (fat_fireauch)
package {
import flash.media.*;
public dynamic class fat_fireauch extends Sound {
}
}//package
Section 228
//fat_setlandmine (fat_setlandmine)
package {
import flash.media.*;
public dynamic class fat_setlandmine extends Sound {
}
}//package
Section 229
//fat_steploop (fat_steploop)
package {
import flash.media.*;
public dynamic class fat_steploop extends Sound {
}
}//package
Section 230
//fat_strikeback (fat_strikeback)
package {
import flash.media.*;
public dynamic class fat_strikeback extends Sound {
}
}//package
Section 231
//fatamanAction (fatamanAction)
package {
import flash.display.*;
public dynamic class fatamanAction extends MovieClip {
public var deadFatMan:MovieClip;
public var life:MovieClip;
public var leftFoot:MovieClip;
public var leftCrus:MovieClip;
public var rightThigh:MovieClip;
public var leftThigh:MovieClip;
public var rightCrus:MovieClip;
public var rightArm:MovieClip;
public var body:MovieClip;
public var rightFoot:MovieClip;
public var head:MovieClip;
public function fatamanAction(){
addFrameScript(189, frame190);
}
function frame190(){
this.stop();
}
}
}//package
Section 232
//flame (flame)
package {
import flash.display.*;
public dynamic class flame extends MovieClip {
}
}//package
Section 233
//flamingArrow (flamingArrow)
package {
import flash.display.*;
public dynamic class flamingArrow extends MovieClip {
}
}//package
Section 234
//gameScene (gameScene)
package {
import flash.display.*;
import flash.text.*;
public dynamic class gameScene extends MovieClip {
public var fatmanMc:MovieClip;
public var arrowNumMc:MovieClip;
public var killNum:TextField;
public var napoleonMc:MovieClip;
public var timeNum:TextField;
public var __id2_:Logo;
public var scoreNum:TextField;
public var backdropMc:MovieClip;
public function gameScene(){
__setProp___id2__ingame_Layer7_1();
}
function __setProp___id2__ingame_Layer7_1(){
try {
__id2_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id2_.alignHorizontal = "Center";
__id2_.alignVertical = "Center";
__id2_.maxHeight = 40;
__id2_.maxWidth = 150;
__id2_.position = "logo_playingGame";
try {
__id2_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 235
//girls (girls)
package {
import flash.display.*;
public dynamic class girls extends MovieClip {
}
}//package
Section 236
//HideConsole (HideConsole)
package {
public var HideConsole:Boolean;
HideConsole = false;
}//package
Section 237
//Hitinbody (Hitinbody)
package {
import flash.media.*;
public dynamic class Hitinbody extends Sound {
}
}//package
Section 238
//horn_Fatguykill (horn_Fatguykill)
package {
import flash.media.*;
public dynamic class horn_Fatguykill extends Sound {
}
}//package
Section 239
//house1 (house1)
package {
import flash.display.*;
public dynamic class house1 extends MovieClip {
}
}//package
Section 240
//house2 (house2)
package {
import flash.display.*;
public dynamic class house2 extends MovieClip {
}
}//package
Section 241
//house3 (house3)
package {
import flash.display.*;
public dynamic class house3 extends MovieClip {
}
}//package
Section 242
//house4 (house4)
package {
import flash.display.*;
public dynamic class house4 extends MovieClip {
}
}//package
Section 243
//house5 (house5)
package {
import flash.display.*;
public dynamic class house5 extends MovieClip {
}
}//package
Section 244
//house6 (house6)
package {
import flash.display.*;
public dynamic class house6 extends MovieClip {
}
}//package
Section 245
//house7 (house7)
package {
import flash.display.*;
public dynamic class house7 extends MovieClip {
}
}//package
Section 246
//house8 (house8)
package {
import flash.display.*;
public dynamic class house8 extends MovieClip {
}
}//package
Section 247
//houseBackdrop (houseBackdrop)
package {
import flash.display.*;
public dynamic class houseBackdrop extends MovieClip {
}
}//package
Section 248
//indicate (indicate)
package {
import flash.display.*;
public dynamic class indicate extends MovieClip {
}
}//package
Section 249
//jumponfat (jumponfat)
package {
import flash.media.*;
public dynamic class jumponfat extends Sound {
}
}//package
Section 250
//keyDown (keyDown)
package {
import flash.display.*;
public dynamic class keyDown extends MovieClip {
}
}//package
Section 251
//keyUp (keyUp)
package {
import flash.display.*;
public dynamic class keyUp extends MovieClip {
}
}//package
Section 252
//lamp (lamp)
package {
import flash.display.*;
public dynamic class lamp extends MovieClip {
}
}//package
Section 253
//lawn (lawn)
package {
import flash.display.*;
public dynamic class lawn extends MovieClip {
}
}//package
Section 254
//leftHand (leftHand)
package {
import flash.display.*;
public dynamic class leftHand extends MovieClip {
public var hand:MovieClip;
}
}//package
Section 255
//localization (localization)
package {
import flash.display.*;
public dynamic class localization extends MovieClip {
}
}//package
Section 256
//Logo (Logo)
package {
import zlong.display.*;
public dynamic class Logo extends Logo {
}
}//package
Section 257
//loseLife (loseLife)
package {
import flash.display.*;
public dynamic class loseLife extends MovieClip {
public var mc:MovieClip;
}
}//package
Section 258
//Main (Main)
package {
import flash.display.*;
import zlong.Template.*;
import ui.*;
import zlong.breathxue.utils.debug.*;
public class Main extends AbstractMainClass {
private static var _instance:Main;
public function Main(mainMc:Sprite){
_instance = this;
super(mainMc);
showVersion(Root.VERSION_NUM);
if (Root.__debug__){
TC.InitTC(__GameMc);
showFPS();
};
gameStart();
}
private function gameStart():void{
new Manage(this.__GameMc);
__GameMc.stage.tabChildren = false;
__GameMc.stage.stageFocusRect = false;
__GameMc.stage.scaleMode = StageScaleMode.EXACT_FIT;
}
public static function get instance():Main{
return (_instance);
}
}
}//package
Section 259
//MainMenu (MainMenu)
package {
import flash.display.*;
public dynamic class MainMenu extends MovieClip {
public var qualitySwitch:MovieClip;
public var soundSwitch:MovieClip;
public var __id1_:MoreGamesLogocopy;
public var newGame:MovieClip;
public var howToPlay:MovieClip;
public var musicSwitch:MovieClip;
public function MainMenu(){
__setProp___id1___1();
}
function __setProp___id1___1(){
try {
__id1_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id1_.position = "button_mainscreen_moregames";
__id1_.type = "moregames";
try {
__id1_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 260
//maker (maker)
package {
import flash.display.*;
public dynamic class maker extends MovieClip {
public var b_back:MovieClip;
}
}//package
Section 261
//Mc_UiLoading (Mc_UiLoading)
package {
import flash.display.*;
import flash.text.*;
public dynamic class Mc_UiLoading extends MovieClip {
public var perBar:MovieClip;
public var __id3_:Logo;
public var perText:TextField;
public function Mc_UiLoading(){
__setProp___id3__Loading__1();
}
function __setProp___id3__Loading__1(){
try {
__id3_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id3_.alignHorizontal = "Center";
__id3_.alignVertical = "Center";
__id3_.maxHeight = 40;
__id3_.maxWidth = 150;
__id3_.position = "logo_preloader";
try {
__id3_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 262
//menu_press (menu_press)
package {
import flash.media.*;
public dynamic class menu_press extends Sound {
}
}//package
Section 263
//menu_touch (menu_touch)
package {
import flash.media.*;
public dynamic class menu_touch extends Sound {
}
}//package
Section 264
//MoreGamesLogocopy (MoreGamesLogocopy)
package {
import zlong.display.*;
public dynamic class MoreGamesLogocopy extends ExtButton {
public var __id0_:Logo;
public function MoreGamesLogocopy(){
__setProp___id0__MoreGamesLogocopy_Layer4_1();
}
function __setProp___id0__MoreGamesLogocopy_Layer4_1(){
try {
__id0_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id0_.alignHorizontal = "Center";
__id0_.alignVertical = "Down";
__id0_.maxHeight = 30;
__id0_.maxWidth = 160;
__id0_.position = "logo_preloader";
try {
__id0_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 265
//MoreGamesLogocopy2 (MoreGamesLogocopy2)
package {
import zlong.display.*;
public dynamic class MoreGamesLogocopy2 extends ExtButton {
public var __id5_:Logo;
public function MoreGamesLogocopy2(){
__setProp___id5__MoreGamesLogocopy2_Layer4_1();
}
function __setProp___id5__MoreGamesLogocopy2_Layer4_1(){
try {
__id5_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id5_.alignHorizontal = "Center";
__id5_.alignVertical = "Down";
__id5_.maxHeight = 20;
__id5_.maxWidth = 150;
__id5_.position = "logo_preloader";
try {
__id5_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 266
//mouseClick (mouseClick)
package {
import flash.display.*;
public dynamic class mouseClick extends MovieClip {
}
}//package
Section 267
//mouseMove (mouseMove)
package {
import flash.display.*;
public dynamic class mouseMove extends MovieClip {
}
}//package
Section 268
//music (music)
package {
import flash.display.*;
public dynamic class music extends MovieClip {
}
}//package
Section 269
//napoleon_Buzzer1 (napoleon_Buzzer1)
package {
import flash.media.*;
public dynamic class napoleon_Buzzer1 extends Sound {
}
}//package
Section 270
//napoleon_Buzzer2 (napoleon_Buzzer2)
package {
import flash.media.*;
public dynamic class napoleon_Buzzer2 extends Sound {
}
}//package
Section 271
//napoleon_jump (napoleon_jump)
package {
import flash.display.*;
public dynamic class napoleon_jump extends MovieClip {
public var handPoint:MovieClip;
public var hitMc:MovieClip;
public var lifeHand:leftHand;
public var bowPoint:MovieClip;
}
}//package
Section 272
//napoleon_laugh1 (napoleon_laugh1)
package {
import flash.media.*;
public dynamic class napoleon_laugh1 extends Sound {
}
}//package
Section 273
//napoleon_laugh2 (napoleon_laugh2)
package {
import flash.media.*;
public dynamic class napoleon_laugh2 extends Sound {
}
}//package
Section 274
//napoleon_laugh3 (napoleon_laugh3)
package {
import flash.media.*;
public dynamic class napoleon_laugh3 extends Sound {
}
}//package
Section 275
//napoleon_laugh4 (napoleon_laugh4)
package {
import flash.media.*;
public dynamic class napoleon_laugh4 extends Sound {
}
}//package
Section 276
//napoleon_laugh5 (napoleon_laugh5)
package {
import flash.media.*;
public dynamic class napoleon_laugh5 extends Sound {
}
}//package
Section 277
//napoleon_laugh6 (napoleon_laugh6)
package {
import flash.media.*;
public dynamic class napoleon_laugh6 extends Sound {
}
}//package
Section 278
//napoleon_run (napoleon_run)
package {
import flash.display.*;
public dynamic class napoleon_run extends MovieClip {
public var shadow:MovieClip;
public var handPoint:MovieClip;
public var hitMc:MovieClip;
public var lifeHand:leftHand;
public var body:MovieClip;
public var bowPoint:MovieClip;
}
}//package
Section 279
//napoleon_tumble (napoleon_tumble)
package {
import flash.display.*;
public dynamic class napoleon_tumble extends MovieClip {
public var shadow:MovieClip;
public var hitMc:MovieClip;
}
}//package
Section 280
//napoleonstupid_fvo (napoleonstupid_fvo)
package {
import flash.media.*;
public dynamic class napoleonstupid_fvo extends Sound {
}
}//package
Section 281
//napoleonstupid_menu (napoleonstupid_menu)
package {
import flash.media.*;
public dynamic class napoleonstupid_menu extends Sound {
}
}//package
Section 282
//note (note)
package {
import flash.display.*;
public dynamic class note extends MovieClip {
}
}//package
Section 283
//Now_go_get_em (Now_go_get_em)
package {
import zlong.display.*;
public dynamic class Now_go_get_em extends TranText {
}
}//package
Section 284
//NVO1 (NVO1)
package {
import flash.media.*;
public dynamic class NVO1 extends Sound {
}
}//package
Section 285
//NVO2 (NVO2)
package {
import flash.media.*;
public dynamic class NVO2 extends Sound {
}
}//package
Section 286
//otherclick (otherclick)
package {
import flash.media.*;
public dynamic class otherclick extends Sound {
}
}//package
Section 287
//passring (passring)
package {
import flash.media.*;
public dynamic class passring extends Sound {
}
}//package
Section 288
//pauseGame (pauseGame)
package {
import flash.display.*;
public dynamic class pauseGame extends MovieClip {
public var box:MovieClip;
}
}//package
Section 289
//pig_hum (pig_hum)
package {
import flash.media.*;
public dynamic class pig_hum extends Sound {
}
}//package
Section 290
//pig_jump (pig_jump)
package {
import flash.media.*;
public dynamic class pig_jump extends Sound {
}
}//package
Section 291
//pig_step (pig_step)
package {
import flash.media.*;
public dynamic class pig_step extends Sound {
}
}//package
Section 292
//Popuptext (Popuptext)
package {
import flash.media.*;
public dynamic class Popuptext extends Sound {
}
}//package
Section 293
//Powerupslotmachine (Powerupslotmachine)
package {
import flash.media.*;
public dynamic class Powerupslotmachine extends Sound {
}
}//package
Section 294
//prop (prop)
package {
import flash.display.*;
public dynamic class prop extends MovieClip {
}
}//package
Section 295
//propRoll (propRoll)
package {
import flash.display.*;
public dynamic class propRoll extends MovieClip {
}
}//package
Section 296
//reload (reload)
package {
import flash.media.*;
public dynamic class reload extends Sound {
}
}//package
Section 297
//road (road)
package {
import flash.display.*;
public dynamic class road extends MovieClip {
}
}//package
Section 298
//Root (Root)
package {
import zlong.spilSystemTool.*;
import zlong.Template.*;
import zlong.*;
public class Root extends AbstractRootClass {
public static const STAGE_WIGHT:int = 650;
public static const GAME_CLASS_NAME:String = "Main";
public static const STAGE_HEIGHT:int = 350;
public static const PORTAL_TYPE:String = GameSetting.PORTAL_TYPE_TWEEN;
public static const VERSION_NUM:String = "";
public static const __debug__:Boolean = false;
public static const LOADING_CLASS_NAME:String = "zlong.Template.demo.ui.UiLoading";
public static const GAME_FRAMERATE:int = 30;
public static const GAME_NAME:String = "Napoleon_Stupid";
public function Root(){
super();
}
override protected function initSettingBeforeLoading():void{
new GameSetting(this, false, PORTAL_TYPE, cutGameName(GAME_NAME), (cutGameName(GAME_NAME, "-", true) + ".html"), STAGE_WIGHT, STAGE_HEIGHT);
Award_HighScore.instance.init(cutGameName(GAME_NAME), this, __debug__, __debug__);
}
override protected function script0():void{
Trace("script0");
}
override protected function script1():void{
Trace("script1");
}
override protected function script2():void{
Trace("script2");
}
}
}//package
Section 299
//seconds (seconds)
package {
import flash.media.*;
public dynamic class seconds extends Sound {
}
}//package
Section 300
//shoot (shoot)
package {
import flash.media.*;
public dynamic class shoot extends Sound {
}
}//package
Section 301
//shoot_Burningarrow (shoot_Burningarrow)
package {
import flash.media.*;
public dynamic class shoot_Burningarrow extends Sound {
}
}//package
Section 302
//shoot_missle (shoot_missle)
package {
import flash.media.*;
public dynamic class shoot_missle extends Sound {
}
}//package
Section 303
//shootProp (shootProp)
package {
import flash.display.*;
public dynamic class shootProp extends MovieClip {
}
}//package
Section 304
//soundMc (soundMc)
package {
import flash.display.*;
public dynamic class soundMc extends MovieClip {
}
}//package
Section 305
//startGame (startGame)
package {
import flash.display.*;
public dynamic class startGame extends MovieClip {
public var start:MovieClip;
}
}//package
Section 306
//target (target)
package {
import flash.display.*;
public dynamic class target extends MovieClip {
public var targetMc:MovieClip;
}
}//package
Section 307
//text_cow2 (text_cow2)
package {
import flash.display.*;
public dynamic class text_cow2 extends MovieClip {
}
}//package
Section 308
//text_cow3 (text_cow3)
package {
import flash.display.*;
public dynamic class text_cow3 extends MovieClip {
}
}//package
Section 309
//text_dance (text_dance)
package {
import flash.display.*;
public dynamic class text_dance extends MovieClip {
}
}//package
Section 310
//text_dead_1 (text_dead_1)
package {
import flash.display.*;
public dynamic class text_dead_1 extends MovieClip {
}
}//package
Section 311
//text_dead_2 (text_dead_2)
package {
import flash.display.*;
public dynamic class text_dead_2 extends MovieClip {
}
}//package
Section 312
//text_dead_3 (text_dead_3)
package {
import flash.display.*;
public dynamic class text_dead_3 extends MovieClip {
}
}//package
Section 313
//text_dead_4 (text_dead_4)
package {
import flash.display.*;
public dynamic class text_dead_4 extends MovieClip {
}
}//package
Section 314
//text_dead_5 (text_dead_5)
package {
import flash.display.*;
public dynamic class text_dead_5 extends MovieClip {
}
}//package
Section 315
//text_exploding (text_exploding)
package {
import flash.display.*;
public dynamic class text_exploding extends MovieClip {
}
}//package
Section 316
//text_flaming (text_flaming)
package {
import flash.display.*;
public dynamic class text_flaming extends MovieClip {
}
}//package
Section 317
//TimeUp (TimeUp)
package {
import flash.display.*;
public dynamic class TimeUp extends MovieClip {
public var box:MovieClip;
}
}//package
Section 318
//title1 (title1)
package {
import zlong.display.*;
public dynamic class title1 extends TranText {
}
}//package
Section 319
//title2 (title2)
package {
import zlong.display.*;
public dynamic class title2 extends TranText {
}
}//package
Section 320
//Trace (Trace)
package {
import zlong.breathxue.utils.debug.*;
import flash.utils.*;
public function Trace(... _args):void{
var TcClass:Class;
var args = _args;
var arg0 = "";
if ((args[0] is String)){
arg0 = args[0];
if ((((((((arg0.charAt(0) == "|")) && ((arg0.charAt(1) == "|")))) && ((arg0.charAt((arg0.length - 2)) == "|")))) && ((arg0.charAt((arg0.length - 1)) == "|")))){
arg0 = arg0.substring(1, (arg0.length - 1));
args.shift();
} else {
arg0 = "";
};
};
if (!HideConsole){
trace((arg0 + args.join(" ")));
};
if (TcShow){
TcClass = (getDefinitionByName("zlong.breathxue.utils.debug.TC") as Class);
//unresolved jump
var _slot1 = e;
TcShow = false;
if (TcClass){
var _local3 = TcClass;
_local3["SHOW"](arg0, args);
};
};
}
}//package
Section 321
//tree (tree)
package {
import flash.display.*;
public dynamic class tree extends MovieClip {
}
}//package
Section 322
//whist_timeup (whist_timeup)
package {
import flash.media.*;
public dynamic class whist_timeup extends Sound {
}
}//package
Section 323
//wz_Aim (wz_Aim)
package {
import zlong.display.*;
public dynamic class wz_Aim extends TranText {
}
}//package
Section 324
//wz_back (wz_back)
package {
import zlong.display.*;
public dynamic class wz_back extends TranText {
}
}//package
Section 325
//wz_Boom_That’s_gotta_hurt (wz_Boom_That’s_gotta_hurt)
package {
import zlong.display.*;
public dynamic class wz_Boom_That’s_gotta_hurt extends TranText {
}
}//package
Section 326
//wz_Credits (wz_Credits)
package {
import zlong.display.*;
public dynamic class wz_Credits extends TranText {
}
}//package
Section 327
//wz_De_la_oink (wz_De_la_oink)
package {
import zlong.display.*;
public dynamic class wz_De_la_oink extends TranText {
}
}//package
Section 328
//wz_haw_to_play (wz_haw_to_play)
package {
import zlong.display.*;
public dynamic class wz_haw_to_play extends TranText {
}
}//package
Section 329
//wz_Je_suis_une_baguette (wz_Je_suis_une_baguette)
package {
import zlong.display.*;
public dynamic class wz_Je_suis_une_baguette extends TranText {
}
}//package
Section 330
//wz_Jump (wz_Jump)
package {
import zlong.display.*;
public dynamic class wz_Jump extends TranText {
}
}//package
Section 331
//wz_KillingSpree (wz_KillingSpree)
package {
import zlong.display.*;
public dynamic class wz_KillingSpree extends TranText {
}
}//package
Section 332
//wz_kills_in_a_row (wz_kills_in_a_row)
package {
import zlong.display.*;
public dynamic class wz_kills_in_a_row extends TranText {
}
}//package
Section 333
//wz_Let’s_dance (wz_Let’s_dance)
package {
import zlong.display.*;
public dynamic class wz_Let’s_dance extends TranText {
}
}//package
Section 334
//wz_Menu (wz_Menu)
package {
import zlong.display.*;
public dynamic class wz_Menu extends TranText {
}
}//package
Section 335
//wz_Mooooo (wz_Mooooo)
package {
import zlong.display.*;
public dynamic class wz_Mooooo extends TranText {
}
}//package
Section 336
//wz_More_crazy_games_at (wz_More_crazy_games_at)
package {
import zlong.display.*;
public dynamic class wz_More_crazy_games_at extends TranText {
}
}//package
Section 337
//wz_more_games (wz_more_games)
package {
import zlong.display.*;
public dynamic class wz_more_games extends TranText {
}
}//package
Section 338
//wz_Next_Target (wz_Next_Target)
package {
import zlong.display.*;
public dynamic class wz_Next_Target extends TranText {
}
}//package
Section 339
//wz_Omelette_du_fromage (wz_Omelette_du_fromage)
package {
import zlong.display.*;
public dynamic class wz_Omelette_du_fromage extends TranText {
}
}//package
Section 340
//wz_Ooh_la_la (wz_Ooh_la_la)
package {
import zlong.display.*;
public dynamic class wz_Ooh_la_la extends TranText {
}
}//package
Section 341
//wz_play (wz_play)
package {
import zlong.display.*;
public dynamic class wz_play extends TranText {
}
}//package
Section 342
//wz_Press_P_to_pause (wz_Press_P_to_pause)
package {
import zlong.display.*;
public dynamic class wz_Press_P_to_pause extends TranText {
}
}//package
Section 343
//wz_Reload (wz_Reload)
package {
import zlong.display.*;
public dynamic class wz_Reload extends TranText {
}
}//package
Section 344
//wz_Resume (wz_Resume)
package {
import zlong.display.*;
public dynamic class wz_Resume extends TranText {
}
}//package
Section 345
//wz_score (wz_score)
package {
import zlong.display.*;
public dynamic class wz_score extends TranText {
}
}//package
Section 346
//wz_scorecopy (wz_scorecopy)
package {
import zlong.display.*;
public dynamic class wz_scorecopy extends TranText {
}
}//package
Section 347
//wz_Shoot (wz_Shoot)
package {
import zlong.display.*;
public dynamic class wz_Shoot extends TranText {
}
}//package
Section 348
//wz_Shoot_power_ups (wz_Shoot_power_ups)
package {
import zlong.display.*;
public dynamic class wz_Shoot_power_ups extends TranText {
}
}//package
Section 349
//wz_Something’s_cookin (wz_Something’s_cookin)
package {
import zlong.display.*;
public dynamic class wz_Something’s_cookin extends TranText {
}
}//package
Section 350
//wz_start (wz_start)
package {
import zlong.display.*;
public dynamic class wz_start extends TranText {
}
}//package
Section 351
//wz_The_cow_is_okay (wz_The_cow_is_okay)
package {
import zlong.display.*;
public dynamic class wz_The_cow_is_okay extends TranText {
}
}//package
Section 352
//wz_Time_is_up (wz_Time_is_up)
package {
import zlong.display.*;
public dynamic class wz_Time_is_up extends TranText {
}
}//package
Section 353
//wz_Try_again (wz_Try_again)
package {
import zlong.display.*;
public dynamic class wz_Try_again extends TranText {
}
}//package
Section 354
//wz_Vive_la_stupid (wz_Vive_la_stupid)
package {
import zlong.display.*;
public dynamic class wz_Vive_la_stupid extends TranText {
}
}//package
Section 355
//主界面 (主界é¢)
package {
import flash.media.*;
public dynamic class 主界面 extends Sound {
}
}//package
Section 356
//关卡 (å…³å¡)
package {
import flash.media.*;
public dynamic class 关卡 extends Sound {
}
}//package
Section 357
//失败 (失败)
package {
import flash.media.*;
public dynamic class 失败 extends Sound {
}
}//package
Section 358
//标题03 (æ ‡é¢˜03)
package {
import zlong.display.*;
public dynamic class 标题03 extends TranText {
}
}//package
Section 359
//游戏结束 (游æˆç»“æŸ)
package {
import flash.media.*;
public dynamic class 游戏结束 extends Sound {
}
}//package
Section 360
//跳舞 (跳舞)
package {
import flash.media.*;
public dynamic class 跳舞 extends Sound {
}
}//package