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
//AlbumService (com.spilgames.api.AlbumService)
package com.spilgames.api {
import flash.display.*;
public class AlbumService {
public function AlbumService(){
super();
}
public static function addItem(imageBitmapData:BitmapData, previewBitmapData:BitmapData, callback:Function=null, options:Object=null):int{
if (!options){
options = {};
};
options.title = (options.hasOwnProperty("title")) ? options.title : "";
options.description = (options.hasOwnProperty("description")) ? options.description : "";
options.encodingQuality = (options.hasOwnProperty("encodingQuality")) ? parseInt(options.encodingQuality) : 90;
return (SpilGamesServices.getInstance().send("Album", "addItem", callback, {userName:User.getUserName(), userHash:User.getUserHash(), imageBitmapData:imageBitmapData, previewBitmapData:previewBitmapData, editingData:null, options:options}));
}
public static function isAvailable():Boolean{
return (SpilGamesServices.getInstance().isServiceAvailable("Album"));
}
}
}//package com.spilgames.api
Section 70
//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 71
//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 72
//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 73
//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 74
//Game (core.Game)
package core {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import zlong.spilSystemTool.*;
import manager.*;
public class Game extends MovieClip {
private var _cut:CutManager;
private var _currentManager:String;
private var _animal:AnimalManager;
private var _complete:CompleteManager;
private var _introduce:IntroductionManager;
private var _fill:FillManager;
private var _sew:SewManager;
private var _cloth:ClothManager;
private var _decorate:DecorateManager;
private var _menu:MenuManager;
public static var DEBUG:Boolean = true;
private static var isFirst:Boolean = true;
public function Game(){
super();
}
private function goComplete(event:Event):void{
_currentManager = "complete";
removeDecorate();
}
private function cut(event:Event):void{
_cut = CutManager(UIConsole.getInstance().showUI(Manager.CUTTING));
_cut.addEventListener(UIEvent.GOMENU, goMenu);
_cut.addEventListener(UIEvent.KEEPCUTTRING, goCutting);
_cut.addEventListener(UIEvent.SEW, goSew);
}
private function removeCloth():void{
if (_cloth != null){
if (_currentManager != "goMenu"){
_cloth.addEventListener(UIEvent.DELOVER, cut);
} else {
_cloth.addEventListener(UIEvent.DELOVER, initGameMenu);
};
_cloth.dispose();
_cloth.removeEventListener(UIEvent.CUTTING, goCutting);
_cloth.removeEventListener(UIEvent.GOMENU, goMenu);
_cloth = null;
};
}
private function removeSew():void{
if (_sew != null){
if (_currentManager == "sew"){
_sew.addEventListener(UIEvent.DELOVER, sew);
} else {
if (_currentManager == "goMenu"){
_sew.addEventListener(UIEvent.DELOVER, initGameMenu);
} else {
_sew.addEventListener(UIEvent.DELOVER, fill);
};
};
_sew.dispose();
_sew.removeEventListener(UIEvent.GOMENU, goMenu);
_sew.removeEventListener(UIEvent.KEEPSEW, goSew);
_sew = null;
};
}
private function removeMenu():void{
if (_menu != null){
_menu.addEventListener(UIEvent.DELOVER, start);
_menu.dispose();
_menu.removeEventListener(UIEvent.STARTGAME, startGame);
_menu = null;
};
}
private function fill(event:Event):void{
_fill = FillManager(UIConsole.getInstance().showUI(Manager.FILL));
_fill.addEventListener(UIEvent.DECORATE, goDecorate);
_fill.addEventListener(UIEvent.GOMENU, goMenu);
}
private function goFill(event:Event):void{
_currentManager = "fill";
removeSew();
}
private function decorate(event:Event):void{
_decorate = DecorateManager(UIConsole.getInstance().showUI(Manager.DECORATE));
_decorate.addEventListener(UIEvent.COMPLETE, goComplete);
_decorate.addEventListener(UIEvent.GOMENU, goMenu);
}
public function init():void{
UIConsole.getInstance().init(this);
initGameMenu(null);
}
private function goCloth(event:Event):void{
_currentManager = "cloth";
removeAnimal();
}
private function goDecorate(event:Event):void{
_currentManager = "decorate";
removeFill();
}
private function cloth(event:Event):void{
_cloth = ClothManager(UIConsole.getInstance().showUI(Manager.CLOTHCHOOSE));
_cloth.addEventListener(UIEvent.CUTTING, goCutting);
_cloth.addEventListener(UIEvent.GOMENU, goMenu);
}
private function goSew(event:Event):void{
_currentManager = "sew";
removeCut();
removeSew();
}
private function removeCut():void{
if (_cut != null){
if (_currentManager == "cut"){
_cut.addEventListener(UIEvent.DELOVER, cut);
} else {
if (_currentManager == "goMenu"){
_cut.addEventListener(UIEvent.DELOVER, initGameMenu);
} else {
_cut.addEventListener(UIEvent.DELOVER, sew);
};
};
_cut.dispose();
_cut.removeEventListener(UIEvent.GOMENU, goMenu);
_cut.removeEventListener(UIEvent.KEEPCUTTRING, goCutting);
_cut.removeEventListener(UIEvent.SEW, goSew);
_cut = null;
};
}
private function initGameMenu(event:Event):void{
_currentManager = "menu";
Data.setBack();
if (isFirst){
GoogleEvent.instance.gaTrackEvent("mainscreen viewed", true);
isFirst = false;
};
_menu = MenuManager(UIConsole.getInstance().showUI(Manager.MENU));
_menu.addEventListener(UIEvent.STARTGAME, startGame);
}
private function removeComplete():void{
if (_complete != null){
if (_currentManager != "goMenu"){
_complete.addEventListener(UIEvent.DELOVER, complete);
} else {
_complete.addEventListener(UIEvent.DELOVER, initGameMenu);
};
_complete.dispose();
_complete.removeEventListener(UIEvent.GOMENU, goMenu);
_complete = null;
};
}
private function sew(event:Event):void{
_sew = SewManager(UIConsole.getInstance().showUI(Manager.SEW));
_sew.addEventListener(UIEvent.GOMENU, goMenu);
_sew.addEventListener(UIEvent.KEEPSEW, goSew);
_sew.addEventListener(UIEvent.FILL, goFill);
}
private function goMenu(event:Event):void{
_currentManager = "goMenu";
removeAnimal();
removeIntroduce();
removeCloth();
removeCut();
removeSew();
removeFill();
removeDecorate();
removeComplete();
}
private function goCutting(event:Event):void{
_currentManager = "cut";
removeCloth();
removeCut();
}
private function start(event:Event):void{
_introduce = IntroductionManager(UIConsole.getInstance().showUI(Manager.Introduction));
_introduce.addEventListener(UIEvent.ANIMALCHOOSE, animalChoose);
_introduce.addEventListener(UIEvent.GOMENU, goMenu);
}
private function removeFill():void{
if (_fill != null){
if (_currentManager != "goMenu"){
_fill.addEventListener(UIEvent.DELOVER, decorate);
} else {
_fill.addEventListener(UIEvent.DELOVER, initGameMenu);
};
_fill.dispose();
_fill.removeEventListener(UIEvent.DECORATE, goDecorate);
_fill = null;
};
}
private function removeAnimal():void{
if (_animal != null){
if (_currentManager != "goMenu"){
_animal.addEventListener(UIEvent.DELOVER, cloth);
} else {
_animal.addEventListener(UIEvent.DELOVER, initGameMenu);
};
_animal.dispose();
_animal.removeEventListener(UIEvent.ANIMALCHOOSE, animalChoose);
_animal = null;
};
}
private function removeDecorate():void{
if (_decorate != null){
if (_currentManager != "goMenu"){
_decorate.addEventListener(UIEvent.DELOVER, complete);
} else {
_decorate.addEventListener(UIEvent.DELOVER, initGameMenu);
};
_decorate.dispose();
_decorate.removeEventListener(UIEvent.DECORATE, goDecorate);
_decorate.removeEventListener(UIEvent.GOMENU, goMenu);
_decorate = null;
};
}
private function animalChoose(event:Event):void{
_currentManager = "animal";
removeIntroduce();
}
private function startGame(event:Event):void{
_currentManager = "inroduce";
removeMenu();
}
private function animale(event:Event):void{
_animal = AnimalManager(UIConsole.getInstance().showUI(Manager.ANIMALCHOOSE));
_animal.addEventListener(UIEvent.CLOTHCHOOSE, goCloth);
_animal.addEventListener(UIEvent.GOMENU, goMenu);
}
private function complete(event:Event):void{
_complete = CompleteManager(UIConsole.getInstance().showUI(Manager.COMPLETE));
_complete.addEventListener(UIEvent.GOMENU, goMenu);
}
private function removeIntroduce():void{
if (_introduce != null){
if (_currentManager != "goMenu"){
_introduce.addEventListener(UIEvent.DELOVER, animale);
} else {
_introduce.addEventListener(UIEvent.DELOVER, initGameMenu);
};
_introduce.dispose();
_introduce.removeEventListener(UIEvent.ANIMALCHOOSE, animalChoose);
_introduce.removeEventListener(UIEvent.GOMENU, goMenu);
_introduce = null;
};
}
}
}//package core
Section 75
//SoundConsole (core.SoundConsole)
package core {
import tools.*;
import flash.media.*;
import flash.utils.*;
public class SoundConsole {
private var reSoundObj:Object;
private var soundObj:Object;
public static var COTTON_SOUND:String = "cotton_sound";
public static var MENU_PRESS:String = "menuPress";
public static var ARROW_TOUCH:String = "arrow_touch";
public static var BG_MUSIC:String = "bgMusic";
public static var ON_RESULT:String = "onResult";
public static var ARROW_PRESS:String = "arrow_press";
public static var ROLL_ITEM:String = "selectTouch";
private static var self:SoundConsole;
public static var GOOD_OVER:String = "goodover";
public static var reSound:int;
public static var TEXT_SOUND:String = "text_sound";
public static var currentSound:int;
public static var GET_SOUND:String = "get_sound";
public static var CLICK:String = "click";
public static var BAD_OVER:String = "badover";
public static var DECORATION:String = "decoration";
public static var SHEAR_SOUND:String = "shear_sound";
public static var MAIN_SCREEN:String = "mainscreen";
public static var SEW_SOUND:String = "sew_sound";
public static var MENU_ROLL_OVER:String = "menuTouch";
public static var SELECT_ITEM:String = "selectPress";
public static var RESULT:String = "result";
public function SoundConsole(){
super();
}
public function playMusic(linkId:String):int{
var st:SoundTransform;
if (Data.isMute){
return (0);
};
var sound:Sound = Library.getSound(linkId);
var id:int = getTimer();
if (soundObj == null){
soundObj = new Object();
};
var sc:SoundChannel = sound.play(0, 90000);
if (sc){
st = sc.soundTransform;
st.volume = 0.4;
sc.soundTransform = st;
};
soundObj[id] = sc;
currentSound = id;
return (id);
}
public function stopMusic(id:int):void{
if ((((soundObj == null)) || ((soundObj[id] == null)))){
return;
};
soundObj[id].stop();
}
public function replaySound(linkId:String):void{
var st:SoundTransform;
if (!Data.soundPlay){
return;
};
var sound:Sound = Library.getSound(linkId);
var id:int = getTimer();
if (reSoundObj == null){
reSoundObj = new Object();
};
var sc:SoundChannel = sound.play(0, 90000);
if (sc){
st = sc.soundTransform;
st.volume = 0.8;
sc.soundTransform = st;
};
reSoundObj[id] = sc;
reSound = id;
}
public function playSound(linkId:String):void{
if (!Data.soundPlay){
return;
};
var sound:Sound = Library.getSound(linkId);
sound.play();
}
public function stopSound(id:int):void{
if ((((reSoundObj == null)) || ((reSoundObj[id] == null)))){
return;
};
reSoundObj[id].stop();
}
public static function getInstance():SoundConsole{
if (self == null){
self = new (SoundConsole);
};
return (self);
}
}
}//package core
Section 76
//UIConsole (core.UIConsole)
package core {
import flash.display.*;
import tools.*;
import gs.*;
import manager.*;
public class UIConsole {
private var container:MovieClip;
private var classObj:Object;
private static var instance:UIConsole;
public function UIConsole(){
classObj = {Menu:MenuManager, Introduction:IntroductionManager, Animalchoose:AnimalManager, Clothchoose:ClothManager, Cutting:CutManager, Sew:SewManager, Fill:FillManager, Decorate:DecorateManager, Complete:CompleteManager, Tag:TagManager};
super();
}
public function init(container:MovieClip):void{
this.container = container;
}
public function showUI(name:String):Object{
var ui:MovieClip = new MovieClip();
ui = Library.getMovieClip((name + "UI"));
trace(("UI==" + ui));
if (ui != null){
container.addChildAt(ui, 0);
container.alpha = 0;
TweenMax.to(container, 0.5, {alpha:1});
ui.cacheAsBitmap = true;
} else {
return (null);
};
if (classObj[name] == null){
return (ui);
};
var m:Manager = new (classObj[name]);
m.init(ui);
return (m);
}
public static function getInstance():UIConsole{
if (instance == null){
instance = new (UIConsole);
};
return (instance);
}
}
}//package core
Section 77
//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 78
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent($type:String, $info:Object=null, $bubbles:Boolean=false, $cancelable:Boolean=false){
super($type, $bubbles, $cancelable);
this.info = $info;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 79
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
super();
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function killProps($lookup:Object):void{
super.killProps($lookup);
_tweenVisible = !(Boolean(("visible" in $lookup)));
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_tween = $tween;
_visible = Boolean(!(($value == 0)));
_tweenVisible = true;
addTween($target, "alpha", $target.alpha, $value, "alpha");
return (true);
}
override public function set changeFactor($n:Number):void{
updateTweens($n);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 80
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
super();
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = BevelFilter;
initFilter($value, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, (($value.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 81
//BezierPlugin (gs.plugins.BezierPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _target:Object;
protected var _beziers:Object;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function killProps($lookup:Object):void{
var p:String;
for (p in _beziers) {
if ((p in $lookup)){
delete _beziers[p];
};
};
super.killProps($lookup);
}
protected function init($tween:TweenLite, $beziers:Array, $through:Boolean):void{
var i:int;
var p:String;
_target = $tween.target;
if ($tween.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if (($tween.exposedVars.orientToBezier is Array)){
_orientData = $tween.exposedVars.orientToBezier;
_orient = true;
};
};
var props:Object = {};
i = 0;
while (i < $beziers.length) {
for (p in $beziers[i]) {
if (props[p] == undefined){
props[p] = [$tween.target[p]];
};
if (typeof($beziers[i][p]) == "number"){
props[p].push($beziers[i][p]);
} else {
props[p].push(($tween.target[p] + Number($beziers[i][p])));
};
};
i++;
};
for (p in props) {
this.overwriteProps[this.overwriteProps.length] = p;
if ($tween.exposedVars[p] != undefined){
if (typeof($tween.exposedVars[p]) == "number"){
props[p].push($tween.exposedVars[p]);
} else {
props[p].push(($tween.target[p] + Number($tween.exposedVars[p])));
};
delete $tween.exposedVars[p];
i = ($tween.tweens.length - 1);
while (i > -1) {
if ($tween.tweens[i].name == p){
$tween.tweens.splice(i, 1);
};
i--;
};
};
};
_beziers = parseBeziers(props, $through);
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (!($value is Array)){
return (false);
};
init($tween, ($value as Array), false);
return (true);
}
override public function set changeFactor($n:Number):void{
var i:int;
var p:String;
var b:Object;
var t:Number;
var segments:uint;
var val:Number;
var neg:int;
var oldTarget:Object;
var oldRound:Boolean;
var dx:Number;
var dy:Number;
var cotb:Array;
var toAdd:Number;
if ($n == 1){
for (p in _beziers) {
i = (_beziers[p].length - 1);
_target[p] = _beziers[p][i][2];
};
} else {
for (p in _beziers) {
segments = _beziers[p].length;
if ($n < 0){
i = 0;
} else {
if ($n >= 1){
i = (segments - 1);
} else {
i = int((segments * $n));
};
};
t = (($n - (i * (1 / segments))) * segments);
b = _beziers[p][i];
if (this.round){
val = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0])))));
neg = ((val)<0) ? -1 : 1;
_target[p] = ((((val % 1) * neg))>0.5) ? (int(val) + neg) : int(val);
} else {
_target[p] = (b[0] + (t * (((2 * (1 - t)) * (b[1] - b[0])) + (t * (b[2] - b[0])))));
};
};
};
if (_orient){
oldTarget = _target;
oldRound = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = ($n + 0.01);
_target = oldTarget;
this.round = oldRound;
_orient = true;
i = 0;
while (i < _orientData.length) {
cotb = _orientData[i];
toAdd = ((cotb[3]) || (0));
dx = (_future[cotb[0]] - _target[cotb[0]]);
dy = (_future[cotb[1]] - _target[cotb[1]]);
_target[cotb[2]] = ((Math.atan2(dy, dx) * _RAD2DEG) + toAdd);
i++;
};
};
}
public static function parseBeziers($props:Object, $through:Boolean=false):Object{
var i:int;
var a:Array;
var b:Object;
var p:String;
var all:Object = {};
if ($through){
for (p in $props) {
a = $props[p];
b = [];
all[p] = b;
if (a.length > 2){
b[b.length] = [a[0], (a[1] - ((a[2] - a[0]) / 4)), a[1]];
i = 1;
while (i < (a.length - 1)) {
b[b.length] = [a[i], (a[i] + (a[i] - b[(i - 1)][1])), a[(i + 1)]];
i++;
};
} else {
b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]];
};
};
} else {
for (p in $props) {
a = $props[p];
b = [];
all[p] = b;
if (a.length > 3){
b[b.length] = [a[0], a[1], ((a[1] + a[2]) / 2)];
i = 2;
while (i < (a.length - 2)) {
b[b.length] = [b[(i - 2)][2], a[i], ((a[i] + a[(i + 1)]) / 2)];
i++;
};
b[b.length] = [b[(b.length - 1)][2], a[(a.length - 2)], a[(a.length - 1)]];
} else {
if (a.length == 3){
b[b.length] = [a[0], a[1], a[2]];
} else {
if (a.length == 2){
b[b.length] = [a[0], ((a[0] + a[1]) / 2), a[1]];
};
};
};
};
};
return (all);
}
}
}//package gs.plugins
Section 82
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin)
package gs.plugins {
import gs.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BezierThroughPlugin(){
super();
this.propName = "bezierThrough";
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (!($value is Array)){
return (false);
};
init($tween, ($value as Array), true);
return (true);
}
}
}//package gs.plugins
Section 83
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
super();
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = BlurFilter;
initFilter($value, new BlurFilter(0, 0, (($value.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 84
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.1;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
super();
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = ColorMatrixFilter;
var cmf:Object = $value;
initFilter({remove:$value.remove, index:$value.index, addFilter:$value.addFilter}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
var endMatrix:Array = [];
if (((!((cmf.matrix == null))) && ((cmf.matrix is Array)))){
endMatrix = cmf.matrix;
} else {
if (cmf.relative == true){
endMatrix = _matrix.slice();
} else {
endMatrix = _idMatrix.slice();
};
endMatrix = setBrightness(endMatrix, cmf.brightness);
endMatrix = setContrast(endMatrix, cmf.contrast);
endMatrix = setHue(endMatrix, cmf.hue);
endMatrix = setSaturation(endMatrix, cmf.saturation);
endMatrix = setThreshold(endMatrix, cmf.threshold);
if (!isNaN(cmf.colorize)){
endMatrix = colorize(endMatrix, cmf.colorize, cmf.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, endMatrix);
return (true);
}
override public function set changeFactor($n:Number):void{
_matrixTween.changeFactor = $n;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = $n;
}
public static function setSaturation($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
var inv:Number = (1 - $n);
var r:Number = (inv * _lumR);
var g:Number = (inv * _lumG);
var b:Number = (inv * _lumB);
var temp:Array = [(r + $n), g, b, 0, 0, r, (g + $n), b, 0, 0, r, g, (b + $n), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
public static function setHue($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
$n = ($n * (Math.PI / 180));
var c:Number = Math.cos($n);
var s:Number = Math.sin($n);
var temp:Array = [((_lumR + (c * (1 - _lumR))) + (s * -(_lumR))), ((_lumG + (c * -(_lumG))) + (s * -(_lumG))), ((_lumB + (c * -(_lumB))) + (s * (1 - _lumB))), 0, 0, ((_lumR + (c * -(_lumR))) + (s * 0.143)), ((_lumG + (c * (1 - _lumG))) + (s * 0.14)), ((_lumB + (c * -(_lumB))) + (s * -0.283)), 0, 0, ((_lumR + (c * -(_lumR))) + (s * -((1 - _lumR)))), ((_lumG + (c * -(_lumG))) + (s * _lumG)), ((_lumB + (c * (1 - _lumB))) + (s * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(temp, $m));
}
public static function setThreshold($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
var temp:Array = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * $n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * $n), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * $n), 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
public static function applyMatrix($m:Array, $m2:Array):Array{
var y:int;
var x:int;
if (((!(($m is Array))) || (!(($m2 is Array))))){
return ($m2);
};
var temp:Array = [];
var i:int;
var z:int;
y = 0;
while (y < 4) {
x = 0;
while (x < 5) {
if (x == 4){
z = $m[(i + 4)];
} else {
z = 0;
};
temp[(i + x)] = ((((($m[i] * $m2[x]) + ($m[(i + 1)] * $m2[(x + 5)])) + ($m[(i + 2)] * $m2[(x + 10)])) + ($m[(i + 3)] * $m2[(x + 15)])) + z);
x++;
};
i = (i + 5);
y++;
};
return (temp);
}
public static function colorize($m:Array, $color:Number, $amount:Number=1):Array{
if (isNaN($color)){
return ($m);
};
if (isNaN($amount)){
$amount = 1;
};
var r:Number = ((($color >> 16) & 0xFF) / 0xFF);
var g:Number = ((($color >> 8) & 0xFF) / 0xFF);
var b:Number = (($color & 0xFF) / 0xFF);
var inv:Number = (1 - $amount);
var temp:Array = [(inv + (($amount * r) * _lumR)), (($amount * r) * _lumG), (($amount * r) * _lumB), 0, 0, (($amount * g) * _lumR), (inv + (($amount * g) * _lumG)), (($amount * g) * _lumB), 0, 0, (($amount * b) * _lumR), (($amount * b) * _lumG), (inv + (($amount * b) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
public static function setBrightness($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
$n = (($n * 100) - 100);
return (applyMatrix([1, 0, 0, 0, $n, 0, 1, 0, 0, $n, 0, 0, 1, 0, $n, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], $m));
}
public static function setContrast($m:Array, $n:Number):Array{
if (isNaN($n)){
return ($m);
};
$n = ($n + 0.01);
var temp:Array = [$n, 0, 0, 0, (128 * (1 - $n)), 0, $n, 0, 0, (128 * (1 - $n)), 0, 0, $n, 0, (128 * (1 - $n)), 0, 0, 0, 1, 0];
return (applyMatrix(temp, $m));
}
}
}//package gs.plugins
Section 85
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
super();
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = DropShadowFilter;
initFilter($value, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, (($value.quality) || (2)), $value.inner, $value.knockout, $value.hideObject));
return (true);
}
}
}//package gs.plugins
Section 86
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _a:Array;
protected var _info:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
public function init($start:Array, $end:Array):void{
_a = $start;
var i:int = ($end.length - 1);
while (i > -1) {
if (((!(($start[i] == $end[i]))) && (!(($start[i] == null))))){
_info[_info.length] = new ArrayTweenInfo(i, _a[i], ($end[i] - _a[i]));
};
i--;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (((!(($target is Array))) || (!(($value is Array))))){
return (false);
};
init(($target as Array), $value);
return (true);
}
override public function set changeFactor($n:Number):void{
var i:int;
var ti:ArrayTweenInfo;
var val:Number;
var neg:int;
if (this.round){
i = (_info.length - 1);
while (i > -1) {
ti = _info[i];
val = (ti.start + (ti.change * $n));
neg = ((val)<0) ? -1 : 1;
_a[ti.index] = ((((val % 1) * neg))>0.5) ? (int(val) + neg) : int(val);
i--;
};
} else {
i = (_info.length - 1);
while (i > -1) {
ti = _info[i];
_a[ti.index] = (ti.start + (ti.change * $n));
i--;
};
};
}
}
}//package gs.plugins
Section 87
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _remove:Boolean;
protected var _target:Object;
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function FilterPlugin(){
super();
}
public function onCompleteTween():void{
var i:int;
var filters:Array;
if (_remove){
filters = _target.filters;
if (!(filters[_index] is _type)){
i = (filters.length - 1);
while (i > -1) {
if ((filters[i] is _type)){
filters.splice(i, 1);
break;
};
i--;
};
} else {
filters.splice(_index, 1);
};
_target.filters = filters;
};
}
protected function initFilter($props:Object, $default:BitmapFilter):void{
var p:String;
var i:int;
var colorTween:HexColorsPlugin;
var filters:Array = _target.filters;
_index = -1;
if ($props.index != null){
_index = $props.index;
} else {
i = (filters.length - 1);
while (i > -1) {
if ((filters[i] is _type)){
_index = i;
break;
};
i--;
};
};
if ((((((_index == -1)) || ((filters[_index] == null)))) || (($props.addFilter == true)))){
_index = (($props.index)!=null) ? $props.index : filters.length;
filters[_index] = $default;
_target.filters = filters;
};
_filter = filters[_index];
_remove = Boolean(($props.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
var props:Object = (($props.isTV)==true) ? $props.exposedVars : $props;
for (p in props) {
if (((((((((!((p in _filter))) || ((_filter[p] == props[p])))) || ((p == "remove")))) || ((p == "index")))) || ((p == "addFilter")))){
} else {
if ((((((p == "color")) || ((p == "highlightColor")))) || ((p == "shadowColor")))){
colorTween = new HexColorsPlugin();
colorTween.initColor(_filter, p, _filter[p], props[p]);
_tweens[_tweens.length] = new TweenInfo(colorTween, "changeFactor", 0, 1, p, false);
} else {
if ((((((((p == "quality")) || ((p == "inner")))) || ((p == "knockout")))) || ((p == "hideObject")))){
_filter[p] = props[p];
} else {
addTween(_filter, p, _filter[p], props[p], p);
};
};
};
};
}
override public function set changeFactor($n:Number):void{
var i:int;
var ti:TweenInfo;
var filters:Array = _target.filters;
i = (_tweens.length - 1);
while (i > -1) {
ti = _tweens[i];
ti.target[ti.property] = (ti.start + (ti.change * $n));
i--;
};
if (!(filters[_index] is _type)){
_index = (filters.length - 1);
i = (filters.length - 1);
while (i > -1) {
if ((filters[i] is _type)){
_index = i;
break;
};
i--;
};
};
filters[_index] = _filter;
_target.filters = filters;
}
}
}//package gs.plugins
Section 88
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
protected var _target:MovieClip;
public var frame:int;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
super();
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (((!(($target is MovieClip))) || (isNaN($value)))){
return (false);
};
_target = ($target as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, $value, "frame");
return (true);
}
override public function set changeFactor($n:Number):void{
updateTweens($n);
_target.gotoAndStop(this.frame);
}
}
}//package gs.plugins
Section 89
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
super();
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_type = GlowFilter;
initFilter($value, new GlowFilter(0xFFFFFF, 0, 0, 0, (($value.strength) || (1)), (($value.quality) || (2)), $value.inner, $value.knockout));
return (true);
}
}
}//package gs.plugins
Section 90
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
super();
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function killProps($lookup:Object):void{
var i:int = (_colors.length - 1);
while (i > -1) {
if ($lookup[_colors[i][1]] != undefined){
_colors.splice(i, 1);
};
i--;
};
super.killProps($lookup);
}
public function initColor($target:Object, $propName:String, $start:uint, $end:uint):void{
var r:Number;
var g:Number;
var b:Number;
if ($start != $end){
r = ($start >> 16);
g = (($start >> 8) & 0xFF);
b = ($start & 0xFF);
_colors[_colors.length] = [$target, $propName, r, (($end >> 16) - r), g, ((($end >> 8) & 0xFF) - g), b, (($end & 0xFF) - b)];
this.overwriteProps[this.overwriteProps.length] = $propName;
};
}
override public function set changeFactor($n:Number):void{
var i:int;
var a:Array;
i = (_colors.length - 1);
while (i > -1) {
a = _colors[i];
a[0][a[1]] = ((((a[2] + ($n * a[3])) << 16) | ((a[4] + ($n * a[5])) << 8)) | (a[6] + ($n * a[7])));
i--;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
var p:String;
for (p in $value) {
initColor($target, p, uint($target[p]), uint($value[p]));
};
return (true);
}
}
}//package gs.plugins
Section 91
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
super();
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 92
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function RoundPropsPlugin(){
super();
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add($object:Object, $propName:String, $start:Number, $change:Number):void{
addTween($object, $propName, $start, ($start + $change), $propName);
this.overwriteProps[this.overwriteProps.length] = $propName;
}
}
}//package gs.plugins
Section 93
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function ShortRotationPlugin(){
super();
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
var p:String;
if (typeof($value) == "number"){
trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})");
return (false);
};
for (p in $value) {
initRotation($target, p, $target[p], $value[p]);
};
return (true);
}
public function initRotation($target:Object, $propName:String, $start:Number, $end:Number):void{
var dif:Number = (($end - $start) % 360);
if (dif != (dif % 180)){
dif = ((dif)<0) ? (dif + 360) : (dif - 360);
};
addTween($target, $propName, $start, ($start + dif), $propName);
this.overwriteProps[this.overwriteProps.length] = $propName;
}
}
}//package gs.plugins
Section 94
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import flash.geom.*;
import gs.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _target:DisplayObject;
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
super();
this.propName = "tint";
this.overwriteProps = ["tint"];
}
public function init($target:DisplayObject, $end:ColorTransform):void{
var i:int;
var p:String;
_target = $target;
_ct = _target.transform.colorTransform;
i = (_props.length - 1);
while (i > -1) {
p = _props[i];
if (_ct[p] != $end[p]){
_tweens[_tweens.length] = new TweenInfo(_ct, p, _ct[p], ($end[p] - _ct[p]), "tint", false);
};
i--;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (!($target is DisplayObject)){
return (false);
};
var end:ColorTransform = new ColorTransform();
if (((!(($value == null))) && (!(($tween.exposedVars.removeTint == true))))){
end.color = uint($value);
};
_ignoreAlpha = true;
init(($target as DisplayObject), end);
return (true);
}
override public function set changeFactor($n:Number):void{
var ct:ColorTransform;
updateTweens($n);
if (_ignoreAlpha){
ct = _target.transform.colorTransform;
_ct.alphaMultiplier = ct.alphaMultiplier;
_ct.alphaOffset = ct.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
}
}//package gs.plugins
Section 95
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var propName:String;
public var onComplete:Function;
public var round:Boolean;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
super();
}
protected function updateTweens($changeFactor:Number):void{
var i:int;
var ti:TweenInfo;
var val:Number;
var neg:int;
if (this.round){
i = (_tweens.length - 1);
while (i > -1) {
ti = _tweens[i];
val = (ti.start + (ti.change * $changeFactor));
neg = ((val)<0) ? -1 : 1;
ti.target[ti.property] = ((((val % 1) * neg))>0.5) ? (int(val) + neg) : int(val);
i--;
};
} else {
i = (_tweens.length - 1);
while (i > -1) {
ti = _tweens[i];
ti.target[ti.property] = (ti.start + (ti.change * $changeFactor));
i--;
};
};
}
public function set changeFactor($n:Number):void{
updateTweens($n);
_changeFactor = $n;
}
protected function addTween($object:Object, $propName:String, $start:Number, $end, $overwriteProp:String=null):void{
var change:Number;
if ($end != null){
change = ((typeof($end))=="number") ? ($end - $start) : Number($end);
if (change != 0){
_tweens[_tweens.length] = new TweenInfo($object, $propName, $start, change, (($overwriteProp) || ($propName)), false);
};
};
}
public function killProps($lookup:Object):void{
var i:int;
i = (this.overwriteProps.length - 1);
while (i > -1) {
if ((this.overwriteProps[i] in $lookup)){
this.overwriteProps.splice(i, 1);
};
i--;
};
i = (_tweens.length - 1);
while (i > -1) {
if ((_tweens[i].name in $lookup)){
_tweens.splice(i, 1);
};
i--;
};
}
public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
addTween($target, this.propName, $target[this.propName], $value, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate($plugins:Array):Boolean{
var i:int;
var instance:Object;
i = ($plugins.length - 1);
while (i > -1) {
instance = new ($plugins[i]);
TweenLite.plugins[instance.propName] = $plugins[i];
i--;
};
return (true);
}
}
}//package gs.plugins
Section 96
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _target:Object;
protected var _visible:Boolean;
protected var _tween:TweenLite;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
super();
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
_target = $target;
_tween = $tween;
_visible = Boolean($value);
return (true);
}
override public function set changeFactor($n:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
}
}//package gs.plugins
Section 97
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import flash.media.*;
import gs.*;
public class VolumePlugin extends TweenPlugin {
protected var _target:Object;
protected var _st:SoundTransform;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
super();
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function onInitTween($target:Object, $value, $tween:TweenLite):Boolean{
if (((isNaN($value)) || (!($target.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = $target;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, $value, "volume");
return (true);
}
override public function set changeFactor($n:Number):void{
updateTweens($n);
_target.soundTransform = _st;
}
}
}//package gs.plugins
Section 98
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var start:Number;
public var index:uint;
public function ArrayTweenInfo($index:uint, $start:Number, $change:Number){
super();
this.index = $index;
this.start = $start;
this.change = $change;
}
}
}//package gs.utils.tween
Section 99
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo($target:Object, $property:String, $start:Number, $change:Number, $name:String, $isPlugin:Boolean){
super();
this.target = $target;
this.property = $property;
this.start = $start;
this.change = $change;
this.name = $name;
this.isPlugin = $isPlugin;
}
}
}//package gs.utils.tween
Section 100
//OverwriteManager (gs.OverwriteManager)
package gs {
import flash.utils.*;
import gs.utils.tween.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 3.12;
public static var mode:int;
public static var enabled:Boolean;
public function OverwriteManager(){
super();
}
public static function killVars($killVars:Object, $vars:Object, $tweens:Array):void{
var i:int;
var p:String;
var ti:TweenInfo;
i = ($tweens.length - 1);
while (i > -1) {
ti = $tweens[i];
if ((ti.name in $killVars)){
$tweens.splice(i, 1);
} else {
if (((ti.isPlugin) && ((ti.name == "_MULTIPLE_")))){
ti.target.killProps($killVars);
if (ti.target.overwriteProps.length == 0){
$tweens.splice(i, 1);
};
};
};
i--;
};
for (p in $killVars) {
delete $vars[p];
};
}
public static function manageOverwrites($tween:TweenLite, $targetTweens:Array):void{
var i:int;
var tween:TweenLite;
var tweens:Array;
var v:Object;
var j:int;
var ti:TweenInfo;
var overwriteProps:Array;
var vars:Object = $tween.vars;
var m:int = ((vars.overwrite)==undefined) ? mode : int(vars.overwrite);
if ((((m < 2)) || (($targetTweens == null)))){
return;
};
var startTime:Number = $tween.startTime;
var a:Array = [];
var index = -1;
i = ($targetTweens.length - 1);
while (i > -1) {
tween = $targetTweens[i];
if (tween == $tween){
index = i;
} else {
if ((((((i < index)) && ((tween.startTime <= startTime)))) && (((tween.startTime + ((tween.duration * 1000) / tween.combinedTimeScale)) > startTime)))){
a[a.length] = tween;
};
};
i--;
};
if ((((a.length == 0)) || (($tween.tweens.length == 0)))){
return;
};
if (m == AUTO){
tweens = $tween.tweens;
v = {};
i = (tweens.length - 1);
while (i > -1) {
ti = tweens[i];
if (ti.isPlugin){
if (ti.name == "_MULTIPLE_"){
overwriteProps = ti.target.overwriteProps;
j = (overwriteProps.length - 1);
while (j > -1) {
v[overwriteProps[j]] = true;
j--;
};
} else {
v[ti.name] = true;
};
v[ti.target.propName] = true;
} else {
v[ti.name] = true;
};
i--;
};
i = (a.length - 1);
while (i > -1) {
killVars(v, a[i].exposedVars, a[i].tweens);
i--;
};
} else {
i = (a.length - 1);
while (i > -1) {
a[i].enabled = false;
i--;
};
};
}
public static function init($mode:int=2):int{
if (TweenLite.version < 10.09){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = $mode;
enabled = true;
return (mode);
}
}
}//package gs
Section 101
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import gs.plugins.*;
import gs.utils.tween.*;
public class TweenLite {
public var started:Boolean;
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var tweens:Array;
public var vars:Object;
public var ease:Function;
public var exposedVars:Object;
public var initTime:Number;
public var combinedTimeScale:Number;
public static const version:Number = 10.092;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite($target:Object, $duration:Number, $vars:Object){
super();
if ($target == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = $vars;
this.duration = (($duration) || (0.001));
this.delay = (($vars.delay) || (0));
this.combinedTimeScale = (($vars.timeScale) || (1));
this.active = Boolean(((($duration == 0)) && ((this.delay == 0))));
this.target = $target;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
var mode:int = (((($vars.overwrite == undefined)) || (((!(overwriteManager.enabled)) && (($vars.overwrite > 1)))))) ? overwriteManager.mode : int($vars.overwrite);
if (((!(($target in masterList))) || ((mode == 1)))){
masterList[$target] = [this];
} else {
masterList[$target].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function set enabled($b:Boolean):void{
var a:Array;
var found:Boolean;
var i:int;
if ($b){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
a = masterList[this.target];
i = (a.length - 1);
while (i > -1) {
if (a[i] == this){
found = true;
break;
};
i--;
};
if (!found){
a[a.length] = this;
};
};
};
this.gc = ($b) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render($t:uint):void{
var factor:Number;
var ti:TweenInfo;
var i:int;
var time:Number = (($t - this.startTime) * 0.001);
if (time >= this.duration){
time = this.duration;
factor = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
factor = this.ease(time, 0, 1, this.duration);
};
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
ti.target[ti.property] = (ti.start + (factor * ti.change));
i--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (time == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function initTweenVals():void{
var p:String;
var i:int;
var plugin:*;
var ti:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (p in this.exposedVars) {
if ((p in _reservedProps)){
} else {
if ((p in plugins)){
plugin = new (plugins[p]);
if (plugin.onInitTween(this.target, this.exposedVars[p], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, p, this.target[p], ((typeof(this.exposedVars[p]))=="number") ? (this.exposedVars[p] - this.target[p]) : Number(this.exposedVars[p]), p, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(plugin, "changeFactor", 0, 1, ((plugin.overwriteProps.length)==1) ? plugin.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, p, this.target[p], ((typeof(this.exposedVars[p]))=="number") ? (this.exposedVars[p] - this.target[p]) : Number(this.exposedVars[p]), p, false);
};
};
};
if (this.vars.runBackwards == true){
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
ti.start = (ti.start + ti.change);
ti.change = -(ti.change);
i--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy($t:Number, $b:Number, $c:Number, $d:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars($vars:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars($vars, this.exposedVars, this.tweens);
};
}
public function complete($skipRender:Boolean=false):void{
var i:int;
if (!$skipRender){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
i = (this.tweens.length - 1);
while (i > -1) {
if (((this.tweens[i].isPlugin) && (!((this.tweens[i].target.onComplete == null))))){
this.tweens[i].target.onComplete();
};
i--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll($e:Event=null):void{
var a:Array;
var i:int;
var tween:TweenLite;
var time:uint = (currentTime = getTimer());
var ml:Dictionary = masterList;
for each (a in ml) {
i = (a.length - 1);
while (i > -1) {
tween = a[i];
if (tween.active){
tween.render(time);
} else {
if (tween.gc){
a.splice(i, 1);
} else {
if (time >= tween.startTime){
tween.activate();
tween.render(time);
};
};
};
i--;
};
};
}
public static function removeTween($tween:TweenLite, $clear:Boolean=true):void{
if ($tween != null){
if ($clear){
$tween.clear();
};
$tween.enabled = false;
};
}
public static function killTweensOf($target:Object=null, $complete:Boolean=false):void{
var a:Array;
var i:int;
var tween:TweenLite;
if (((!(($target == null))) && (($target in masterList)))){
a = masterList[$target];
i = (a.length - 1);
while (i > -1) {
tween = a[i];
if ((($complete) && (!(tween.gc)))){
tween.complete(false);
};
tween.clear();
i--;
};
delete masterList[$target];
};
}
public static function from($target:Object, $duration:Number, $vars:Object):TweenLite{
$vars.runBackwards = true;
return (new TweenLite($target, $duration, $vars));
}
public static function easeOut($t:Number, $b:Number, $c:Number, $d:Number):Number{
$t = ($t / $d);
return ((((-($c) * $t) * ($t - 2)) + $b));
}
protected static function killGarbage($e:TimerEvent):void{
var tgt:Object;
var ml:Dictionary = masterList;
for (tgt in ml) {
if (ml[tgt].length == 0){
delete ml[tgt];
};
};
}
public static function delayedCall($delay:Number, $onComplete:Function, $onCompleteParams:Array=null):TweenLite{
return (new TweenLite($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, overwrite:0}));
}
public static function to($target:Object, $duration:Number, $vars:Object):TweenLite{
return (new TweenLite($target, $duration, $vars));
}
}
}//package gs
Section 102
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import flash.utils.*;
import gs.plugins.*;
import gs.utils.tween.*;
import gs.events.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
public var pauseTime:Number;
protected var _repeatCount:Number;
protected var _timeScale:Number;
public static const version:Number = 10.12;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
protected static var _globalTimeScale:Number = 1;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]);
public function TweenMax($target:Object, $duration:Number, $vars:Object){
super($target, $duration, $vars);
if (TweenLite.version < 10.092){
trace("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenMax)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if (((($duration == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
if ((((this.delay == 0)) && (!((this.vars.startAt == null))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
}
public function dispatchEvent($e:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent($e));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function set reversed($b:Boolean):void{
if (this.reversed != $b){
reverse();
};
}
public function get progress():Number{
var t:Number = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
var p:Number = (((((t - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (p > 1){
return (1);
};
if (p < 0){
return (0);
};
return (p);
}
override public function set enabled($b:Boolean):void{
if (!$b){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = $b;
if ($b){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination($property:String, $value, $adjustStartValues:Boolean=true):void{
var i:int;
var ti:TweenInfo;
var varsOld:Object;
var exposedVarsOld:Object;
var tweensOld:Array;
var hadPlugins:Boolean;
var addedTweens:Array;
var killVars:Object;
var p:Number = this.progress;
if (this.initted){
if (!$adjustStartValues){
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
if (ti.name == $property){
ti.target[ti.property] = ti.start;
};
i--;
};
};
varsOld = this.vars;
exposedVarsOld = this.exposedVars;
tweensOld = this.tweens;
hadPlugins = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[$property] = $value;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((varsOld.ease is Function)))){
this.ease = varsOld.ease;
};
if ((($adjustStartValues) && (!((p == 0))))){
adjustStartValues();
};
addedTweens = this.tweens;
this.vars = varsOld;
this.exposedVars = exposedVarsOld;
this.tweens = tweensOld;
killVars = {};
killVars[$property] = true;
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
if (ti.name == $property){
this.tweens.splice(i, 1);
} else {
if (((ti.isPlugin) && ((ti.name == "_MULTIPLE_")))){
ti.target.killProps(killVars);
if (ti.target.overwriteProps.length == 0){
this.tweens.splice(i, 1);
};
};
};
i--;
};
this.tweens = this.tweens.concat(addedTweens);
_hasPlugins = Boolean(((hadPlugins) || (_hasPlugins)));
};
this.vars[$property] = (this.exposedVars[$property] = $value);
}
override public function initTweenVals():void{
var i:int;
var j:int;
var prop:String;
var multiProps:String;
var rp:Array;
var plugin:Object;
var ti:TweenInfo;
if (((!((this.vars.startAt == null))) && (!((this.delay == 0))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
super.initTweenVals();
if ((((this.exposedVars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){
rp = this.exposedVars.roundProps;
i = (rp.length - 1);
while (i > -1) {
prop = rp[i];
j = (this.tweens.length - 1);
while (j > -1) {
ti = this.tweens[j];
if (ti.name == prop){
if (ti.isPlugin){
ti.target.round = true;
} else {
if (plugin == null){
plugin = new TweenLite.plugins.roundProps();
plugin.add(ti.target, prop, ti.start, ti.change);
_hasPlugins = true;
this.tweens[j] = new TweenInfo(plugin, "changeFactor", 0, 1, prop, true);
} else {
plugin.add(ti.target, prop, ti.start, ti.change);
this.tweens.splice(j, 1);
};
};
} else {
if (((((ti.isPlugin) && ((ti.name == "_MULTIPLE_")))) && (!(ti.target.round)))){
multiProps = ((" " + ti.target.overwriteProps.join(" ")) + " ");
if (multiProps.indexOf(((" " + prop) + " ")) != -1){
ti.target.round = true;
};
};
};
j--;
};
i--;
};
};
}
public function restart($includeDelay:Boolean=false):void{
if ($includeDelay){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
_pausedTweens[this] = null;
delete _pausedTweens[this];
this.enabled = true;
}
public function removeEventListener($type:String, $listener:Function, $useCapture:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener($type, $listener, $useCapture);
};
}
public function addEventListener($type:String, $listener:Function, $useCapture:Boolean=false, $priority:int=0, $useWeakReference:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if (((($type == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener($type, $listener, $useCapture, $priority, $useWeakReference);
}
protected function adjustStartValues():void{
var factor:Number;
var inv:Number;
var endValue:Number;
var ti:TweenInfo;
var i:int;
var p:Number = this.progress;
if (p != 0){
factor = this.ease(p, 0, 1, 1);
inv = (1 / (1 - factor));
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
endValue = (ti.start + ti.change);
if (ti.isPlugin){
ti.change = ((endValue - factor) * inv);
} else {
ti.change = ((endValue - ti.target[ti.property]) * inv);
};
ti.start = (endValue - ti.change);
i--;
};
};
}
override public function render($t:uint):void{
var factor:Number;
var ti:TweenInfo;
var i:int;
var time:Number = ((($t - this.startTime) * 0.001) * this.combinedTimeScale);
if (time >= this.duration){
time = this.duration;
factor = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
factor = this.ease(time, 0, 1, this.duration);
};
i = (this.tweens.length - 1);
while (i > -1) {
ti = this.tweens[i];
ti.target[ti.property] = (ti.start + (factor * ti.change));
i--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (time == this.duration){
complete(true);
};
}
protected function initDispatcher():void{
var v:Object;
var p:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
if (this.vars.isTV == true){
this.vars = this.vars.clone();
} else {
v = {};
for (p in this.vars) {
v[p] = this.vars[p];
};
this.vars = v;
};
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
public function willTrigger($type:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger($type));
}
public function get repeatCount():Number{
return (_repeatCount);
}
public function reverse($adjustDuration:Boolean=true, $forcePlay:Boolean=true):void{
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
var p:Number = this.progress;
if ((($adjustDuration) && ((p > 0)))){
this.startTime = (currentTime - ((((1 - p) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if ($forcePlay != false){
if (p < 1){
resume();
} else {
restart();
};
};
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
public function set paused($b:Boolean):void{
if ($b){
pause();
} else {
resume();
};
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
public function get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function set repeatCount($n:Number):void{
_repeatCount = $n;
}
public function reverseEase($t:Number, $b:Number, $c:Number, $d:Number):Number{
return (this.vars.ease(($d - $t), $b, $c, $d));
}
public function killProperties($names:Array):void{
var i:int;
var v:Object = {};
i = ($names.length - 1);
while (i > -1) {
v[$names[i]] = true;
i--;
};
killVars(v);
}
public function set progress($n:Number):void{
this.startTime = (currentTime - ((this.duration * $n) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function hasEventListener($type:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener($type));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
override public function complete($skipRender:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = ($skipRender) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete($skipRender);
}
public function set timeScale($n:Number):void{
if ($n < 1E-5){
$n = (_timeScale = 1E-5);
} else {
_timeScale = $n;
$n = ($n * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / $n))) - (this.delay * (1000 / $n)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / $n)));
};
this.combinedTimeScale = $n;
}
public function invalidate($adjustStartValues:Boolean=true):void{
var p:Number;
if (this.initted){
p = this.progress;
if (((!($adjustStartValues)) && (!((p == 0))))){
this.progress = 0;
};
this.tweens = [];
_hasPlugins = false;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (p != 0){
if ($adjustStartValues){
adjustStartValues();
} else {
this.progress = p;
};
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function set globalTimeScale($n:Number):void{
setGlobalTimeScale($n);
}
public static function pauseAll($tweens:Boolean=true, $delayedCalls:Boolean=false):void{
changePause(true, $tweens, $delayedCalls);
}
public static function killAllDelayedCalls($complete:Boolean=false):void{
killAll($complete, false, true);
}
public static function setGlobalTimeScale($scale:Number):void{
var i:int;
var a:Array;
if ($scale < 1E-5){
$scale = 1E-5;
};
var ml:Dictionary = masterList;
_globalTimeScale = $scale;
for each (a in ml) {
i = (a.length - 1);
while (i > -1) {
if ((a[i] is TweenMax)){
a[i].timeScale = (a[i].timeScale * 1);
};
i--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf($target:Object):Array{
var tween:TweenLite;
var i:int;
var a:Array = masterList[$target];
var toReturn:Array = [];
if (a != null){
i = (a.length - 1);
while (i > -1) {
if (!a[i].gc){
toReturn[toReturn.length] = a[i];
};
i--;
};
};
for each (tween in _pausedTweens) {
if (tween.target == $target){
toReturn[toReturn.length] = tween;
};
};
return (toReturn);
}
public static function delayedCall($delay:Number, $onComplete:Function, $onCompleteParams:Array=null, $persist:Boolean=false):TweenMax{
return (new TweenMax($onComplete, 0, {delay:$delay, onComplete:$onComplete, onCompleteParams:$onCompleteParams, persist:$persist, overwrite:0}));
}
public static function isTweening($target:Object):Boolean{
var a:Array = getTweensOf($target);
var i:int = (a.length - 1);
while (i > -1) {
if (((((a[i].active) || ((a[i].startTime == currentTime)))) && (!(a[i].gc)))){
return (true);
};
i--;
};
return (false);
}
public static function changePause($pause:Boolean, $tweens:Boolean=true, $delayedCalls:Boolean=false):void{
var isDC:Boolean;
var a:Array = getAllTweens();
var i:int = (a.length - 1);
while (i > -1) {
isDC = (a[i].target == a[i].vars.onComplete);
if ((((a[i] is TweenMax)) && ((((isDC == $delayedCalls)) || (!((isDC == $tweens))))))){
a[i].paused = $pause;
};
i--;
};
}
public static function killAllTweens($complete:Boolean=false):void{
killAll($complete, true, false);
}
public static function from($target:Object, $duration:Number, $vars:Object):TweenMax{
$vars.runBackwards = true;
return (new TweenMax($target, $duration, $vars));
}
public static function killAll($complete:Boolean=false, $tweens:Boolean=true, $delayedCalls:Boolean=true):void{
var isDC:Boolean;
var i:int;
var a:Array = getAllTweens();
i = (a.length - 1);
while (i > -1) {
isDC = (a[i].target == a[i].vars.onComplete);
if ((((isDC == $delayedCalls)) || (!((isDC == $tweens))))){
if ($complete){
a[i].complete(false);
a[i].clear();
} else {
TweenLite.removeTween(a[i], true);
};
};
i--;
};
}
public static function getAllTweens():Array{
var a:Array;
var i:int;
var tween:TweenLite;
var ml:Dictionary = masterList;
var toReturn:Array = [];
for each (a in ml) {
i = (a.length - 1);
while (i > -1) {
if (!a[i].gc){
toReturn[toReturn.length] = a[i];
};
i--;
};
};
for each (tween in _pausedTweens) {
toReturn[toReturn.length] = tween;
};
return (toReturn);
}
public static function resumeAll($tweens:Boolean=true, $delayedCalls:Boolean=false):void{
changePause(false, $tweens, $delayedCalls);
}
public static function to($target:Object, $duration:Number, $vars:Object):TweenMax{
return (new TweenMax($target, $duration, $vars));
}
}
}//package gs
Section 103
//AnimalManager (manager.AnimalManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import tools.*;
import core.*;
import zlong.spilSystemTool.*;
import flash.net.*;
import zlong.site.*;
public class AnimalManager extends Manager {
private var ms:MovieClip;
private var back:MovieClip;
private var text:MovieClip;
private var moreGames:MovieClip;
private var guide:MovieClip;
public function AnimalManager(){
super();
}
private function initStatus():void{
if (!SiteInfo.instance.allowed){
moreGames["text"].gotoAndStop(2);
} else {
moreGames["text"].gotoAndStop(1);
};
SoundConsole.getInstance().playSound(SoundConsole.TEXT_SOUND);
guide.buttonMode = true;
guide.gotoAndStop("normal");
SoundConsole.getInstance().stopMusic(SoundConsole.currentSound);
SoundConsole.getInstance().playMusic(SoundConsole.DECORATION);
}
private function makeSure(event:Event):void{
var ok_btn:MovieClip;
var no_btn:MovieClip;
if (ms.currentFrame == 34){
ok_btn = ms["ok_btn"];
no_btn = ms["no_btn"];
ok_btn.mouseChildren = false;
no_btn.mouseChildren = false;
ok_btn.addEventListener(MouseEvent.CLICK, Menu);
no_btn.addEventListener(MouseEvent.CLICK, stay);
};
if (ms.currentFrame == ms.totalFrames){
ms.removeEventListener(Event.ENTER_FRAME, makeSure);
ms.stop();
};
}
private function playGuide(event:MouseEvent):void{
text.gotoAndStop("normal");
text.alpha = 1;
text.mouseChildren = true;
text.mouseEnabled = true;
}
private function initEvent():void{
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, activate);
BroadCast.instance.addEventListener(TeddyEvent.ONCHOOSE, goNext);
guide.addEventListener(MouseEvent.CLICK, playGuide);
back.addEventListener(MouseEvent.CLICK, goMenu);
}
private function activate(event:TeddyEvent):void{
text.alpha = 0;
text.mouseChildren = false;
text.mouseEnabled = false;
}
private function delEvent():void{
BroadCast.instance.removeEventListener(TeddyEvent.ACTIVATE, activate);
BroadCast.instance.removeEventListener(TeddyEvent.ONCHOOSE, goNext);
guide.removeEventListener(MouseEvent.CLICK, playGuide);
back.removeEventListener(MouseEvent.CLICK, goMenu);
}
override public function init(container:MovieClip):void{
super.init(container);
initCon();
initStatus();
initEvent();
}
private function initCon():void{
text = container["text_mc"];
guide = container["guide"];
back = container["back"];
moreGames = container["more_btn"];
}
private function goMenu(event:MouseEvent):void{
ms = Library.getMovieClip("MakeSure");
container.addChild(ms);
ms.x = 233;
ms.y = 122;
ms.addEventListener(Event.ENTER_FRAME, makeSure);
}
private function Menu(event:MouseEvent):void{
delEvent();
this.dispatchEvent(new Event(UIEvent.GOMENU));
}
private function stay(event:MouseEvent):void{
container.removeChild(ms);
}
private function goNext(event:Event):void{
var cookie:SharedObject = SharedObject.getLocal(Data.CookieName);
var num:int;
if (cookie.data[Data.animal] == null){
cookie.data[Data.animal] = true;
};
var i:int;
while (i < 5) {
if (cookie.data[Data.animalList[i]] != null){
num++;
};
if (num >= 3){
Award_HighScore.instance.submitAchievement("award2");
cookie.data["award2"] = true;
cookie.flush();
cookie.close();
if (((((((((!((cookie.data["award1"] == null))) && (!((cookie.data["award2"] == null))))) && (!((cookie.data["award3"] == null))))) && (!((cookie.data["award4"] == null))))) && (!((cookie.data["award5"] == null))))){
GoogleEvent.instance.gaTrackEvent("all awards unlocked", true);
};
break;
};
i++;
};
if (Data.animal != ""){
delEvent();
this.dispatchEvent(new Event(UIEvent.CLOTHCHOOSE));
};
}
}
}//package manager
Section 104
//ClothManager (manager.ClothManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import tools.*;
import core.*;
import zlong.spilSystemTool.*;
import flash.net.*;
import zlong.breathxue_zelda.PicList.*;
import zlong.site.*;
public class ClothManager extends Manager {
private var _back:MovieClip;
private var _isPreBtDown:Boolean;
private var _isNextBtDown:Boolean;
private var _isErectStyle:Boolean;// = false
private var _picArray:Array;
private var leftarrow:MovieClip;
private var ms:MovieClip;
private var _piclist:PicList;
private var moreGames:MovieClip;
private var rightarrow:MovieClip;
private var text:MovieClip;
private var guide:MovieClip;
private var __picListMC:Sprite;
public function ClothManager(){
super();
}
private function leftUp(event:MouseEvent):void{
leftarrow.gotoAndStop(2);
}
private function picOver(event:ItemEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.ROLL_ITEM);
}
private function leftOut(event:MouseEvent):void{
leftarrow.gotoAndStop(1);
}
private function goNext(event:Event):void{
var cookie:SharedObject;
if ((((((((((Data.cloth == "cloth9")) || ((Data.cloth == "cloth4")))) || ((Data.cloth == "cloth6")))) || ((Data.cloth == "cloth7")))) || ((Data.cloth == "cloth10")))){
Award_HighScore.instance.submitAchievement("award3");
cookie = SharedObject.getLocal(Data.CookieName);
cookie.data["award3"] = true;
cookie.flush();
cookie.close();
if (((((((((!((cookie.data["award1"] == null))) && (!((cookie.data["award2"] == null))))) && (!((cookie.data["award3"] == null))))) && (!((cookie.data["award4"] == null))))) && (!((cookie.data["award5"] == null))))){
GoogleEvent.instance.gaTrackEvent("all awards unlocked", true);
};
};
delEvent();
this.dispatchEvent(new Event(UIEvent.CUTTING));
}
private function run(event:Event):void{
_piclist.run();
}
private function delEvent():void{
BroadCast.instance.removeEventListener(TeddyEvent.ACTIVATE, activate);
leftarrow.removeEventListener(MouseEvent.MOUSE_DOWN, back);
leftarrow.removeEventListener(MouseEvent.MOUSE_UP, leftUp);
leftarrow.removeEventListener(MouseEvent.MOUSE_OVER, leftOver);
leftarrow.removeEventListener(MouseEvent.MOUSE_OUT, leftOut);
rightarrow.removeEventListener(MouseEvent.MOUSE_DOWN, pre);
rightarrow.removeEventListener(MouseEvent.MOUSE_UP, rightUp);
rightarrow.removeEventListener(MouseEvent.MOUSE_OVER, rightOver);
rightarrow.removeEventListener(MouseEvent.MOUSE_OUT, rightOut);
container.removeEventListener(Event.ENTER_FRAME, run);
_piclist.removeEventListener(ItemEvent.CLICK_ITEM, picClick);
_piclist.removeEventListener(ItemEvent.ITEM_ROLL_OVER, picOver);
guide.removeEventListener(MouseEvent.CLICK, disGuide);
_back.removeEventListener(MouseEvent.CLICK, goMenu);
}
private function Menu(event:MouseEvent):void{
delEvent();
this.dispatchEvent(new Event(UIEvent.GOMENU));
}
override public function init(container:MovieClip):void{
super.init(container);
initCon();
initStatus();
initEvent();
}
private function initCon():void{
text = container["text_mc"];
leftarrow = container["left_arrow"];
rightarrow = container["right_arrow"];
guide = container["guide"];
_back = container["back"];
moreGames = container["more_btn"];
}
private function disGuide(event:MouseEvent):void{
text.alpha = 1;
text.mouseChildren = true;
text.mouseEnabled = true;
}
private function rightUp(event:MouseEvent):void{
rightarrow.gotoAndStop(2);
}
private function rightOver(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.ARROW_TOUCH);
rightarrow.gotoAndStop(2);
}
private function picClick(event:ItemEvent):void{
event.item.scaleX = 1.4;
event.item.scaleY = 1.4;
SoundConsole.getInstance().playSound(SoundConsole.SELECT_ITEM);
Data.cloth = event.item.name;
goNext(null);
}
private function back(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.ARROW_PRESS);
leftarrow.gotoAndStop(3);
_piclist.prevItem();
}
private function stay(event:MouseEvent):void{
container.removeChild(ms);
}
private function initEvent():void{
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, activate);
leftarrow.addEventListener(MouseEvent.MOUSE_DOWN, back);
leftarrow.addEventListener(MouseEvent.MOUSE_UP, leftUp);
leftarrow.addEventListener(MouseEvent.MOUSE_OVER, leftOver);
leftarrow.addEventListener(MouseEvent.MOUSE_OUT, leftOut);
rightarrow.addEventListener(MouseEvent.MOUSE_DOWN, pre);
rightarrow.addEventListener(MouseEvent.MOUSE_UP, rightUp);
rightarrow.addEventListener(MouseEvent.MOUSE_OVER, rightOver);
rightarrow.addEventListener(MouseEvent.MOUSE_OUT, rightOut);
container.addEventListener(Event.ENTER_FRAME, run);
_piclist.addEventListener(ItemEvent.CLICK_ITEM, picClick);
_piclist.addEventListener(ItemEvent.ITEM_ROLL_OVER, picOver);
guide.addEventListener(MouseEvent.CLICK, disGuide);
_back.addEventListener(MouseEvent.CLICK, goMenu);
}
private function goMenu(event:MouseEvent):void{
ms = Library.getMovieClip("MakeSure");
container.addChild(ms);
ms.x = 233;
ms.y = 122;
ms.addEventListener(Event.ENTER_FRAME, makeSure);
}
private function pre(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.ARROW_PRESS);
rightarrow.gotoAndStop(3);
_piclist.nextItem();
}
private function activate(event:TeddyEvent):void{
text.alpha = 0;
text.mouseChildren = false;
text.mouseEnabled = false;
}
private function makeSure(event:Event):void{
var ok_btn:MovieClip;
var no_btn:MovieClip;
if (ms.currentFrame == 34){
ok_btn = ms["ok_btn"];
no_btn = ms["no_btn"];
ok_btn.mouseChildren = false;
no_btn.mouseChildren = false;
ok_btn.addEventListener(MouseEvent.CLICK, Menu);
no_btn.addEventListener(MouseEvent.CLICK, stay);
};
if (ms.currentFrame == ms.totalFrames){
ms.removeEventListener(Event.ENTER_FRAME, makeSure);
ms.stop();
};
}
private function initStatus():void{
if (!SiteInfo.instance.allowed){
moreGames["text"].gotoAndStop(2);
} else {
moreGames["text"].gotoAndStop(1);
};
SoundConsole.getInstance().playSound(SoundConsole.TEXT_SOUND);
guide.buttonMode = true;
guide.gotoAndStop("normal");
leftarrow.gotoAndStop(1);
rightarrow.gotoAndStop(1);
_isPreBtDown = false;
_isNextBtDown = false;
__picListMC = new Sprite();
container.addChildAt(__picListMC, 2);
_picArray = new Array();
_picArray.push("cloth1", "cloth2", "cloth3", "cloth4", "cloth5", "cloth6", "cloth7", "cloth8", "cloth9", "cloth10");
PicList.__debug__ = false;
_piclist = new PicList(__picListMC, _picArray, _isErectStyle);
if (_isErectStyle){
_piclist.width = 100;
_piclist.height = 500;
_piclist.maskWidth = 120;
_piclist.maskHeight = 420;
_piclist.itemWidth = 45;
_piclist.itemHeight = 76.5;
_piclist.itemSpaceBetweenY = 5;
} else {
_piclist.width = 500;
_piclist.height = 114;
_piclist.maskWidth = 740;
_piclist.maskHeight = 350;
_piclist.itemWidth = 95;
_piclist.itemHeight = 112;
_piclist.itemAlign = 0;
_piclist.itemScaleValues = 1.3;
_piclist.itemAutoSize = true;
_piclist.itemSpaceBetweenX = 50;
};
_piclist.x = 350;
_piclist.y = 200;
_piclist.speed = 50;
_piclist.addSpeed = 2;
_piclist.isExtEffect = false;
_piclist.reset();
}
private function leftOver(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.ARROW_TOUCH);
leftarrow.gotoAndStop(2);
}
private function rightOut(event:MouseEvent):void{
rightarrow.gotoAndStop(1);
}
}
}//package manager
Section 105
//CompleteManager (manager.CompleteManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import tools.*;
import core.*;
import flash.geom.*;
import zlong.breathxue.utils.*;
import zlong.site.*;
public class CompleteManager extends Manager {
private var animal:MovieClip;
private var upManager:UpLoadManager;
private var tag:TagManager;
private var upLoad:MovieClip;
private var ms:MovieClip;
private var homeInfo:MovieClip;
private var text:MovieClip;
private var animalBitmap:Bitmap;
private var backGround:MovieClip;
private var paint:MovieClip;
private var home:MovieClip;
private var currentTag:MovieClip;
private var tagPosition:Point;
private var tagInfo:MovieClip;
private var upInfo:MovieClip;
private var moreGames:MovieClip;
private var guide:MovieClip;
public function CompleteManager(){
super();
}
private function upload(event:MouseEvent):void{
upLoad.removeEventListener(MouseEvent.CLICK, upload);
var rt:Rectangle = new Rectangle();
rt.x = animal["cloth"].x;
rt.y = animal["cloth"].y;
rt.width = (animal["cloth"].width + 80);
rt.height = (animal["cloth"].height + 40);
var bmd:BitmapData = Tools.cutBmp(animal, (animal.width + 80), (animal.height + 40), (rt.x - 40), (rt.y - 40), rt.width, rt.height);
var bmdBig:BitmapData = Tools.cutBmp(backGround, 610, 415, 90, 65, 610, 415);
var bmdSamll:BitmapData = Tools.cutBmp(backGround, 488, 488, 212, 22, 488, 488);
var animalBg:Bitmap = new Bitmap(bmdBig);
var animalSamll:Bitmap = new Bitmap(bmdSamll);
animalBitmap.bitmapData = bmd;
upManager = new UpLoadManager(container, animalBitmap, animalBg, animalSamll);
}
private function Menu(event:MouseEvent):void{
delEvent();
this.dispatchEvent(new Event(UIEvent.GOMENU));
}
private function designTag(event:MouseEvent):void{
tag = new TagManager(container);
}
private function tagOver(event:MouseEvent):void{
tagInfo = Library.getMovieClip("tagInfo");
tagInfo.mouseEnabled = false;
container.addChild(tagInfo);
tagInfo.x = paint.x;
tagInfo.y = (paint.y + (paint.height / 2));
tagInfo.scaleX = 0.6;
tagInfo.scaleY = 0.6;
}
private function upOver(event:MouseEvent):void{
upInfo = Library.getMovieClip("upInfo");
upInfo.mouseEnabled = false;
container.addChild(upInfo);
upInfo.x = upLoad.x;
upInfo.y = (upLoad.y + (paint.height / 2));
upInfo.scaleX = 0.6;
upInfo.scaleY = 0.6;
}
override public function init(container:MovieClip):void{
super.init(container);
animalBitmap = new Bitmap();
tagPosition = new Point();
initCon();
initStatus();
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, activate);
}
private function disGuide(event:MouseEvent):void{
text.alpha = 1;
text.mouseChildren = true;
text.mouseEnabled = true;
}
private function initStatus():void{
if (!SiteInfo.instance.allowed){
moreGames["text"].gotoAndStop(2);
} else {
moreGames["text"].gotoAndStop(1);
};
animal["eye"].gotoAndStop(Data.eye);
animal["nose"].gotoAndStop(Data.nose);
animal["mouth"].gotoAndStop(Data.mouth);
animal["cloth"].gotoAndStop(Data.cloth);
tagPosition.x = animal["tag_position"].x;
tagPosition.y = animal["tag_position"].y;
SoundConsole.getInstance().playSound(SoundConsole.TEXT_SOUND);
guide.gotoAndStop("normal");
guide.buttonMode = true;
text.gotoAndStop("normal");
SoundConsole.getInstance().stopMusic(SoundConsole.currentSound);
SoundConsole.getInstance().playMusic(SoundConsole.RESULT);
}
private function makeSure(event:Event):void{
var ok_btn:MovieClip;
var no_btn:MovieClip;
if (ms.currentFrame == 34){
ok_btn = ms["ok_btn"];
no_btn = ms["no_btn"];
ok_btn.mouseChildren = false;
no_btn.mouseChildren = false;
ok_btn.addEventListener(MouseEvent.CLICK, Menu);
no_btn.addEventListener(MouseEvent.CLICK, stay);
};
if (ms.currentFrame == ms.totalFrames){
ms.removeEventListener(Event.ENTER_FRAME, makeSure);
ms.stop();
};
}
private function upOut(event:MouseEvent):void{
container.removeChild(upInfo);
}
private function changeTag(event:Event):void{
if (currentTag != null){
animal.removeChild(currentTag);
} else {
currentTag = new MovieClip();
};
currentTag = Data.tag;
currentTag.scaleX = 0.6;
currentTag.scaleY = 0.6;
currentTag.rotation = -45;
animal.addChild(currentTag);
currentTag.x = tagPosition.x;
currentTag.y = tagPosition.y;
}
private function delEvent():void{
paint.removeEventListener(MouseEvent.CLICK, designTag);
container.removeEventListener(UIEvent.DESIGNOVER, changeTag);
guide.removeEventListener(MouseEvent.CLICK, disGuide);
home.removeEventListener(MouseEvent.CLICK, goMenu);
BroadCast.instance.removeEventListener(TeddyEvent.ACTIVATE, activate);
}
private function homeOver(event:MouseEvent):void{
homeInfo = Library.getMovieClip("homeInfo");
homeInfo.mouseEnabled = false;
container.addChild(homeInfo);
homeInfo.x = home.x;
homeInfo.y = (home.y + (home.height / 2));
homeInfo.scaleX = 0.6;
homeInfo.scaleY = 0.6;
}
private function tagOut(event:MouseEvent):void{
container.removeChild(tagInfo);
}
private function stay(event:MouseEvent):void{
container.removeChild(ms);
}
private function buttonTrue(event:Event):void{
upLoad.addEventListener(MouseEvent.CLICK, upload);
}
private function goMenu(event:MouseEvent):void{
ms = Library.getMovieClip("MakeSure");
container.addChild(ms);
ms.x = 233;
ms.y = 122;
ms.addEventListener(Event.ENTER_FRAME, makeSure);
}
private function initCon():void{
animal = Library.getMovieClip((Data.animal + "_complete"));
text = container["text_mc"];
guide = container["guide"];
paint = container["paint"];
home = container["home_btn"];
upLoad = container["upload_btn"];
moreGames = container["more_btn"];
backGround = container["back_ground"];
backGround.addChild(animal);
}
private function homeOut(event:MouseEvent):void{
container.removeChild(homeInfo);
}
private function initEvent():void{
container.addEventListener("back", buttonTrue);
paint.addEventListener(MouseEvent.MOUSE_OVER, tagOver);
paint.addEventListener(MouseEvent.MOUSE_OUT, tagOut);
paint.addEventListener(MouseEvent.CLICK, designTag);
container.addEventListener(UIEvent.DESIGNOVER, changeTag);
guide.addEventListener(MouseEvent.CLICK, disGuide);
home.addEventListener(MouseEvent.MOUSE_OVER, homeOver);
home.addEventListener(MouseEvent.MOUSE_OUT, homeOut);
home.addEventListener(MouseEvent.CLICK, goMenu);
upLoad.addEventListener(MouseEvent.MOUSE_OVER, upOver);
upLoad.addEventListener(MouseEvent.MOUSE_OUT, upOut);
upLoad.addEventListener(MouseEvent.CLICK, upload);
}
private function activate(event:TeddyEvent):void{
text.alpha = 0;
text.mouseChildren = false;
text.mouseEnabled = false;
initEvent();
}
}
}//package manager
Section 106
//CutManager (manager.CutManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import tools.*;
import core.*;
import zlong.spilSystemTool.*;
import flash.net.*;
import flash.geom.*;
import zlong.site.*;
import flash.ui.*;
public class CutManager extends Manager {
private var guide:MovieClip;
private var level:MovieClip;
private var lace:MovieClip;
private var cloth:MovieClip;
private var clothbmd:BitmapData;
private var first:Point;
private var text:MovieClip;
private var ms:MovieClip;
private var angle:Point;
private var played:Boolean;// = false
private var shear:MovieClip;
private var rect:Rectangle;
private var clothbm:Bitmap;
private var positionList:Array;
private var moreGames:MovieClip;
private var back:MovieClip;
private var next:MovieClip;
private var animal:MovieClip;
public function CutManager(){
super();
}
private function bad(event:Event):void{
event.target.removeEventListener(MouseEvent.CLICK, bad);
event.target.removeEventListener(MouseEvent.MOUSE_DOWN, badDown);
event.target.removeEventListener(MouseEvent.MOUSE_OVER, badOver);
event.target.removeEventListener(MouseEvent.MOUSE_OUT, badOut);
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
container.removeChild(event.target.parent);
initEvent();
}
private function Menu(event:MouseEvent):void{
delEvent();
this.dispatchEvent(new Event(UIEvent.GOMENU));
}
private function badOut(event:MouseEvent):void{
event.target.gotoAndStop(1);
}
private function goodText():void{
var GoodMc:MovieClip = Library.getMovieClip("GoodText");
container.addChild(GoodMc);
SoundConsole.getInstance().playSound(SoundConsole.GOOD_OVER);
GoodMc["good_btn"].gotoAndStop(1);
GoodMc["good_btn"].buttonMode = true;
GoodMc["good_btn"].addEventListener(MouseEvent.CLICK, good);
GoodMc["good_btn"].addEventListener(MouseEvent.MOUSE_DOWN, goodDown);
GoodMc["good_btn"].addEventListener(MouseEvent.MOUSE_OVER, goodOver);
GoodMc["good_btn"].addEventListener(MouseEvent.MOUSE_OUT, goodOut);
}
private function disGuide(event:MouseEvent):void{
text.alpha = 1;
text.mouseChildren = true;
text.mouseEnabled = true;
}
override public function init(container:MovieClip):void{
super.init(container);
clothbm = new Bitmap();
first = new Point();
angle = new Point();
positionList = new Array();
level = new MovieClip();
initCon();
initStatus();
if (Data.cutFirst){
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, activate);
Data.cutFirst = false;
SoundConsole.getInstance().playSound(SoundConsole.TEXT_SOUND);
} else {
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, activate);
activate(null);
};
}
private function fail(event:Event):void{
Data.cutOnce = false;
removeShear();
container.removeEventListener(MouseEvent.MOUSE_MOVE, drawLine);
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.ENDCUT));
}
private function initStatus():void{
if (!SiteInfo.instance.allowed){
moreGames["text"].gotoAndStop(2);
} else {
moreGames["text"].gotoAndStop(1);
};
container.addChildAt(animal, 2);
animal.x = 38;
lace.stop();
guide.buttonMode = true;
guide.gotoAndStop("normal");
cloth.gotoAndStop(Data.cloth);
level = animal["level"];
clothbmd = new BitmapData(cloth.width, cloth.height, true, 0);
clothbmd.draw(cloth);
clothbm.bitmapData = clothbmd;
container.addChildAt(clothbm, 2);
clothbm.x = 38;
savePosition();
}
private function makeSure(event:Event):void{
var ok_btn:MovieClip;
var no_btn:MovieClip;
if (ms.currentFrame == 34){
ok_btn = ms["ok_btn"];
no_btn = ms["no_btn"];
ok_btn.mouseChildren = false;
no_btn.mouseChildren = false;
ok_btn.addEventListener(MouseEvent.CLICK, Menu);
no_btn.addEventListener(MouseEvent.CLICK, stay);
};
if (ms.currentFrame == ms.totalFrames){
ms.removeEventListener(Event.ENTER_FRAME, makeSure);
ms.stop();
};
}
private function drawPoint(point:Point):void{
rect = new Rectangle((point.x - 5), (point.y - 5), 10, 10);
var clf:ColorTransform = new ColorTransform();
clf.alphaMultiplier = 0;
clothbmd.colorTransform(rect, clf);
}
private function goodOver(event:MouseEvent):void{
event.target.gotoAndStop(2);
}
override public function dispose():void{
clothbmd.dispose();
clothbmd = null;
delEvent();
super.dispose();
}
private function laceStop(event:Event):void{
if (lace.currentFrame == lace.totalFrames){
lace.removeEventListener(Event.ENTER_FRAME, laceStop);
lace.stop();
next.addEventListener(MouseEvent.CLICK, goNext);
};
}
private function good(event:Event):void{
event.target.removeEventListener(MouseEvent.CLICK, good);
event.target.removeEventListener(MouseEvent.MOUSE_DOWN, goodDown);
event.target.removeEventListener(MouseEvent.MOUSE_OVER, goodOver);
event.target.removeEventListener(MouseEvent.MOUSE_OUT, goodOut);
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
goNext(null);
}
private function addShear():void{
Mouse.hide();
shear.mouseChildren = false;
shear.mouseEnabled = false;
container.addChild(shear);
shear.x = container.mouseX;
shear.y = container.mouseY;
shear.startDrag();
SoundConsole.getInstance().replaySound(SoundConsole.SHEAR_SOUND);
}
private function removeShear():void{
Mouse.show();
SoundConsole.getInstance().stopSound(SoundConsole.reSound);
if (((!((shear == null))) && (!((shear.parent == null))))){
container.removeChild(shear);
};
}
private function savePosition():void{
var mc:MovieClip;
var position:Point;
var i:int;
while (i < level.numChildren) {
mc = new MovieClip();
position = new Point();
mc = MovieClip(level.getChildAt(i));
position.x = (mc.x + 38);
position.y = mc.y;
positionList.push(position);
i++;
};
animal.removeChild(level);
}
private function badDown(event:MouseEvent):void{
event.target.gotoAndStop(3);
}
private function draw(event:MouseEvent):void{
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.BEGINCUT));
first.x = clothbm.mouseX;
first.y = clothbm.mouseY;
angle.x = clothbm.mouseX;
angle.y = clothbm.mouseY;
addShear();
container.addEventListener(MouseEvent.MOUSE_MOVE, drawLine);
}
private function delEvent():void{
removeShear();
next.mouseEnabled = false;
next.removeEventListener(MouseEvent.CLICK, goNext);
guide.removeEventListener(MouseEvent.CLICK, disGuide);
back.removeEventListener(MouseEvent.CLICK, goMenu);
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.ENDCUT));
BroadCast.instance.removeEventListener(TeddyEvent.ACTIVATE, activate);
BroadCast.instance.removeEventListener(TeddyEvent.FAIL, fail);
container.removeEventListener(MouseEvent.MOUSE_DOWN, draw);
container.removeEventListener(MouseEvent.MOUSE_UP, stopDraw);
container.removeEventListener(MouseEvent.MOUSE_MOVE, drawLine);
}
private function goodOut(event:MouseEvent):void{
event.target.gotoAndStop(1);
}
private function initCon():void{
animal = Library.getMovieClip(((Data.animal + "_cut_") + Data.cutStatus));
cloth = Library.getMovieClip("allCloth");
shear = Library.getMovieClip("shear");
text = container["text_mc"];
guide = container["guide"];
next = container["next_btn"];
lace = container["lace_mc"];
back = container["back"];
moreGames = container["more_btn"];
}
private function beginCut(event:TeddyEvent):void{
BroadCast.instance.removeEventListener(TeddyEvent.BEGIN, beginCut);
initEvent();
}
private function drawLine(event:MouseEvent):void{
angleChange();
checkPoint(new Point(container.stage.mouseX, container.mouseY));
var i:int;
while (i < 20) {
if (first.x > clothbm.mouseX){
first.x = (first.x - 1);
} else {
if (first.x < clothbm.mouseX){
first.x = (first.x + 1);
} else {
first.x = clothbm.mouseX;
};
};
if (first.y > clothbm.mouseY){
first.y = (first.y - 1);
} else {
if (first.y < clothbm.mouseY){
first.y = (first.y + 1);
} else {
first.y = clothbm.mouseY;
};
};
drawPoint(first);
i++;
};
}
private function angleChange():void{
var dx:Number;
var dy:Number;
var radians:Number;
var length:int = (((container.mouseX - angle.x) * (container.mouseX - angle.x)) + ((container.mouseY - angle.y) * (container.mouseY - angle.y)));
if (length > 100){
dx = (container.mouseX - angle.x);
dy = (container.mouseY - angle.y);
radians = Math.atan2(dy, dx);
shear.rotation = ((radians * 180) / Math.PI);
angle.x = container.mouseX;
angle.y = container.mouseY;
};
}
private function checkPoint(point:Point):void{
var distance:int;
var num:int;
while (num < positionList.length) {
distance = (((positionList[num].x - point.x) * (positionList[num].x - point.x)) + ((positionList[num].y - point.y) * (positionList[num].y - point.y)));
if (distance < (Data.cutList[(Data.animal + Data.cutStatus)] * Data.cutList[(Data.animal + Data.cutStatus)])){
positionList.splice(num, 1);
};
num++;
};
if (positionList.length == 0){
delEvent();
goodText();
};
}
private function initEvent():void{
container.addEventListener(MouseEvent.MOUSE_DOWN, draw);
container.addEventListener(MouseEvent.MOUSE_UP, stopDraw);
BroadCast.instance.addEventListener(TeddyEvent.FAIL, fail);
}
private function stopDraw(event:MouseEvent):void{
Data.cutOnce = false;
removeShear();
container.removeEventListener(MouseEvent.MOUSE_MOVE, drawLine);
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.ENDCUT));
}
private function stay(event:MouseEvent):void{
container.removeChild(ms);
}
private function activate(event:TeddyEvent):void{
text.alpha = 0;
text.mouseChildren = false;
text.mouseEnabled = false;
if (!played){
lace.addEventListener(Event.ENTER_FRAME, laceStop);
lace.play();
played = true;
};
guide.addEventListener(MouseEvent.CLICK, disGuide);
back.addEventListener(MouseEvent.CLICK, goMenu);
BroadCast.instance.addEventListener(TeddyEvent.BEGIN, beginCut);
}
private function goMenu(event:MouseEvent):void{
ms = Library.getMovieClip("MakeSure");
container.addChild(ms);
ms.x = 233;
ms.y = 122;
ms.addEventListener(Event.ENTER_FRAME, makeSure);
}
private function badOver(event:MouseEvent):void{
event.target.gotoAndStop(2);
}
private function goNext(event:MouseEvent):void{
var cookie:SharedObject;
Data.cutStatus = (Data.cutStatus + 1);
if (Data.cutStatus < 4){
this.dispatchEvent(new Event(UIEvent.KEEPCUTTRING));
} else {
if (Data.cutOnce){
Award_HighScore.instance.submitAchievement("award4");
cookie = SharedObject.getLocal(Data.CookieName);
cookie.data["award4"] = true;
cookie.flush();
cookie.close();
if (((((((((!((cookie.data["award1"] == null))) && (!((cookie.data["award2"] == null))))) && (!((cookie.data["award3"] == null))))) && (!((cookie.data["award4"] == null))))) && (!((cookie.data["award5"] == null))))){
GoogleEvent.instance.gaTrackEvent("all awards unlocked", true);
};
};
this.dispatchEvent(new Event(UIEvent.SEW));
};
}
private function goodDown(event:MouseEvent):void{
event.target.gotoAndStop(3);
}
}
}//package manager
Section 107
//DecorateManager (manager.DecorateManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import tools.*;
import core.*;
import flash.geom.*;
import zlong.site.*;
public class DecorateManager extends Manager {
private var guide:MovieClip;
private var back_btn:MovieClip;
private var currentEye:MovieClip;
private var mouthPoint:Point;
private var eyebtn:MovieClip;
private var next_btn:MovieClip;
private var animal:MovieClip;
private var ms:MovieClip;
private var nosebtn:MovieClip;
private var text:MovieClip;
private var mouthbtn:MovieClip;
private var eyetable:MovieClip;
private var currentMouth:MovieClip;
private var table:MovieClip;
private var nosetable:MovieClip;
private var currentTable:MovieClip;
private var prop:MovieClip;
private var eyePoint:Point;
private var mouthtable:MovieClip;
private var currentNose:MovieClip;
private var moreGames:MovieClip;
private var currentProp:String;
private var nosePoint:Point;
public function DecorateManager(){
super();
}
private function goNext(event:MouseEvent):void{
delEvent();
this.dispatchEvent(new Event(UIEvent.COMPLETE));
}
private function Menu(event:MouseEvent):void{
delEvent();
this.dispatchEvent(new Event(UIEvent.GOMENU));
}
private function disGuide(event:MouseEvent):void{
text.alpha = 1;
text.mouseChildren = true;
text.mouseEnabled = true;
}
override public function init(container:MovieClip):void{
super.init(container);
eyePoint = new Point();
mouthPoint = new Point();
nosePoint = new Point();
initCon();
initStatus();
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, activate);
}
private function eyeTable(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
removeTable(currentTable);
table.gotoAndStop("eye");
showTable(eyetable);
currentProp = "eye";
}
private function initStatus():void{
if (!SiteInfo.instance.allowed){
moreGames["text"].gotoAndStop(2);
} else {
moreGames["text"].gotoAndStop(1);
};
table.gotoAndStop("eye");
eyebtn.buttonMode = true;
mouthbtn.buttonMode = true;
nosebtn.buttonMode = true;
animal["cloth"].gotoAndStop(Data.cloth);
SoundConsole.getInstance().playSound(SoundConsole.TEXT_SOUND);
guide.gotoAndStop("normal");
guide.buttonMode = true;
var i:int;
while (i < eyetable.numChildren) {
MovieClip(eyetable.getChildAt(i)).gotoAndStop(Data.animal);
i++;
};
var j:int;
while (j < mouthtable.numChildren) {
MovieClip(mouthtable.getChildAt(j)).gotoAndStop(Data.animal);
j++;
};
var k:int;
while (k < nosetable.numChildren) {
MovieClip(nosetable.getChildAt(k)).gotoAndStop(Data.animal);
k++;
};
eyePoint = new Point(animal["eyeposition"].x, animal["eyeposition"].y);
mouthPoint = new Point(animal["mouthposition"].x, animal["mouthposition"].y);
nosePoint = new Point(animal["noseposition"].x, animal["noseposition"].y);
eyeTable(null);
}
private function addProp(event:TeddyEvent):void{
prop = Library.getMovieClip((event.object.name + "_all"));
prop.removeSound();
prop.mouseEnabled = false;
(prop as Prop)._position = "game";
container.addChild(prop);
prop.name = event.object.name;
prop.x = container.mouseX;
prop.y = container.mouseY;
prop.gotoAndStop(Data.animal);
prop.startDrag();
}
private function eye():void{
if (animal.hitTestObject(prop)){
if (currentEye != null){
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.SHOWPROP, currentEye));
container.removeChild(currentEye);
};
currentEye = (prop as MovieClip);
currentEye.name = prop.name;
currentEye.x = eyePoint.x;
currentEye.y = eyePoint.y;
Data.eye = currentEye.name;
currentEye.stopDrag();
prop = null;
} else {
setBack();
};
}
private function makeSure(event:Event):void{
var ok_btn:MovieClip;
var no_btn:MovieClip;
if (ms.currentFrame == 34){
ok_btn = ms["ok_btn"];
no_btn = ms["no_btn"];
ok_btn.mouseChildren = false;
no_btn.mouseChildren = false;
ok_btn.addEventListener(MouseEvent.CLICK, Menu);
no_btn.addEventListener(MouseEvent.CLICK, stay);
};
if (ms.currentFrame == ms.totalFrames){
ms.removeEventListener(Event.ENTER_FRAME, makeSure);
ms.stop();
};
}
private function removeTable(mc:MovieClip):void{
if (mc != null){
container.setChildIndex(mc, 0);
currentTable = null;
};
}
private function noseTable(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
removeTable(currentTable);
table.gotoAndStop("nose");
showTable(nosetable);
currentProp = "nose";
}
private function mouth():void{
if (animal.hitTestObject(prop)){
if (currentMouth != null){
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.SHOWPROP, currentMouth));
container.removeChild(currentMouth);
};
currentMouth = (prop as MovieClip);
currentMouth.name = prop.name;
currentMouth.x = mouthPoint.x;
currentMouth.y = mouthPoint.y;
Data.mouth = currentMouth.name;
currentMouth.stopDrag();
prop = null;
} else {
setBack();
};
}
private function delEvent():void{
next_btn.removeEventListener(MouseEvent.CLICK, goNext);
back_btn.removeEventListener(MouseEvent.CLICK, goMenu);
eyebtn.removeEventListener(MouseEvent.CLICK, eyeTable);
mouthbtn.removeEventListener(MouseEvent.CLICK, mouthTable);
nosebtn.removeEventListener(MouseEvent.CLICK, noseTable);
BroadCast.instance.removeEventListener(TeddyEvent.PROP, addProp);
BroadCast.instance.removeEventListener(TeddyEvent.ACTIVATE, activate);
container.removeEventListener(MouseEvent.MOUSE_UP, checkPosition);
}
private function checkPosition(event:MouseEvent):void{
if (prop != null){
SoundConsole.getInstance().playSound(SoundConsole.ARROW_PRESS);
switch (currentProp){
case "eye":
eye();
break;
case "mouth":
mouth();
break;
case "nose":
nose();
break;
};
};
}
private function nose():void{
if (animal.hitTestObject(prop)){
if (currentNose != null){
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.SHOWPROP, currentNose));
container.removeChild(currentNose);
};
currentNose = (prop as MovieClip);
currentNose.name = prop.name;
currentNose.x = nosePoint.x;
currentNose.y = nosePoint.y;
Data.nose = currentNose.name;
currentNose.stopDrag();
prop = null;
} else {
setBack();
};
}
private function mouthTable(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
removeTable(currentTable);
table.gotoAndStop("mouth");
showTable(mouthtable);
currentProp = "mouth";
}
private function initCon():void{
next_btn = container["next"];
back_btn = container["back"];
eyebtn = container["eyebtn"];
mouthbtn = container["mouthbtn"];
nosebtn = container["nosebtn"];
eyetable = Library.getMovieClip("eye_table");
container.addChildAt(eyetable, 0);
mouthtable = Library.getMovieClip("mouth_table");
container.addChildAt(mouthtable, 0);
nosetable = Library.getMovieClip("nose_table");
container.addChildAt(nosetable, 0);
table = container["table"];
animal = Library.getMovieClip((Data.animal + "_decorate"));
container.addChildAt(animal, (container.numChildren - 2));
text = container["text_mc"];
guide = container["guide"];
moreGames = container["more_btn"];
}
private function stay(event:MouseEvent):void{
container.removeChild(ms);
}
private function setBack():void{
if (prop != null){
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.SHOWPROP, prop));
container.removeChild(prop);
prop = null;
};
}
private function goMenu(event:MouseEvent):void{
ms = Library.getMovieClip("MakeSure");
container.addChild(ms);
ms.x = 233;
ms.y = 122;
ms.addEventListener(Event.ENTER_FRAME, makeSure);
}
private function initEvent():void{
next_btn.addEventListener(MouseEvent.CLICK, goNext);
back_btn.addEventListener(MouseEvent.CLICK, goMenu);
eyebtn.addEventListener(MouseEvent.CLICK, eyeTable);
mouthbtn.addEventListener(MouseEvent.CLICK, mouthTable);
nosebtn.addEventListener(MouseEvent.CLICK, noseTable);
BroadCast.instance.addEventListener(TeddyEvent.PROP, addProp);
container.addEventListener(MouseEvent.MOUSE_UP, checkPosition);
guide.addEventListener(MouseEvent.MOUSE_DOWN, disGuide);
}
private function activate(event:TeddyEvent):void{
text.alpha = 0;
text.mouseChildren = false;
text.mouseEnabled = false;
initEvent();
}
private function showTable(mc:MovieClip):void{
container.setChildIndex(mc, container.getChildIndex(table));
currentTable = mc;
}
}
}//package manager
Section 108
//FillManager (manager.FillManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import tools.*;
import core.*;
import zlong.site.*;
public class FillManager extends Manager {
private var guide:MovieClip;
private var moreGames:MovieClip;
private var num:int;// = 0
private var lace:MovieClip;
private var persentBar:MovieClip;
private var text:MovieClip;
private var play:Boolean;// = false
private var ms:MovieClip;
private var funnel:MovieClip;
private var numMovie:int;// = 0
private var cotton:MovieClip;
private var played:Boolean;// = false
private var cottonArray:Array;
private var timeMovie:int;// = 0
private var back:MovieClip;
private var cottonFb:MovieClip;
private var wellDone:MovieClip;
private var funnelUp:MovieClip;
private var next:MovieClip;
private var heap:MovieClip;
private var animal:MovieClip;
public function FillManager(){
super();
}
private function checkCotton(event:MouseEvent):void{
if (cotton != null){
cotton.stopDrag();
if ((((play == false)) && (funnel.hitTestObject(cotton)))){
play = true;
cottonFb = cotton;
cotton = null;
cottonMove();
} else {
container.removeChild(cotton);
cotton = null;
};
};
}
private function well(event:Event):void{
if (wellDone.currentFrame == wellDone.totalFrames){
wellDone.stop();
wellDone.gotoAndStop(1);
};
}
private function persentPlay():void{
persentBar.addEventListener(Event.ENTER_FRAME, playMovie);
}
private function goNext(event:MouseEvent):void{
delEvent();
this.dispatchEvent(new Event(UIEvent.DECORATE));
}
private function Menu(event:MouseEvent):void{
delEvent();
this.dispatchEvent(new Event(UIEvent.GOMENU));
}
override public function init(container:MovieClip):void{
super.init(container);
cottonArray = new Array();
initCon();
initStatus();
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, activate);
}
private function moveDown(event:Event):void{
if ((cottonFb.x > funnel.x)){
cottonFb.x = (cottonFb.x - 1);
} else {
cottonFb.x = (cottonFb.x + 1);
};
cottonFb.y = (cottonFb.y + 2);
if (cottonFb.y > (funnel.y + 10)){
container.removeChild(cottonFb);
num++;
cottonFb = null;
funnel.removeEventListener(Event.ENTER_FRAME, moveDown);
funnel.addEventListener(Event.ENTER_FRAME, stopMc);
};
}
private function disGuide(event:MouseEvent):void{
text.alpha = 1;
text.mouseChildren = true;
text.mouseEnabled = true;
}
private function initStatus():void{
if (!SiteInfo.instance.allowed){
moreGames["text"].gotoAndStop(2);
} else {
moreGames["text"].gotoAndStop(1);
};
container.addChild(wellDone);
wellDone.x = 320;
wellDone.y = 150;
wellDone.stop();
SoundConsole.getInstance().playSound(SoundConsole.TEXT_SOUND);
guide.buttonMode = true;
guide.gotoAndStop("normal");
text.gotoAndStop("normal");
persentBar.buttonMode = false;
persentBar.gotoAndStop(1);
funnel.stop();
funnelUp.stop();
animal["cloth"].gotoAndStop(Data.cloth);
heap.buttonMode = true;
next.mouseEnabled = false;
next.buttonMode = false;
next.alpha = 0;
lace.stop();
}
private function makeSure(event:Event):void{
var ok_btn:MovieClip;
var no_btn:MovieClip;
if (ms.currentFrame == 34){
ok_btn = ms["ok_btn"];
no_btn = ms["no_btn"];
ok_btn.mouseChildren = false;
no_btn.mouseChildren = false;
ok_btn.addEventListener(MouseEvent.CLICK, Menu);
no_btn.addEventListener(MouseEvent.CLICK, stay);
};
if (ms.currentFrame == ms.totalFrames){
ms.removeEventListener(Event.ENTER_FRAME, makeSure);
ms.stop();
};
}
private function setPosition(event:Event):void{
funnel.y = (funnel.y + 7);
funnelUp.y = (funnelUp.y + 7);
if (funnel.y > 50){
animal.y = (animal.y + 7);
};
if (animal.y > 290){
container.removeEventListener(Event.ENTER_FRAME, setPosition);
initEvent();
};
}
private function initStart():void{
if (!played){
SoundConsole.getInstance().playSound(SoundConsole.GET_SOUND);
lace.addEventListener(Event.ENTER_FRAME, laceStop);
lace.play();
container.addEventListener(Event.ENTER_FRAME, setPosition);
played = true;
};
}
private function stopMc(event:Event):void{
if (funnel.currentFrame == funnel.totalFrames){
funnel.removeEventListener(Event.ENTER_FRAME, stopMc);
funnel.stop();
funnelUp.stop();
play = false;
if (num == 8){
wellDone.play();
next.alpha = 1;
next.mouseEnabled = true;
next.buttonMode = true;
next.addEventListener(MouseEvent.CLICK, goNext);
};
};
}
private function laceStop(event:Event):void{
if (lace.currentFrame == lace.totalFrames){
lace.removeEventListener(Event.ENTER_FRAME, laceStop);
lace.stop();
};
}
private function changeHand(event:MouseEvent):void{
cotton = new MovieClip();
cotton = Library.getMovieClip("cotton");
cotton.buttonMode = true;
container.addChildAt(cotton, (container.getChildIndex(funnel) + 1));
cotton.x = container.mouseX;
cotton.y = container.mouseY;
cotton.startDrag();
}
private function cottonMove():void{
funnel.play();
funnelUp.play();
SoundConsole.getInstance().playSound(SoundConsole.COTTON_SOUND);
persentPlay();
funnel.addEventListener(Event.ENTER_FRAME, moveDown);
}
private function delEvent():void{
heap.removeEventListener(MouseEvent.MOUSE_DOWN, changeHand);
container.removeEventListener(MouseEvent.MOUSE_UP, checkCotton);
back.removeEventListener(MouseEvent.CLICK, goMenu);
guide.removeEventListener(MouseEvent.CLICK, disGuide);
BroadCast.instance.removeEventListener(TeddyEvent.ACTIVATE, activate);
}
private function initCon():void{
funnel = container["funneldown"];
funnelUp = container["funnelup"];
animal = Library.getMovieClip((Data.animal + "_fill"));
container.addChildAt(animal, 4);
heap = container["cottonheap"];
guide = container["guide"];
text = container["text_mc"];
persentBar = container["persent_bar"];
back = container["back"];
next = container["next"];
wellDone = Library.getMovieClip("greatMovie");
lace = container["lace_mc"];
moreGames = container["more_btn"];
}
private function stay(event:MouseEvent):void{
container.removeChild(ms);
}
private function playMovie(event:Event):void{
numMovie++;
if (numMovie == 2){
persentBar.nextFrame();
timeMovie++;
numMovie = 0;
};
if (timeMovie == 6){
timeMovie = 0;
persentBar.removeEventListener(Event.ENTER_FRAME, playMovie);
};
}
private function initEvent():void{
heap.addEventListener(MouseEvent.MOUSE_DOWN, changeHand);
container.addEventListener(MouseEvent.MOUSE_UP, checkCotton);
back.addEventListener(MouseEvent.CLICK, goMenu);
guide.addEventListener(MouseEvent.CLICK, disGuide);
wellDone.addEventListener(Event.ENTER_FRAME, well);
}
private function activate(event:TeddyEvent):void{
text.alpha = 0;
text.mouseChildren = false;
text.mouseEnabled = false;
initStart();
}
private function goMenu(event:MouseEvent):void{
ms = Library.getMovieClip("MakeSure");
container.addChild(ms);
ms.x = 233;
ms.y = 122;
ms.addEventListener(Event.ENTER_FRAME, makeSure);
}
}
}//package manager
Section 109
//IntroductionManager (manager.IntroductionManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import tools.*;
import core.*;
import zlong.site.*;
public class IntroductionManager extends Manager {
private var moreGames:MovieClip;
private var text:MovieClip;
private var guide:MovieClip;
public function IntroductionManager(){
super();
}
private function initStatus():void{
if (!SiteInfo.instance.allowed){
moreGames["text"].gotoAndStop(2);
} else {
moreGames["text"].gotoAndStop(1);
};
SoundConsole.getInstance().playSound(SoundConsole.TEXT_SOUND);
text.gotoAndStop("normal");
}
private function initEvent():void{
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, activate);
}
private function activate(event:TeddyEvent):void{
BroadCast.instance.removeEventListener(TeddyEvent.ACTIVATE, activate);
this.dispatchEvent(new Event(UIEvent.ANIMALCHOOSE));
}
override public function init(container:MovieClip):void{
super.init(container);
initCon();
initStatus();
initEvent();
}
private function initCon():void{
text = container["text_mc"];
guide = container["guide"];
moreGames = container["more_btn"];
}
}
}//package manager
Section 110
//Loading (manager.Loading)
package manager {
import flash.display.*;
import flash.events.*;
import zlong.Template.*;
import zlong.breathxue.utils.*;
public class Loading extends AbstractLoadingClass {
private var _mc:Sprite;
private var _persentBar:MovieClip;
public function Loading(m:Sprite){
super(m);
initDis(m);
initEvent();
}
private function delDis():void{
_mc.parent.removeChild(_mc);
}
private function enterFrameHandler(e:Event):void{
var percentSWF:Number = (_mc.root.loaderInfo.bytesLoaded / _mc.root.loaderInfo.bytesTotal);
_persentBar.gotoAndStop(Math.round((percentSWF * 60)));
}
override public function destroy():void{
delEvent();
delDis();
}
private function initEvent():void{
_mc.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
private function initDis(pmc:Sprite):void{
_mc = Attach.getSprite("LoadingUI");
pmc.addChild(_mc);
_persentBar = _mc["persent"];
}
private function delEvent():void{
_mc.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}//package manager
Section 111
//Manager (manager.Manager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import gs.*;
public class Manager extends EventDispatcher {
public var container:MovieClip;
public static var FILL:String = "Fill";
public static var SEW:String = "Sew";
public static var CUTTING:String = "Cutting";
public static var CLOTHCHOOSE:String = "Clothchoose";
public static var ANIMALCHOOSE:String = "Animalchoose";
public static var COMPLETE:String = "Complete";
public static var Introduction:String = "Introduction";
public static var DECORATE:String = "Decorate";
public static var MENU:String = "Menu";
public function Manager(){
super();
}
public function init(container:MovieClip):void{
this.container = container;
}
private function del():void{
trace(("parent : " + container.parent));
if (container.parent != null){
container.parent.removeChild(container);
};
while (container.numChildren) {
container.removeChildAt(0);
};
this.dispatchEvent(new Event(UIEvent.DELOVER));
}
public function dispose():void{
TweenMax.to(container, 0.5, {alpha:0, onComplete:del});
}
}
}//package manager
Section 112
//MenuManager (manager.MenuManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import core.*;
import zlong.site.*;
public class MenuManager extends Manager {
private var music:MovieClip;
private var moreGames:MovieClip;
private var sound:MovieClip;
private var quality:MovieClip;
public function MenuManager(){
super();
}
private function soundManager(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
Data.soundPlay = !(Data.soundPlay);
if (Data.soundPlay){
sound.gotoAndStop(1);
} else {
sound.gotoAndStop(2);
};
}
private function initStatus():void{
if (!SiteInfo.instance.allowed){
moreGames["text"].gotoAndStop(2);
} else {
moreGames["text"].gotoAndStop(1);
};
music.buttonMode = true;
sound.buttonMode = true;
quality.buttonMode = true;
if (Data.isMute){
music.gotoAndStop(2);
} else {
music.gotoAndStop(1);
};
if (Data.soundPlay){
sound.gotoAndStop(1);
} else {
sound.gotoAndStop(2);
};
setQuality();
SoundConsole.getInstance().stopMusic(SoundConsole.currentSound);
SoundConsole.getInstance().playMusic(SoundConsole.MAIN_SCREEN);
}
private function musicManager(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
Data.isMute = !(Data.isMute);
if (Data.isMute){
music.gotoAndStop(2);
SoundConsole.getInstance().stopMusic(SoundConsole.currentSound);
} else {
music.gotoAndStop(1);
SoundConsole.getInstance().playMusic(SoundConsole.MAIN_SCREEN);
};
}
private function qualityManager(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
switch (Data.quality){
case "high":
Data.quality = "medium";
break;
case "medium":
Data.quality = "low";
break;
case "low":
Data.quality = "high";
break;
};
setQuality();
}
override public function init(container:MovieClip):void{
super.init(container);
initCon();
initStatus();
initEvent();
}
private function initEvent():void{
container.start_btn.addEventListener(MouseEvent.CLICK, clickStart);
music.addEventListener(MouseEvent.CLICK, musicManager);
sound.addEventListener(MouseEvent.CLICK, soundManager);
quality.addEventListener(MouseEvent.CLICK, qualityManager);
}
private function initCon():void{
sound = container["sound_btn"];
music = container["music_btn"];
quality = container["quality_btn"];
moreGames = container["more_btn"];
}
private function delEvent():void{
container.start_btn.removeEventListener(MouseEvent.CLICK, clickStart);
music.removeEventListener(MouseEvent.CLICK, musicManager);
sound.removeEventListener(MouseEvent.CLICK, soundManager);
quality.removeEventListener(MouseEvent.CLICK, qualityManager);
}
private function delCon():void{
sound = null;
music = null;
quality = null;
}
private function clickStart(event:MouseEvent):void{
delEvent();
delCon();
this.dispatchEvent(new Event(UIEvent.STARTGAME));
}
private function setQuality():void{
switch (Data.quality){
case "high":
quality.gotoAndStop(1);
container.stage.quality = StageQuality.BEST;
break;
case "medium":
quality.gotoAndStop(2);
container.stage.quality = StageQuality.MEDIUM;
break;
case "low":
quality.gotoAndStop(3);
container.stage.quality = StageQuality.LOW;
break;
};
}
}
}//package manager
Section 113
//SewManager (manager.SewManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import tools.*;
import core.*;
import zlong.spilSystemTool.*;
import flash.net.*;
import flash.geom.*;
import zlong.site.*;
import flash.ui.*;
public class SewManager extends Manager {
private var animal:MovieClip;
private var level:MovieClip;
private var num:Number;
private var lace:MovieClip;
private var mcMask:MovieClip;
private var sewPoint:Point;
private var text:MovieClip;
private var ms:MovieClip;
private var machine:MovieClip;
private var startPoint:Point;
private var played:Boolean;// = false
private var rect:Rectangle;
private var sew:MovieClip;
private var moreGame:MovieClip;
private var positionList:Array;
private var sewbm:Bitmap;
private var next:MovieClip;
private var sewbmd:BitmapData;
private var back:MovieClip;
private var guide:MovieClip;
public function SewManager(){
super();
}
private function goNext(event:MouseEvent):void{
var cookie:SharedObject;
delEvent();
Mouse.show();
Data.sewStatus = (Data.sewStatus + 1);
if (Data.sewStatus < 4){
this.dispatchEvent(new Event(UIEvent.KEEPSEW));
} else {
if (Data.sewOnce){
Award_HighScore.instance.submitAchievement("award5");
GoogleEvent.instance.gaTrackEvent("award5 unlocked", true);
cookie = SharedObject.getLocal(Data.CookieName);
cookie.data["award5"] = true;
cookie.flush();
cookie.close();
if (((((((((!((cookie.data["award1"] == null))) && (!((cookie.data["award2"] == null))))) && (!((cookie.data["award3"] == null))))) && (!((cookie.data["award4"] == null))))) && (!((cookie.data["award5"] == null))))){
GoogleEvent.instance.gaTrackEvent("all awards unlocked", true);
};
};
this.dispatchEvent(new Event(UIEvent.FILL));
};
}
private function bad(event:MouseEvent):void{
event.target.removeEventListener(MouseEvent.CLICK, bad);
event.target.removeEventListener(MouseEvent.MOUSE_DOWN, badDown);
event.target.removeEventListener(MouseEvent.MOUSE_OVER, badOver);
event.target.removeEventListener(MouseEvent.MOUSE_OUT, badOut);
container.removeChild(event.target.parent);
mcMask = new MovieClip();
mcMask.graphics.beginFill(0xFFFFFF, 1);
mcMask.graphics.drawRect(0, 0, container.width, container.height);
mcMask.graphics.endFill();
container.addChild(mcMask);
mcMask.alpha = 0;
num = 0.05;
mcMask.addEventListener(Event.ENTER_FRAME, mask);
mcMask.play();
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
}
private function backOut(event:MouseEvent):void{
Mouse.hide();
}
private function goodText():void{
Mouse.show();
var goodMc:MovieClip = Library.getMovieClip("SewGoodText");
container.addChild(goodMc);
goodMc["good_btn"].buttonMode = true;
goodMc["good_btn"].gotoAndStop(1);
SoundConsole.getInstance().playSound(SoundConsole.GOOD_OVER);
goodMc["good_btn"].addEventListener(MouseEvent.CLICK, good);
goodMc["good_btn"].addEventListener(MouseEvent.MOUSE_DOWN, goodDown);
goodMc["good_btn"].addEventListener(MouseEvent.MOUSE_OVER, goodOver);
goodMc["good_btn"].addEventListener(MouseEvent.MOUSE_OUT, goodOut);
}
private function disGuide(event:MouseEvent):void{
text.alpha = 1;
text.mouseChildren = true;
text.mouseEnabled = true;
}
override public function init(container:MovieClip):void{
super.init(container);
sewbm = new Bitmap();
startPoint = new Point();
positionList = new Array();
level = new MovieClip();
initCon();
initStatus();
if (Data.sewFirst){
SoundConsole.getInstance().playSound(SoundConsole.TEXT_SOUND);
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, sewActivte);
Data.sewFirst = false;
} else {
BroadCast.instance.addEventListener(TeddyEvent.ACTIVATE, sewActivte);
sewActivte(null);
};
}
private function stopSew(event:MouseEvent):void{
trace("sew : false");
Data.sewOnce = false;
machine.gotoAndStop(1);
SoundConsole.getInstance().stopSound(SoundConsole.reSound);
animal.removeEventListener(MouseEvent.MOUSE_MOVE, sewing);
}
private function goWith(event:Event):void{
animal.x = (container.mouseX - animal["position"].x);
animal.y = (container.mouseY - animal["position"].y);
}
private function badOut(event:MouseEvent):void{
event.target.gotoAndStop(1);
}
private function fail(event:Event):void{
stopSew(null);
}
private function goMenu(event:MouseEvent):void{
back.removeEventListener(MouseEvent.MOUSE_OUT, backOver);
moreGame.removeEventListener(MouseEvent.MOUSE_OUT, backOver);
ms = Library.getMovieClip("MakeSure");
container.addChild(ms);
ms.x = 233;
ms.y = 122;
ms.addEventListener(Event.ENTER_FRAME, makeSure);
}
private function goodDown(event:MouseEvent):void{
event.target.gotoAndStop(2);
}
private function makeSure(event:Event):void{
var ok_btn:MovieClip;
var no_btn:MovieClip;
if (ms.currentFrame == 34){
Mouse.show();
ok_btn = ms["ok_btn"];
no_btn = ms["no_btn"];
ok_btn.mouseChildren = false;
no_btn.mouseChildren = false;
ok_btn.addEventListener(MouseEvent.CLICK, Menu);
no_btn.addEventListener(MouseEvent.CLICK, stay);
};
if (ms.currentFrame == ms.totalFrames){
ms.removeEventListener(Event.ENTER_FRAME, makeSure);
ms.stop();
};
}
private function initStatus():void{
if (!SiteInfo.instance.allowed){
moreGame["text"].gotoAndStop(2);
} else {
moreGame["text"].gotoAndStop(1);
};
lace.stop();
container["sew_machine"].mouseEnabled = false;
machine.gotoAndStop(1);
animal.x = (container.mouseX - animal["position"].x);
animal.y = (container.mouseY - animal["position"].y);
savePosition();
guide.gotoAndStop("normal");
guide.buttonMode = true;
text.gotoAndStop("normal");
}
private function drawPoint(point:Point):void{
rect = new Rectangle((point.x - 10), (point.y - 11), 26, 22);
var clf:ColorTransform = new ColorTransform();
clf.alphaMultiplier = 0;
sewbmd.colorTransform(rect, clf);
}
private function goodOver(event:MouseEvent):void{
event.target.gotoAndStop(2);
}
private function Menu(event:MouseEvent):void{
delEvent();
this.dispatchEvent(new Event(UIEvent.GOMENU));
}
private function laceStop(event:Event):void{
if (lace.currentFrame == lace.totalFrames){
lace.removeEventListener(Event.ENTER_FRAME, laceStop);
lace.stop();
next.addEventListener(MouseEvent.CLICK, goNext);
};
}
private function good(event:MouseEvent):void{
event.target.removeEventListener(MouseEvent.CLICK, good);
event.target.removeEventListener(MouseEvent.MOUSE_DOWN, goodDown);
event.target.removeEventListener(MouseEvent.MOUSE_OVER, goodOver);
event.target.removeEventListener(MouseEvent.MOUSE_OUT, goodOut);
delEvent();
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
goNext(null);
}
private function savePosition():void{
var position:Point;
var mc:MovieClip;
var i:int;
while (i < level.numChildren) {
position = new Point();
mc = new MovieClip();
mc = MovieClip(level.getChildAt(i));
position.x = mc.x;
position.y = mc.y;
positionList.push(position);
i++;
};
animal.removeChild(level);
}
private function sewActivte(event:TeddyEvent):void{
text.alpha = 0;
text.mouseChildren = false;
text.mouseEnabled = false;
if (!played){
lace.addEventListener(Event.ENTER_FRAME, laceStop);
lace.play();
played = true;
};
Mouse.hide();
back.addEventListener(MouseEvent.CLICK, goMenu);
back.addEventListener(MouseEvent.MOUSE_OVER, backOver);
back.addEventListener(MouseEvent.MOUSE_OUT, backOut);
moreGame.addEventListener(MouseEvent.MOUSE_OVER, backOver);
moreGame.addEventListener(MouseEvent.MOUSE_OUT, backOut);
next.addEventListener(MouseEvent.MOUSE_OVER, backOver);
next.addEventListener(MouseEvent.MOUSE_OUT, backOut);
container.addEventListener(Event.ENTER_FRAME, goWith);
container.addEventListener(MouseEvent.MOUSE_DOWN, passPoint);
}
private function delEvent():void{
Mouse.show();
next.mouseEnabled = false;
next.removeEventListener(MouseEvent.CLICK, goNext);
container.removeEventListener(MouseEvent.MOUSE_UP, stopSew);
container.removeEventListener(Event.ENTER_FRAME, goWith);
animal.removeEventListener(MouseEvent.MOUSE_DOWN, getReady);
animal.removeEventListener(MouseEvent.MOUSE_MOVE, sewing);
BroadCast.instance.removeEventListener(TeddyEvent.ACTIVATE, sewActivte);
back.removeEventListener(MouseEvent.CLICK, goMenu);
back.removeEventListener(MouseEvent.MOUSE_OVER, backOver);
back.removeEventListener(MouseEvent.MOUSE_OUT, backOut);
moreGame.removeEventListener(MouseEvent.MOUSE_OVER, backOver);
moreGame.removeEventListener(MouseEvent.MOUSE_OUT, backOut);
next.removeEventListener(MouseEvent.MOUSE_OVER, backOver);
next.removeEventListener(MouseEvent.MOUSE_OUT, backOut);
container.removeEventListener(Event.ENTER_FRAME, goWith);
container.removeEventListener(MouseEvent.MOUSE_DOWN, passPoint);
}
private function goodOut(event:MouseEvent):void{
event.target.gotoAndStop(1);
}
private function initCon():void{
animal = Library.getMovieClip(((Data.animal + "_sew_") + Data.sewStatus));
animal["cloth"].gotoAndStop(Data.cloth);
sew = Library.getMovieClip((Data.animal + "_sew_bitmap"));
sew.gotoAndStop(Data.sewStatus);
sew["cloth"].gotoAndStop(Data.cloth);
sewbmd = new BitmapData(sew.width, sew.height, true, 0);
sewbmd.draw(sew);
sewbm.bitmapData = sewbmd;
animal.addChildAt(sewbm, 2);
container.addChildAt(animal, 2);
sewPoint = new Point(247, 259);
level = animal["level"];
text = container["text_mc"];
machine = container["sew_machine"];
guide = container["guide"];
next = container["next_btn"];
lace = container["lace_mc"];
back = container["back"];
moreGame = container["more_btn"];
}
private function badText():void{
Mouse.show();
var badMc:MovieClip = Library.getMovieClip("SewBadText");
container.addChild(badMc);
badMc["bad_btn"].buttonMode = true;
badMc["bad_btn"].gotoAndStop(1);
SoundConsole.getInstance().playSound(SoundConsole.BAD_OVER);
badMc["bad_btn"].addEventListener(MouseEvent.CLICK, bad);
badMc["bad_btn"].addEventListener(MouseEvent.MOUSE_DOWN, badDown);
badMc["bad_btn"].addEventListener(MouseEvent.MOUSE_OVER, badOver);
badMc["bad_btn"].addEventListener(MouseEvent.MOUSE_OUT, badOut);
}
private function backOver(event:MouseEvent):void{
Mouse.show();
}
private function badDown(event:MouseEvent):void{
event.target.gotoAndStop(2);
}
private function initEvent():void{
animal.addEventListener(MouseEvent.MOUSE_DOWN, getReady);
container.addEventListener(MouseEvent.MOUSE_UP, stopSew);
guide.addEventListener(MouseEvent.CLICK, disGuide);
}
private function mask(event:Event):void{
mcMask.alpha = (mcMask.alpha + num);
if (mcMask.alpha > 1){
back.addEventListener(MouseEvent.CLICK, goMenu);
container.addEventListener(Event.ENTER_FRAME, goWith);
container.addEventListener(MouseEvent.MOUSE_DOWN, passPoint);
num = -0.05;
};
if (mcMask.alpha < 0){
mcMask.removeEventListener(Event.ENTER_FRAME, mask);
container.removeChild(mcMask);
initEvent();
Mouse.hide();
};
}
private function getReady(event:MouseEvent):void{
machine.play();
SoundConsole.getInstance().replaySound(SoundConsole.SEW_SOUND);
startPoint.x = (sewPoint.x - animal.x);
startPoint.y = (sewPoint.y - animal.y);
animal.addEventListener(MouseEvent.MOUSE_MOVE, sewing);
}
private function checkPoint(point:Point):void{
var distance:int;
var num:int;
while (num < positionList.length) {
distance = (((positionList[num].x - point.x) * (positionList[num].x - point.x)) + ((positionList[num].y - point.y) * (positionList[num].y - point.y)));
if (distance < (Data.sewList[(Data.animal + Data.sewStatus)] * Data.sewList[(Data.animal + Data.sewStatus)])){
positionList.splice(num, 1);
};
num++;
};
if (positionList.length == 0){
delEvent();
goodText();
SoundConsole.getInstance().stopSound(SoundConsole.reSound);
};
}
private function stay(event:MouseEvent):void{
back.addEventListener(MouseEvent.MOUSE_OUT, backOut);
moreGame.addEventListener(MouseEvent.MOUSE_OUT, backOut);
container.removeChild(ms);
Mouse.hide();
}
private function sewing(event:MouseEvent):void{
var nowPoint:Point = new Point();
nowPoint.x = (sewPoint.x - animal.x);
nowPoint.y = (sewPoint.y - animal.y);
checkPoint(nowPoint);
var i:int;
while (i < 20) {
if (startPoint.x > nowPoint.x){
startPoint.x = (startPoint.x - 1);
} else {
if (startPoint.x < nowPoint.x){
startPoint.x = (startPoint.x + 1);
} else {
startPoint.x = nowPoint.x;
};
};
if (startPoint.y > nowPoint.y){
startPoint.y = (startPoint.y - 1);
} else {
if (startPoint.y < nowPoint.y){
startPoint.y = (startPoint.y + 1);
} else {
startPoint.y = nowPoint.y;
};
};
if (animal["inside"].hitTestPoint(sewPoint.x, sewPoint.y, true)){
fail(null);
break;
};
drawPoint(startPoint);
i++;
};
}
private function badOver(event:MouseEvent):void{
event.target.gotoAndStop(2);
}
private function passPoint(event:MouseEvent):void{
var nowPoint:Point = new Point();
nowPoint.x = (sewPoint.x - animal.x);
nowPoint.y = (sewPoint.y - animal.y);
if (animal[((Data.animal + "_startpoint_") + Data.sewStatus)].hitTestPoint(sewPoint.x, sewPoint.y, true)){
container.removeEventListener(MouseEvent.MOUSE_DOWN, passPoint);
animal.removeChild(animal[((Data.animal + "_startpoint_") + Data.sewStatus)]);
initEvent();
getReady(null);
};
}
}
}//package manager
Section 114
//TagManager (manager.TagManager)
package manager {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import tools.*;
import flash.geom.*;
import flash.ui.*;
public class TagManager {
private var green:MovieClip;
private var eraser:MovieClip;
private var amethyst:MovieClip;
private var red:MovieClip;
private var paper:MovieClip;
private var pencil:MovieClip;
private var orange:MovieClip;
private var first:Point;
private var blueness:MovieClip;
private var tag:MovieClip;
private var _root:MovieClip;
private var tag_1:MovieClip;
private var tag_3:MovieClip;
private var tag_4:MovieClip;
private var tagMc:MovieClip;
private var over:MovieClip;
private var blue:MovieClip;
private var tag_2:MovieClip;
private var currentColor:uint;
private var yellow:MovieClip;
private var paper_down:MovieClip;
public function TagManager(root:MovieClip):void{
super();
_root = root;
first = new Point();
initCon();
initStatus();
initEvent();
}
private function changeBlueness(event:MouseEvent):void{
blueness.gotoAndStop(2);
paper.graphics.lineStyle(2, 3529470);
currentColor = 3529470;
}
private function initStatus():void{
_root.addChild(tagMc);
tag.gotoAndStop(Data.tagName);
paper = tag["paper"];
paper_down = tag[(Data.tagName + "_mc")];
paper.mouseEnabled = false;
pencil.x = _root.mouseX;
pencil.y = _root.mouseY;
pencil.mouseEnabled = false;
pencil.startDrag();
tag_1.buttonMode = true;
tag_2.buttonMode = true;
tag_3.buttonMode = true;
tag_4.buttonMode = true;
changeRed(null);
}
private function changeTag1(event:MouseEvent):void{
tag.removeEventListener(MouseEvent.MOUSE_DOWN, startDraw);
tagMc.removeChild(tag);
tag = Library.getMovieClip("tag_1");
tagMc.addChild(tag);
tag.height = 417.9;
tag.width = 176.4;
tag.x = (504.3 - 417.9);
tag.y = (194.4 + 176.4);
tag.rotation = -90;
paper = tag["paper"];
paper.graphics.lineStyle(2, currentColor);
paper_down = tag["tag1_mc"];
tag.addEventListener(MouseEvent.MOUSE_DOWN, startDraw);
}
private function changeTag2(event:MouseEvent):void{
tag.removeEventListener(MouseEvent.MOUSE_DOWN, startDraw);
tagMc.removeChild(tag);
tag = Library.getMovieClip("tag_2");
tagMc.addChild(tag);
tag.height = 417.9;
tag.width = 176.4;
tag.x = (504.3 - 417.9);
tag.y = (194.4 + 176.4);
tag.rotation = -90;
paper = tag["paper"];
paper.graphics.lineStyle(2, currentColor);
paper_down = tag["tag2_mc"];
tag.addEventListener(MouseEvent.MOUSE_DOWN, startDraw);
}
private function changeTag4(event:MouseEvent):void{
tag.removeEventListener(MouseEvent.MOUSE_DOWN, startDraw);
tagMc.removeChild(tag);
tag = Library.getMovieClip("tag_4");
tagMc.addChild(tag);
tag.height = 417.9;
tag.width = 176.4;
tag.x = (504.3 - 417.9);
tag.y = (194.4 + 176.4);
tag.rotation = -90;
paper = tag["paper"];
paper.graphics.lineStyle(2, currentColor);
paper_down = tag["tag4_mc"];
tag.addEventListener(MouseEvent.MOUSE_DOWN, startDraw);
}
private function showMouse(event:Event):void{
if (!tag.hitTestPoint(tagMc.mouseX, tagMc.mouseY)){
tagMc.removeEventListener(Event.ENTER_FRAME, showMouse);
Mouse.show();
tagMc.removeChild(pencil);
tagMc.addEventListener(Event.ENTER_FRAME, showPen);
};
}
private function changeTag3(event:MouseEvent):void{
tag.removeEventListener(MouseEvent.MOUSE_DOWN, startDraw);
tagMc.removeChild(tag);
tag = Library.getMovieClip("tag_3");
tagMc.addChild(tag);
tag.height = 417.9;
tag.width = 176.4;
tag.x = (504.3 - 417.9);
tag.y = (194.4 + 176.4);
tag.rotation = -90;
paper = tag["paper"];
paper.graphics.lineStyle(2, currentColor);
paper_down = tag["tag3_mc"];
tag.addEventListener(MouseEvent.MOUSE_DOWN, startDraw);
}
private function designOver(event:MouseEvent):void{
Mouse.show();
Data.tag = tag;
delEvent();
_root.dispatchEvent(new Event(UIEvent.DESIGNOVER));
_root.removeChild(tagMc);
}
private function changeBlue(event:MouseEvent):void{
blue.gotoAndStop(2);
paper.graphics.lineStyle(2, 4079597);
currentColor = 4079597;
}
private function changeYellow(event:MouseEvent):void{
yellow.gotoAndStop(2);
paper.graphics.lineStyle(2, 16364823);
currentColor = 16364823;
}
private function startDraw(event:MouseEvent):void{
paper.graphics.moveTo(paper.mouseX, paper.mouseY);
paper.addEventListener(Event.ENTER_FRAME, drawLine);
}
private function changeRed(event:MouseEvent):void{
red.gotoAndStop(2);
paper.graphics.lineStyle(2, 15478829);
currentColor = 15478829;
}
private function changeGreen(event:MouseEvent):void{
green.gotoAndStop(2);
paper.graphics.lineStyle(2, 11200399);
currentColor = 11200399;
}
private function clear(event:MouseEvent):void{
paper.graphics.clear();
paper.graphics.lineStyle(2, currentColor);
}
private function initCon():void{
tagMc = Library.getMovieClip("TagUI");
pencil = tagMc["pencil_mc"];
tagMc.removeChild(pencil);
tag = Library.getMovieClip("tag_1");
tagMc.addChild(tag);
tag.height = 417.9;
tag.width = 176.4;
tag.x = (504.3 - 417.9);
tag.y = (194.4 + 176.4);
tag.rotation = -90;
orange = tagMc["orange_btn"];
red = tagMc["red_btn"];
blue = tagMc["blue_btn"];
yellow = tagMc["yellow_btn"];
blueness = tagMc["blueness_btn"];
green = tagMc["green_btn"];
amethyst = tagMc["amethyst_btn"];
over = tagMc["over"];
tag_1 = tagMc["tag1"];
tag_2 = tagMc["tag2"];
tag_3 = tagMc["tag3"];
tag_4 = tagMc["tag4"];
eraser = tagMc["eraser"];
}
private function delEvent():void{
tag.removeEventListener(MouseEvent.MOUSE_DOWN, startDraw);
_root.removeEventListener(MouseEvent.MOUSE_UP, stopDraw);
orange.removeEventListener(MouseEvent.CLICK, changeOrange);
red.removeEventListener(MouseEvent.CLICK, changeRed);
blue.removeEventListener(MouseEvent.CLICK, changeBlue);
yellow.removeEventListener(MouseEvent.CLICK, changeYellow);
blueness.removeEventListener(MouseEvent.CLICK, changeBlueness);
green.removeEventListener(MouseEvent.CLICK, changeGreen);
amethyst.removeEventListener(MouseEvent.CLICK, changeAmethyst);
over.removeEventListener(MouseEvent.CLICK, designOver);
tag_1.removeEventListener(MouseEvent.CLICK, changeTag1);
tag_2.removeEventListener(MouseEvent.CLICK, changeTag2);
tag_3.removeEventListener(MouseEvent.CLICK, changeTag3);
tag_4.removeEventListener(MouseEvent.CLICK, changeTag4);
tagMc.removeEventListener(Event.ENTER_FRAME, showPen);
}
private function drawLine(event:Event):void{
if (isIn()){
paper.graphics.lineTo(paper.mouseX, paper.mouseY);
} else {
paper.removeEventListener(Event.ENTER_FRAME, drawLine);
};
}
private function changeAmethyst(event:MouseEvent):void{
amethyst.gotoAndStop(2);
paper.graphics.lineStyle(2, 16679398);
currentColor = 16679398;
}
private function showPen(event:Event):void{
if (tag.hitTestPoint(tagMc.mouseX, tagMc.mouseY)){
tagMc.removeEventListener(Event.ENTER_FRAME, showPen);
Mouse.hide();
tagMc.addChild(pencil);
pencil.x = tagMc.mouseX;
pencil.y = tagMc.mouseY;
pencil.startDrag();
tagMc.addEventListener(Event.ENTER_FRAME, showMouse);
};
}
private function stopDraw(event:MouseEvent):void{
paper.removeEventListener(Event.ENTER_FRAME, drawLine);
}
private function initEvent():void{
tag.addEventListener(MouseEvent.MOUSE_DOWN, startDraw);
_root.addEventListener(MouseEvent.MOUSE_UP, stopDraw);
orange.addEventListener(MouseEvent.CLICK, changeOrange);
red.addEventListener(MouseEvent.CLICK, changeRed);
blue.addEventListener(MouseEvent.CLICK, changeBlue);
yellow.addEventListener(MouseEvent.CLICK, changeYellow);
blueness.addEventListener(MouseEvent.CLICK, changeBlueness);
green.addEventListener(MouseEvent.CLICK, changeGreen);
amethyst.addEventListener(MouseEvent.CLICK, changeAmethyst);
over.addEventListener(MouseEvent.CLICK, designOver);
tag_1.addEventListener(MouseEvent.CLICK, changeTag1);
tag_2.addEventListener(MouseEvent.CLICK, changeTag2);
tag_3.addEventListener(MouseEvent.CLICK, changeTag3);
tag_4.addEventListener(MouseEvent.CLICK, changeTag4);
tagMc.addEventListener(Event.ENTER_FRAME, showPen);
eraser.addEventListener(MouseEvent.CLICK, clear);
}
private function isIn():Boolean{
if (paper_down.hitTestPoint(_root.mouseX, _root.mouseY, true)){
return (true);
};
return (false);
}
private function changeOrange(event:MouseEvent):void{
orange.gotoAndStop(2);
paper.graphics.lineStyle(2, 16613421);
currentColor = 16613421;
}
}
}//package manager
Section 115
//UpLoadManager (manager.UpLoadManager)
package manager {
import flash.display.*;
import flash.events.*;
import tools.*;
import zlong.spilSystemTool.*;
import flash.net.*;
import zlong.breathxue.utils.*;
import flash.text.*;
import zlong.site.*;
public class UpLoadManager {
private var BackGround_Bitmap:Bitmap;
private var upload:MovieClip;
private var _backMc:MovieClip;
private var _small:Bitmap;
private var _root:MovieClip;
private var mc:MovieClip;
private var _succeful:MovieClip;
private var loadMc:MovieClip;
private var upMc:MovieClip;
private var shape:MovieClip;
private var _nameTxt:MovieClip;
private var back:MovieClip;
private var _saving:MovieClip;
private var gs:GamatarSender;
private var title:TextField;
private var moreGames:MovieClip;
private var animal:Bitmap;
public function UpLoadManager(root:MovieClip, bitmap:Bitmap, bgBitmap:Bitmap, small:Bitmap){
super();
_root = root;
animal = bitmap;
BackGround_Bitmap = bgBitmap;
_small = small;
mc = new MovieClip();
initCon();
initStatues();
initEvent();
}
private function toUpMc(event:MouseEvent):void{
MovieClip(event.target).removeEventListener(MouseEvent.MOUSE_DOWN, toUpMc);
upMc.removeChild(_backMc);
}
private function scale(event:Event):void{
mc.scaleX = (mc.scaleX + 0.1);
mc.scaleY = (mc.scaleY + 0.1);
if (mc.scaleX > 1){
mc.removeEventListener(Event.ENTER_FRAME, scale);
mc.scaleX = 1;
mc.scaleY = 1;
};
}
private function initCon():void{
upMc = Library.getMovieClip("upLoadUI");
loadMc = Library.getMovieClip("LoadingInfo");
_backMc = Library.getMovieClip("UI_uploadfailed");
mc.addChild(upMc);
upMc.x = -360.5;
upMc.y = -262.7;
mc.scaleX = 0.1;
mc.scaleY = 0.1;
_root.addChild(mc);
mc.x = 350.5;
mc.y = 252.7;
back = upMc["home_btn"];
upload = upMc["upLoad_btn"];
shape = upMc["pictureShape"];
title = upMc["inputText"];
moreGames = upMc["more_btn"];
_nameTxt = upMc["enter_Name_txt"];
_succeful = upMc["successful_txt"];
_saving = upMc["saving_txt"];
upMc.removeChild(_nameTxt);
upMc.removeChild(_succeful);
upMc.removeChild(_saving);
}
private function loadText(event:Event):void{
loadMc.alpha = (loadMc.alpha - 0.02);
if (loadMc.alpha < 0.1){
loadMc.removeEventListener(Event.ENTER_FRAME, loadText);
upMc.removeChild(loadMc);
upload.addEventListener(MouseEvent.CLICK, up);
};
}
private function up(event:MouseEvent):void{
var bd:BitmapData;
var num:Number;
var mc:Bitmap;
var sp:Sprite;
var sp2:Sprite;
var bm:Bitmap;
var bmd:BitmapData;
var bl:Boolean;
GoogleEvent.instance.gaTrackEvent("upload to album", true);
upload.removeEventListener(MouseEvent.CLICK, up);
if ((((((title.text == "")) || ((title.text == null)))) || ((title.text == (_nameTxt.getChildAt(0) as StaticText).text)))){
title.text = "";
upMc.stage.focus = title;
upload.addEventListener(MouseEvent.CLICK, up);
} else {
if (!SiteInfo.instance.allowed){
new Alert(_root, null);
} else {
loadMc.alpha = 1;
upMc.addChild(loadMc);
loadMc.x = ((upMc.width / 2) - 50);
loadMc.y = ((upMc.height / 2) - 50);
loadMc["info"].text = StaticText(_saving.getChildAt(0)).text;
gs = new GamatarSender();
gs.addEventListener(GamatarSender.GAMATAR_SENT_COMPLETE, senderComplete);
gs.addEventListener(GamatarSender.GAMATAR_SENT_ERROR, snderError);
bd = Tools.cutBmp(upMc, (shape.width + 20), (shape.height + 20), (shape.x - 10), (shape.y - 10), (shape.width + 20), (shape.height + 20));
mc = new Bitmap(_small.bitmapData);
sp = new Sprite();
sp2 = new Sprite();
bm = new Bitmap(mc.bitmapData);
sp.addChild(bm);
sp.scaleX = 0.25;
sp.scaleY = 0.25;
sp2.addChild(sp);
bmd = Tools.cutBmp(sp2, 122, 122, 0, 0, 122, 122);
bl = gs.send(bmd, BackGround_Bitmap.bitmapData, 100, title.text);
if (bl){
} else {
snderError(null);
};
};
};
}
private function senderComplete(event:Event):void{
gs.removeEventListener(GamatarSender.GAMATAR_SENT_COMPLETE, senderComplete);
Award_HighScore.instance.submitAchievement("award1");
var cookie:SharedObject = SharedObject.getLocal(Data.CookieName);
cookie.data["award1"] = true;
cookie.flush();
cookie.close();
if (((((((((!((cookie.data["award1"] == null))) && (!((cookie.data["award2"] == null))))) && (!((cookie.data["award3"] == null))))) && (!((cookie.data["award4"] == null))))) && (!((cookie.data["award5"] == null))))){
GoogleEvent.instance.gaTrackEvent("all awards unlocked", true);
};
loadMc["info"].text = StaticText(_succeful.getChildAt(0)).text;
trace("successful");
Trace(gs.renderingUrl);
Trace(gs.previewUrl);
dispear();
}
private function initEvent():void{
back.addEventListener(MouseEvent.CLICK, goBack);
upload.addEventListener(MouseEvent.CLICK, up);
}
private function dispear():void{
gs.removeEventListener(GamatarSender.GAMATAR_SENT_COMPLETE, senderComplete);
gs.removeEventListener(GamatarSender.GAMATAR_SENT_ERROR, snderError);
gs.del();
gs = null;
loadMc.addEventListener(Event.ENTER_FRAME, loadText);
}
private function initStatues():void{
if (!SiteInfo.instance.allowed){
moreGames["text"].gotoAndStop(2);
} else {
moreGames["text"].gotoAndStop(1);
};
upMc.addChild(animal);
shape.width = (animal.width - 20);
shape.height = animal.height;
if (Data.animal == "horse"){
animal.x = (shape.x + 30);
} else {
animal.x = (shape.x - 10);
};
animal.y = (shape.y - 15);
mc.addEventListener(Event.ENTER_FRAME, scale);
title.maxChars = 13;
title.text = (_nameTxt.getChildAt(0) as StaticText).text;
}
private function goBack(event:MouseEvent):void{
_root.removeChild(mc);
_root.dispatchEvent(new Event("back"));
}
private function snderError(event:Event):void{
gs.removeEventListener(GamatarSender.GAMATAR_SENT_ERROR, snderError);
upMc.removeChild(loadMc);
upload.addEventListener(MouseEvent.CLICK, up);
upMc.addChild(_backMc);
var btn:MovieClip = _backMc["back_btn"];
btn.addEventListener(MouseEvent.MOUSE_DOWN, toUpMc);
trace("false");
}
}
}//package manager
Section 116
//TeddyEvent (MyEvent.TeddyEvent)
package MyEvent {
import flash.events.*;
public class TeddyEvent extends Event {
private var _object:Object;
public static var ENDCUT:String = "ENDCUT";
public static var BEGIN:String = "BEGIN";
public static var NAME:String = "NAME";
public static var CHANGETAG:String = "CHANGETAG";
public static var CHECK_POINT:String = "CHECK_POINT";
public static var BEGINSEW:String = "BEGINSEW";
public static var SHOWPROP:String = "SHOWPROP";
public static var PROP:String = "PROP";
public static var BAD:String = "BAD";
public static var FAIL:String = "FAIL";
public static var DELEVENT:String = "DELEVENT";
public static var ACTIVATE:String = "ACTIVATE";
public static var ONCHOOSE:String = "ONCHOOSE";
public static var BEGINCUT:String = "BEGINCUT";
public static var GOOD:String = "GOOD";
public function TeddyEvent(type:String, object:Object=null, bubbles:Boolean=false, cancelable:Boolean=false){
super(type, bubbles, cancelable);
_object = object;
}
public function get object():Object{
return (_object);
}
}
}//package MyEvent
Section 117
//UIEvent (MyEvent.UIEvent)
package MyEvent {
public class UIEvent {
public static var FILL:String = "FILL";
public static var SEW:String = "SEW";
public static var GOMENU:String = "GOMENU";
public static var DECORATE:String = "DECORATE";
public static var CUTTING:String = "CUTTING";
public static var CLOTHCHOOSE:String = "CLOTHCHOOSE";
public static var DESIGNOVER:String = "DESIGNOVER";
public static var ANIMALCHOOSE:String = "ANIMALCHOOSE";
public static var LOADINGCOMPLETE:String = "LOADINGCOMPLETE";
public static var KEEPSEW:String = "KEEPSEW";
public static var KEEPCUTTRING:String = "KEEPCUTTING";
public static var STARTGAME:String = "STARTGAME";
public static var COMPLETE:String = "COMPLETE";
public static var DELOVER:String = "DELOVER";
public function UIEvent(){
super();
}
}
}//package MyEvent
Section 118
//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 119
//a10_com_logo_64 (SWC_fla.a10_com_logo_64)
package SWC_fla {
import flash.display.*;
public dynamic class a10_com_logo_64 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 120
//all_Sound_200 (SWC_fla.all_Sound_200)
package SWC_fla {
import flash.display.*;
public dynamic class all_Sound_200 extends MovieClip {
public function all_Sound_200(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package SWC_fla
Section 121
//allMusic_201 (SWC_fla.allMusic_201)
package SWC_fla {
import flash.display.*;
public dynamic class allMusic_201 extends MovieClip {
public function allMusic_201(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package SWC_fla
Section 122
//girlsgogames_49 (SWC_fla.girlsgogames_49)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_49 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 123
//girlsgogames_50 (SWC_fla.girlsgogames_50)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_50 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 124
//girlsgogames_51 (SWC_fla.girlsgogames_51)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_51 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 125
//girlsgogames_52 (SWC_fla.girlsgogames_52)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_52 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 126
//girlsgogames_53 (SWC_fla.girlsgogames_53)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_53 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 127
//girlsgogames_54 (SWC_fla.girlsgogames_54)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_54 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 128
//girlsgogames_55 (SWC_fla.girlsgogames_55)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_55 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 129
//girlsgogames_57 (SWC_fla.girlsgogames_57)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_57 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 130
//girlsgogames_58 (SWC_fla.girlsgogames_58)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_58 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 131
//girlsgogames_59 (SWC_fla.girlsgogames_59)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_59 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 132
//girlsgogames_60 (SWC_fla.girlsgogames_60)
package SWC_fla {
import flash.display.*;
public dynamic class girlsgogames_60 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 133
//juegosdechicas_56 (SWC_fla.juegosdechicas_56)
package SWC_fla {
import flash.display.*;
public dynamic class juegosdechicas_56 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 134
//label_107 (SWC_fla.label_107)
package SWC_fla {
import flash.display.*;
public dynamic class label_107 extends MovieClip {
public var flag:MovieClip;
}
}//package SWC_fla
Section 135
//LanguageSelectPopup_106 (SWC_fla.LanguageSelectPopup_106)
package SWC_fla {
import flash.display.*;
public dynamic class LanguageSelectPopup_106 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 SWC_fla
Section 136
//logo_asoyun_com_35 (SWC_fla.logo_asoyun_com_35)
package SWC_fla {
import flash.display.*;
public dynamic class logo_asoyun_com_35 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 137
//logo_game_12 (SWC_fla.logo_game_12)
package SWC_fla {
import flash.display.*;
public dynamic class logo_game_12 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 138
//logo_game_com_my_36 (SWC_fla.logo_game_com_my_36)
package SWC_fla {
import flash.display.*;
public dynamic class logo_game_com_my_36 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 139
//logo_giocaregratis_it_24 (SWC_fla.logo_giocaregratis_it_24)
package SWC_fla {
import flash.display.*;
public dynamic class logo_giocaregratis_it_24 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 140
//logo_laro_com_ph_62 (SWC_fla.logo_laro_com_ph_62)
package SWC_fla {
import flash.display.*;
public dynamic class logo_laro_com_ph_62 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 141
//logo_minigry_pl_34 (SWC_fla.logo_minigry_pl_34)
package SWC_fla {
import flash.display.*;
public dynamic class logo_minigry_pl_34 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 142
//logo_my_games_co_uk_27 (SWC_fla.logo_my_games_co_uk_27)
package SWC_fla {
import flash.display.*;
public dynamic class logo_my_games_co_uk_27 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 143
//logo_oyunlar123_com_48 (SWC_fla.logo_oyunlar123_com_48)
package SWC_fla {
import flash.display.*;
public dynamic class logo_oyunlar123_com_48 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 144
//new_agame_com_9 (SWC_fla.new_agame_com_9)
package SWC_fla {
import flash.display.*;
public dynamic class new_agame_com_9 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 145
//new_clickjogos_com_22 (SWC_fla.new_clickjogos_com_22)
package SWC_fla {
import flash.display.*;
public dynamic class new_clickjogos_com_22 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 146
//new_flashgames_ru_28 (SWC_fla.new_flashgames_ru_28)
package SWC_fla {
import flash.display.*;
public dynamic class new_flashgames_ru_28 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 147
//new_game_co_in_30 (SWC_fla.new_game_co_in_30)
package SWC_fla {
import flash.display.*;
public dynamic class new_game_co_in_30 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 148
//new_games_co_id_32 (SWC_fla.new_games_co_id_32)
package SWC_fla {
import flash.display.*;
public dynamic class new_games_co_id_32 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 149
//new_jeu_fr_18 (SWC_fla.new_jeu_fr_18)
package SWC_fla {
import flash.display.*;
public dynamic class new_jeu_fr_18 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 150
//new_spel_se_25 (SWC_fla.new_spel_se_25)
package SWC_fla {
import flash.display.*;
public dynamic class new_spel_se_25 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 151
//new_spielen_com_20 (SWC_fla.new_spielen_com_20)
package SWC_fla {
import flash.display.*;
public dynamic class new_spielen_com_20 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 152
//new_zapjuegos_com_14 (SWC_fla.new_zapjuegos_com_14)
package SWC_fla {
import flash.display.*;
public dynamic class new_zapjuegos_com_14 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 153
//newagame_co_uk_66 (SWC_fla.newagame_co_uk_66)
package SWC_fla {
import flash.display.*;
public dynamic class newagame_co_uk_66 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 154
//newspel_nl_16 (SWC_fla.newspel_nl_16)
package SWC_fla {
import flash.display.*;
public dynamic class newspel_nl_16 extends MovieClip {
public var displayArea_mc:MovieClip;
}
}//package SWC_fla
Section 155
//Timeline_136 (SWC_fla.Timeline_136)
package SWC_fla {
import flash.display.*;
public dynamic class Timeline_136 extends MovieClip {
public function Timeline_136(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package SWC_fla
Section 156
//Timeline_360 (SWC_fla.Timeline_360)
package SWC_fla {
import flash.display.*;
public dynamic class Timeline_360 extends MovieClip {
public function Timeline_360(){
addFrameScript(24, frame25);
}
function frame25(){
stop();
}
}
}//package SWC_fla
Section 157
//welldone_446 (SWC_fla.welldone_446)
package SWC_fla {
import flash.display.*;
public dynamic class welldone_446 extends MovieClip {
public function welldone_446(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package SWC_fla
Section 158
//Alert (tools.Alert)
package tools {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import zlong.breathxue.utils.*;
import zlong.country.*;
public class Alert {
private var _afterFunction:Function;
private var _mc:MovieClip;
public function Alert(con:DisplayObjectContainer, af:Function){
super();
_mc = Attach.getMovieClip("UI_setlock");
con.addChild(_mc);
_afterFunction = af;
_mc.addEventListener(MouseEvent.CLICK, uiMouseClick);
}
private function removeSelf():void{
_mc.removeEventListener(MouseEvent.CLICK, uiMouseClick);
_mc.parent.removeChild(_mc);
}
private function m15():void{
var num:int = CountryInfo.instance.language;
}
private function uiMouseClick(e:MouseEvent):void{
var tempStr:String = e.target.name;
switch (tempStr){
case "goon":
removeSelf();
if (_afterFunction != null){
_afterFunction();
};
break;
case "agame":
navigateToURL(new URLRequest(("http://" + CountryInfo.instance.domain)), "_blank");
break;
default:
break;
};
}
}
}//package tools
Section 159
//AnimalButton (tools.AnimalButton)
package tools {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import core.*;
public class AnimalButton extends MovieClip {
public function AnimalButton(){
super();
initStatue();
initEvent();
}
private function down(event:MouseEvent):void{
this.scaleX = 1.1;
this.scaleY = 1.1;
Data.animal = this.name;
SoundConsole.getInstance().playSound(SoundConsole.SELECT_ITEM);
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.ONCHOOSE));
}
private function initEvent():void{
this.addEventListener(MouseEvent.MOUSE_OVER, over);
this.addEventListener(MouseEvent.MOUSE_OUT, out);
this.addEventListener(MouseEvent.MOUSE_DOWN, down);
}
private function initStatue():void{
this.mouseChildren = false;
this.buttonMode = true;
this.gotoAndStop(1);
}
private function out(event:MouseEvent):void{
this.gotoAndStop(1);
}
private function over(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.ROLL_ITEM);
this.gotoAndStop(2);
}
}
}//package tools
Section 160
//BroadCast (tools.BroadCast)
package tools {
import flash.events.*;
public class BroadCast extends EventDispatcher {
private static var _instance:BroadCast;
public function BroadCast(){
super();
}
public static function get instance():BroadCast{
if (_instance == null){
_instance = new (BroadCast);
};
return (_instance);
}
}
}//package tools
Section 161
//Guide (tools.Guide)
package tools {
import flash.display.*;
import flash.events.*;
import core.*;
public class Guide extends MovieClip {
public function Guide(){
super();
this.mouseChildren = false;
this.addEventListener(MouseEvent.MOUSE_OVER, over);
this.addEventListener(MouseEvent.CLICK, click);
}
private function click(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.MENU_PRESS);
}
private function over(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.MENU_ROLL_OVER);
}
}
}//package tools
Section 162
//GuideText (tools.GuideText)
package tools {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import core.*;
public class GuideText extends MovieClip {
private var start:MovieClip;
private var textmc:MovieClip;
private var textMask:Sprite;
public function GuideText(){
super();
initCon();
initStatus();
initEvent();
}
private function initCon():void{
textmc = this["text"];
textMask = this["mask_mc"];
start = this["start_btn"];
textmc.mask = textMask;
}
private function initStatus():void{
this.gotoAndStop("normal");
start.gotoAndStop(1);
start.alpha = 0;
start.mouseEnabled = false;
}
private function initEvent():void{
this.addEventListener(Event.ENTER_FRAME, move);
}
private function activate(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.CLICK);
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.ACTIVATE));
}
private function out(event:MouseEvent):void{
start.gotoAndStop(1);
}
private function move(event:Event):void{
textMask.y = (textMask.y + 3);
if (textMask.y > textmc.y){
this.removeEventListener(Event.ENTER_FRAME, move);
start.alpha = 1;
start.mouseEnabled = true;
start.buttonMode = true;
start.addEventListener(MouseEvent.MOUSE_DOWN, down);
start.addEventListener(MouseEvent.CLICK, activate);
start.addEventListener(MouseEvent.MOUSE_OVER, over);
start.addEventListener(MouseEvent.MOUSE_OUT, out);
};
}
private function over(event:MouseEvent):void{
start.gotoAndStop(2);
}
private function down(event:MouseEvent):void{
start.gotoAndStop(3);
}
}
}//package tools
Section 163
//Library (tools.Library)
package tools {
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public class Library {
public function Library(){
super();
}
public static function getClass(name:String):Class{
var cd:Class;
var name = name;
cd = (getDefinitionByName(name) as Class);
//unresolved jump
var _slot1 = re;
return (null);
return (cd);
}
public static function getSprite(name:String):Sprite{
return (Sprite(new (getClass(name))));
}
public static function getSound(name:String):Sound{
return (Sound(new (getClass(name))));
}
public static function getMovieClip(name:String):MovieClip{
return (MovieClip(new (getClass(name))));
}
public static function getDisplayObject(s:String):DisplayObject{
var temp:Class = (getDefinitionByName(s) as Class);
var returnObj:DisplayObject = new (temp);
return (returnObj);
}
public static function getBitmapData(name:String):BitmapData{
return (BitmapData(new getClass(name)(1, 1)));
}
}
}//package tools
Section 164
//Light (tools.Light)
package tools {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
public class Light extends MovieClip {
public function Light(){
super();
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_DOWN, begin);
BroadCast.instance.addEventListener(TeddyEvent.CHECK_POINT, checkPoint);
}
private function checkPoint(event:TeddyEvent):void{
if (this.hitTestPoint(event.object.x, event.object.y)){
begin(null);
};
}
private function begin(event:MouseEvent=null):void{
this.parent.removeChild(this);
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.BEGIN));
}
}
}//package tools
Section 165
//OutMask (tools.OutMask)
package tools {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
public class OutMask extends MovieClip {
public function OutMask(){
super();
BroadCast.instance.addEventListener(TeddyEvent.BEGINCUT, begin);
BroadCast.instance.addEventListener(TeddyEvent.ENDCUT, end);
}
private function begin(event:TeddyEvent):void{
this.addEventListener(MouseEvent.MOUSE_MOVE, fail);
}
private function end(event:TeddyEvent):void{
this.removeEventListener(MouseEvent.MOUSE_MOVE, fail);
}
private function fail(event:MouseEvent):void{
BroadCast.instance.dispatchEvent(new Event(TeddyEvent.FAIL));
}
}
}//package tools
Section 166
//PencilButton (tools.PencilButton)
package tools {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
public class PencilButton extends MovieClip {
public var onChoose:Boolean;
public function PencilButton(){
super();
this.buttonMode = true;
this.gotoAndStop(1);
onChoose = false;
if (this.name == "red_btn"){
onChoose = true;
this.gotoAndStop(2);
};
initEvent();
}
private function down(event:MouseEvent):void{
this.gotoAndStop(2);
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.ONCHOOSE, this));
onChoose = true;
}
private function over(event:MouseEvent):void{
if (!onChoose){
this.gotoAndStop(2);
};
}
private function initEvent():void{
this.addEventListener(MouseEvent.MOUSE_OVER, over);
this.addEventListener(MouseEvent.MOUSE_OUT, out);
this.addEventListener(MouseEvent.MOUSE_DOWN, down);
BroadCast.instance.addEventListener(TeddyEvent.ONCHOOSE, onchoose);
}
private function onchoose(event:TeddyEvent):void{
if (((onChoose) && (!((this == event.object))))){
this.gotoAndStop(1);
onChoose = false;
};
}
private function out(event:MouseEvent):void{
if (!onChoose){
this.gotoAndStop(1);
};
}
}
}//package tools
Section 167
//Prop (tools.Prop)
package tools {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
import core.*;
public class Prop extends MovieClip {
private var position:String;
public function Prop(){
super();
this.mouseChildren = false;
this.buttonMode = true;
position = "table";
this.addEventListener(MouseEvent.MOUSE_OVER, over);
this.addEventListener(MouseEvent.MOUSE_DOWN, alphaSet);
BroadCast.instance.addEventListener(TeddyEvent.SHOWPROP, showProp);
}
private function showProp(event:TeddyEvent):void{
this.addEventListener(MouseEvent.MOUSE_OVER, over);
if (event.object.name == this.name){
this.alpha = 1;
this.buttonMode = true;
this.mouseEnabled = true;
position = "table";
};
}
private function over(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.ROLL_ITEM);
}
public function set _position(position:String):void{
this.position = position;
}
public function get _position():String{
return (position);
}
public function removeSound():void{
this.removeEventListener(MouseEvent.MOUSE_OVER, over);
}
private function up(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.ARROW_PRESS);
}
private function alphaSet(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.SELECT_ITEM);
this.removeEventListener(MouseEvent.MOUSE_OVER, over);
if (position == "table"){
this.alpha = 0;
this.buttonMode = false;
this.mouseEnabled = false;
position = "game";
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.PROP, this));
};
}
}
}//package tools
Section 168
//SimpleButton (tools.SimpleButton)
package tools {
import flash.display.*;
import flash.events.*;
import core.*;
public class SimpleButton extends MovieClip {
public function SimpleButton(){
super();
this.buttonMode = true;
this.mouseChildren = false;
this.gotoAndStop(1);
initEvent();
}
private function down(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.MENU_PRESS);
this.gotoAndStop(3);
}
private function initEvent():void{
this.addEventListener(MouseEvent.MOUSE_OVER, over);
this.addEventListener(MouseEvent.MOUSE_OUT, out);
this.addEventListener(MouseEvent.MOUSE_DOWN, down);
this.addEventListener(MouseEvent.MOUSE_UP, up);
}
private function over(event:MouseEvent):void{
SoundConsole.getInstance().playSound(SoundConsole.MENU_ROLL_OVER);
this.gotoAndStop(2);
}
private function up(event:MouseEvent):void{
this.gotoAndStop(2);
}
private function out(event:MouseEvent):void{
this.gotoAndStop(1);
}
}
}//package tools
Section 169
//TagButton (tools.TagButton)
package tools {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
public class TagButton extends MovieClip {
public function TagButton(){
super();
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_DOWN, changeTag);
}
private function changeTag(event:MouseEvent):void{
BroadCast.instance.dispatchEvent(new TeddyEvent(TeddyEvent.CHANGETAG, this));
}
}
}//package tools
Section 170
//Way (tools.Way)
package tools {
import flash.display.*;
import flash.events.*;
import MyEvent.*;
public class Way extends MovieClip {
public function Way(){
super();
this.mouseChildren = false;
this.mouseEnabled = false;
this.stop();
BroadCast.instance.addEventListener(TeddyEvent.BEGIN, playMc);
}
private function playOver(event:Event):void{
if (this.currentFrame == this.totalFrames){
this.removeEventListener(Event.ENTER_FRAME, playOver);
this.parent.removeChild(this);
};
}
private function playMc(event:TeddyEvent):void{
this.play();
BroadCast.instance.removeEventListener(TeddyEvent.BEGIN, playMc);
this.addEventListener(Event.ENTER_FRAME, playOver);
}
}
}//package tools
Section 171
//AbstractEffect (zlong.breathxue.utils.animationEffect.AbstractEffect)
package zlong.breathxue.utils.animationEffect {
import flash.display.*;
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;
breathxue_utils_internal static const VERSION:String = "v1.10.201004261516";
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;
if (this._mc == null){
throw (new ArgumentError("mc can't = null"));
};
}
function checkFinish():Boolean{
return (true);
}
function step():void{
}
function dispatchEvent():void{
}
protected function delMe():void{
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 172
//EffectManager (zlong.breathxue.utils.animationEffect.EffectManager)
package zlong.breathxue.utils.animationEffect {
import flash.display.*;
import flash.events.*;
import zlong.breathxue.utils.animationEffect.*;
class EffectManager {
public var IdCount:uint;
private var _arr:Array;
private var _listenerMc:DisplayObject;
breathxue_utils_internal static const VERSION:String = "v1.10.201004261516";
function EffectManager():void{
super();
this.IdCount = 0;
this._arr = new Array();
}
public function push(effect:AbstractEffect):uint{
this._arr.push(effect);
if (((!(this._listenerMc)) && ((this._arr.length > 0)))){
this._listenerMc = new Sprite();
this._listenerMc.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){
this._listenerMc.removeEventListener(Event.ENTER_FRAME, this.run);
this._listenerMc = null;
};
} 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.splice(i, 1);
if (this._arr.length <= 0){
this._listenerMc.removeEventListener(Event.ENTER_FRAME, this.run);
this._listenerMc = null;
};
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){
this._arr.splice(i, 1);
};
i--;
};
}
public function delAll():void{
this._arr = new Array();
if (this._listenerMc){
this._listenerMc.removeEventListener(Event.ENTER_FRAME, this.run);
this._listenerMc = null;
};
}
public function pauseAll():void{
this._listenerMc.removeEventListener(Event.ENTER_FRAME, this.run);
}
public function reStartAll():void{
this._listenerMc.addEventListener(Event.ENTER_FRAME, this.run);
}
}
}//package zlong.breathxue.utils.animationEffect
Section 173
//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.10.201004261516";
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){
FrameTimer.push(new FrameTimer(_runframe), delMe);
} 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 (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));
}
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 174
//ScaleEffect (zlong.breathxue.utils.animationEffect.ScaleEffect)
package zlong.breathxue.utils.animationEffect {
import flash.display.*;
import flash.events.*;
import zlong.breathxue.utils.math.*;
import zlong.breathxue.utils.*;
public class ScaleEffect extends AbstractEffect {
private var _scale:mVector;
private var _EndScale:mVector;
private var _stepVector:mVector;
breathxue_utils_internal static const VERSION:String = "v1.10.201004261516";
public static const SCALE_EFFECT_FINISH:String = "SCALE_EFFECT_FINISH";
private static var _effectManager:EffectManager = new EffectManager();
public function initSet(id:uint, mc:DisplayObject, StartScale:mVector, EndScale:mVector, stepVector:mVector, runframe:uint=0, isMerge:Boolean=false, sameMcEffect:AbstractEffect=null):void{
super.initAbSet(id, mc, runframe, isMerge);
this._EndScale = EndScale;
this._stepVector = stepVector;
if (((!(stepVector)) && ((runframe == 0)))){
throw (new ArgumentError("one of stepVector or runframe need be setting"));
};
if (((!(this._EndScale)) && (((!(this._stepVector)) || ((_runframe == 0)))))){
throw (new ArgumentError("if EndAlpha == NaN,then stepVector and runframe must be setting"));
};
if (StartScale == null){
StartScale = new mVector(_mc.scaleX, _mc.scaleY);
};
if (((isMerge) && (sameMcEffect))){
this._scale = (sameMcEffect as _slot1)._scale;
} else {
this._scale = new mVector();
_mc.scaleX = (this._scale.x = StartScale.x);
_mc.scaleY = (this._scale.y = StartScale.y);
};
if (!this._EndScale){
FrameTimer.push(new FrameTimer(_runframe), delMe);
} else {
if (_runframe > 0){
this._stepVector = this._EndScale.minus(this._scale);
this._stepVector.multEquals((1 / (_runframe - _stepframe)));
};
};
}
override function step():void{
var sXD:Number;
var sYD:Number;
if (this._EndScale){
if (_runframe > 0){
this._stepVector = this._EndScale.minus(this._scale);
this._stepVector.multEquals((1 / (_runframe - _stepframe)));
_stepframe++;
};
if ((((((this._EndScale.x > this._scale.x)) && ((this._stepVector.x < 0)))) || ((((this._EndScale.x < this._scale.x)) && ((this._stepVector.x > 0)))))){
this._stepVector.x = -(this._stepVector.x);
};
if ((((((this._EndScale.y > this._scale.y)) && ((this._stepVector.y < 0)))) || ((((this._EndScale.y < this._scale.y)) && ((this._stepVector.y > 0)))))){
this._stepVector.y = -(this._stepVector.y);
};
sXD = Math.abs((this._EndScale.x - this._scale.x));
sYD = Math.abs((this._EndScale.y - this._scale.y));
if (sXD > Math.abs(this._stepVector.x)){
_mc.scaleX = (this._scale.x = (this._scale.x + this._stepVector.x));
} else {
_mc.scaleX = (this._scale.x = this._EndScale.x);
};
if (sYD > Math.abs(this._stepVector.y)){
_mc.scaleY = (this._scale.y = (this._scale.y + this._stepVector.y));
} else {
_mc.scaleY = (this._scale.y = this._EndScale.y);
};
} else {
_mc.scaleX = (this._scale.x = (this._scale.x + this._stepVector.x));
_mc.scaleY = (this._scale.y = (this._scale.y + this._stepVector.y));
};
}
override function checkFinish():Boolean{
if (((this._EndScale) && ((((((_runframe > 0)) && ((_stepframe >= _runframe)))) || ((((Math.abs((this._EndScale.x - this._scale.x)) <= Math.abs(this._stepVector.x))) && ((Math.abs((this._EndScale.y - this._scale.y)) <= Math.abs(this._stepVector.y))))))))){
_mc.scaleX = (this._scale.x = this._EndScale.x);
_mc.scaleY = (this._scale.y = this._EndScale.y);
return (true);
};
return (false);
}
override function dispatchEvent():void{
_mc.dispatchEvent(new Event(SCALE_EFFECT_FINISH));
}
public static function push(mc:DisplayObject, StartScale:mVector, EndScale:mVector, stepVector:mVector, runframe:uint=0, isMerge:Boolean=false):uint{
var sameMcEffect:AbstractEffect = _effectManager.findAndDeleteSameMcEffect(mc, isMerge);
var tempScaleEffect:ScaleEffect = new (ScaleEffect);
tempScaleEffect.initSet(_effectManager.IdCount, mc, StartScale, EndScale, stepVector, runframe, isMerge, sameMcEffect);
return (_effectManager.push(tempScaleEffect));
}
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 175
//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.10.201004261516";
private static const TITLE_HEIGHT:int = 20;
private static var _MC:Sprite;
private static var _showMc:Sprite;
private static var _smallMc:Sprite;
private static var _Text:TextField;
private static var _move:Boolean;
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);
};
_MC = new Sprite();
mc.addChild(_MC);
_MC.alpha = 0.5;
_move = false;
createShow(width, height);
createSmall(width);
}
private static function createShow(width:int, height:int):void{
_showMc = new Sprite();
_MC.addChild(_showMc);
_showMc.addChild(maketitle(width));
_showMc.graphics.lineStyle(1, 11187199);
_showMc.graphics.drawRect(0, 0, width, height);
_Text = new TextField();
_Text.x = 0;
_Text.y = TITLE_HEIGHT;
_Text.width = width;
_Text.height = (height - TITLE_HEIGHT);
_showMc.addChild(_Text);
_Text.multiline = true;
_Text.mouseWheelEnabled = true;
_Text.wordWrap = true;
_Text.background = true;
_Text.backgroundColor = 14541311;
_Text.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, 11187199);
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(... _args):void{
var t:int;
if (_MC){
t = _Text.scrollV;
_Text.appendText((((Tools.getNowTimeAndMileSecond_1() + ": ") + _args.join(" ")) + "\n"));
if (_Text.length != _Text.selectionEndIndex){
_Text.scrollV = t;
} else {
_Text.scrollV = _Text.numLines;
};
_MC.parent.setChildIndex(_MC, (_MC.parent.numChildren - 1));
};
}
}
}//package zlong.breathxue.utils.debug
Section 176
//TcShow (zlong.breathxue.utils.debug.TcShow)
package zlong.breathxue.utils.debug {
public var TcShow:Boolean = false;
}//package zlong.breathxue.utils.debug
Section 177
//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.10.201004261516";
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 178
//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.10.201004261516";
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 179
//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.10.201004261516";
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 180
//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 181
//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 _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.10.201004261516";
public static const FRAMETIMER_ALARM:String = "FRAMETIMER_ALARM";
public static const FRAMETIMER_FINISH:String = "FRAMETIMER_FINISH";
private static var IdCount:uint = 0;
private static var _arr:Array = new Array();
private static var _listenerMc:DisplayObject;
public function FrameTimer(runframe:uint, cycleNum:uint=0, Millisecond:uint=0, mc:DisplayObject=null){
super();
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 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 (!_listenerMc){
_listenerMc = new Sprite();
_listenerMc.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._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){
_listenerMc.removeEventListener(Event.ENTER_FRAME, run);
_listenerMc = null;
};
} else {
tempFrameTimer._cycleNum--;
};
} else {
tempFrameTimer._step++;
};
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){
_listenerMc.removeEventListener(Event.ENTER_FRAME, run);
_listenerMc = null;
};
return;
};
i++;
};
}
public static function delAll():void{
_arr = new Array();
if (_listenerMc){
_listenerMc.removeEventListener(Event.ENTER_FRAME, run);
_listenerMc = null;
};
}
public static function pauseAll():void{
_listenerMc.removeEventListener(Event.ENTER_FRAME, run);
}
public static function reStartAll():void{
_listenerMc.addEventListener(Event.ENTER_FRAME, run);
}
}
}//package zlong.breathxue.utils
Section 182
//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.10.201004261516";
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 183
//Item (zlong.breathxue_zelda.PicList.Item)
package zlong.breathxue_zelda.PicList {
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 Item {
private var _mc:Sprite;
private var _list:PicList;
private var _x:Number;
private var _y:Number;
private var scaleEffectId:uint;
private var _name:String;
private var _showId:int;
private var _originalX:Number;
private var _originalY:Number;
private var _picmc:DisplayObject;
public function Item(list:PicList, Pmc:Sprite){
super();
this._name = null;
this._list = list;
this.initDis(Pmc);
this.initEvent();
}
public function del():void{
this._list.dispatchEvent(new ItemEvent(ItemEvent.ITEM_DELETE, this._name, this._showId, this._mc, this._picmc));
this.delEvent();
this.delDis();
}
public function addDis(isGetMcInLib:Boolean, obj):void{
var name:String;
var tempMC:Sprite;
var text:TextField;
var tempArr:Array;
if (isGetMcInLib){
name = String(obj);
this._name = name;
this._picmc = Attach.getDisplayObject(name);
this._mc.name = name;
} else {
tempMC = (obj as Sprite);
this._name = tempMC.name;
this._picmc = tempMC;
this._mc.name = tempMC.name;
};
this._mc.addChild(this._picmc);
this._mc.mouseChildren = false;
this._mc.buttonMode = this._list.itemButtonMode;
this._picmc.scaleX = this._list.itemStaticScaleX;
this._picmc.scaleY = this._list.itemStaticScaleY;
if (this._list.itemAutoSize){
if (this._picmc.width < (this._list.itemWidth * 0.9)){
this._picmc.width = (this._list.itemWidth * 0.9);
this._picmc.scaleY = this._picmc.scaleX;
};
if (this._picmc.height < (this._list.itemHeight * 0.9)){
this._picmc.height = this._list.itemHeight;
this._picmc.scaleX = this._picmc.scaleY;
};
if (this._picmc.width > this._list.itemWidth){
this._picmc.width = this._list.itemWidth;
this._picmc.scaleY = this._picmc.scaleX;
};
if (this._picmc.height > this._list.itemHeight){
this._picmc.height = this._list.itemHeight;
this._picmc.scaleX = this._picmc.scaleY;
};
};
if (PicList.__debug__){
text = new TextField();
text.defaultTextFormat = new TextFormat("_san", null, 0xFFFF00);
tempArr = ((obj is String)) ? obj : obj.name.split("_");
text.x = -30;
text.y = -120;
text.text = ((tempArr[1] + "\n") + tempArr[2]);
this._mc.addChild(text);
};
this._list.dispatchEvent(new ItemEvent(ItemEvent.ITEM_CREATE, this._name, this._showId, this._mc, this._picmc));
}
private function onClickItem(event:MouseEvent):void{
this._list.dispatchEvent(new ItemEvent(ItemEvent.CLICK_ITEM, this._name, this._showId, this._mc, this._picmc));
}
private function onItemRollOut(event:MouseEvent):void{
ScaleEffect.del(this.scaleEffectId);
this.scaleEffectId = ScaleEffect.push(this._mc, new mVector(this._mc.scaleX, this._mc.scaleY), new mVector(1, 1), new mVector(this._list.itemScaleSpeed, this._list.itemScaleSpeed));
this._list.dispatchEvent(new ItemEvent(ItemEvent.ITEM_ROLL_OUT, this._name, this._showId, this._mc, this._picmc));
}
private function onItemRollOver(event:MouseEvent):void{
ScaleEffect.del(this.scaleEffectId);
this.scaleEffectId = ScaleEffect.push(this._mc, new mVector(this._mc.scaleX, this._mc.scaleY), new mVector(this._list.itemScaleValues, this._list.itemScaleValues), new mVector(this._list.itemScaleSpeed, this._list.itemScaleSpeed));
this._list.dispatchEvent(new ItemEvent(ItemEvent.ITEM_ROLL_OVER, this._name, this._showId, this._mc, this._picmc));
}
private function initDis(Pmc:Sprite):void{
var startX:int;
var startY:int;
this._mc = new Sprite();
Pmc.addChild(this._mc);
this._mc.graphics.lineStyle(1, 0xFF, 0);
this._mc.graphics.beginFill(0xFF, 0);
if (PicList.__debug__){
this._mc.graphics.lineStyle(1, 0xFF, 0.5);
this._mc.graphics.beginFill(0xFF, 0.3);
};
if (this._list.itemAlign == 0){
startX = -((this._list.itemWidth / 2));
};
if (this._list.itemAlign < 0){
startX = 0;
};
if (this._list.itemAlign > 0){
startX = -(this._list.itemWidth);
};
if (this._list.itemValign == 0){
startY = -((this._list.itemHeight / 2));
};
if (this._list.itemValign < 0){
startY = 0;
};
if (this._list.itemValign > 0){
startY = -(this._list.itemHeight);
};
this._mc.graphics.moveTo(startX, startY);
this._mc.graphics.lineTo((startX + this._list.itemWidth), startY);
this._mc.graphics.lineTo((startX + this._list.itemWidth), (startY + this._list.itemHeight));
this._mc.graphics.lineTo(startX, (startY + this._list.itemHeight));
this._mc.graphics.lineTo(startX, startY);
this._mc.graphics.endFill();
}
private function initEvent():void{
this._mc.addEventListener(MouseEvent.ROLL_OVER, this.onItemRollOver);
this._mc.addEventListener(MouseEvent.ROLL_OUT, this.onItemRollOut);
this._mc.addEventListener(MouseEvent.CLICK, this.onClickItem);
}
private function delDis():void{
if (this._mc.getChildByName(this._name)){
this._mc.removeChild(this._picmc);
};
this._mc.parent.removeChild(this._mc);
}
private function delEvent():void{
this._mc.removeEventListener(MouseEvent.ROLL_OVER, this.onItemRollOver);
this._mc.removeEventListener(MouseEvent.ROLL_OUT, this.onItemRollOut);
this._mc.removeEventListener(MouseEvent.CLICK, this.onClickItem);
}
function setShowId(id:int):void{
this._showId = id;
}
function extEffectByShowId(targetShowId:int, itemNum:int, runFrame:Number, targetSprite:Sprite, itemSpaceBetweenX:Number, itemSpaceBetweenY:Number, isItemsStoped:Boolean, isErectStyle:Boolean):void{
var rate:Number;
var displacement:Number;
if (this._showId != targetShowId){
rate = (1 - ((Math.abs((this._showId - targetShowId)) / itemNum) * 0.75));
if (this.scaleEffectId != 0){
ScaleEffect.del(this.scaleEffectId);
};
this.scaleEffectId = ScaleEffect.push(this._mc, new mVector(this._mc.scaleX, this._mc.scaleY), new mVector((this._list.itemScaleValues * rate), (this._list.itemScaleValues * rate)), new mVector(this._list.itemScaleSpeed, this._list.itemScaleSpeed), runFrame);
if (isItemsStoped){
this._originalX = this.x;
this._originalY = this.y;
if (isErectStyle){
displacement = ((itemSpaceBetweenY * Math.pow(0.95, Math.abs((this.showId - targetShowId)))) * 2);
trace(displacement);
if (this.showId < targetShowId){
this.y = (this.y - displacement);
} else {
this.y = (this.y + displacement);
};
} else {
displacement = ((itemSpaceBetweenX * Math.pow(0.95, Math.abs((this.showId - targetShowId)))) * 2);
trace(displacement);
if (this.showId < targetShowId){
this.x = (this.x - displacement);
} else {
this.x = (this.x + displacement);
};
};
};
};
}
function resumeFromExtEffect(targetShowId:int, runframe:Number, isItemsStoped:Boolean):void{
if (this._showId != targetShowId){
if (this.scaleEffectId != 0){
ScaleEffect.del(this.scaleEffectId);
};
this.scaleEffectId = ScaleEffect.push(this._mc, new mVector(this._mc.scaleX, this._mc.scaleY), new mVector(1, 1), new mVector(this._list.itemScaleSpeed, this._list.itemScaleSpeed), runframe);
if (((isItemsStoped) && (((Number(this._originalX)) || (Number(this._originalY)))))){
this.x = this._originalX;
this.y = this._originalY;
};
};
}
public function set leftX(num:Number):void{
if (this._list.itemAlign == 0){
this.x = (num + (this._list.itemWidth / 2));
};
if (this._list.itemAlign < 0){
this.x = num;
};
if (this._list.itemAlign > 0){
this.x = (num + this._list.itemWidth);
};
}
public function get leftX():Number{
if (this._list.itemAlign == 0){
return ((this.x - (this._list.itemWidth / 2)));
};
if (this._list.itemAlign < 0){
return (this.x);
};
if (this._list.itemAlign > 0){
return ((this.x - this._list.itemWidth));
};
return (NaN);
}
public function set rightX(num:Number):void{
if (this._list.itemAlign == 0){
this.x = (num - (this._list.itemWidth / 2));
};
if (this._list.itemAlign < 0){
this.x = (num - this._list.itemWidth);
};
if (this._list.itemAlign > 0){
this.x = num;
};
}
public function get rightX():Number{
if (this._list.itemAlign == 0){
return ((this.x + (this._list.itemWidth / 2)));
};
if (this._list.itemAlign < 0){
return ((this.x + this._list.itemWidth));
};
if (this._list.itemAlign > 0){
return (this.x);
};
return (NaN);
}
public function set topY(num:Number):void{
if (this._list.itemAlign == 0){
this.y = (num + (this._list.itemHeight / 2));
};
if (this._list.itemAlign < 0){
this.y = num;
};
if (this._list.itemAlign > 0){
this.y = (num + this._list.itemHeight);
};
}
public function get topY():Number{
if (this._list.itemAlign == 0){
return ((this.y - (this._list.itemHeight / 2)));
};
if (this._list.itemAlign < 0){
return (this.y);
};
if (this._list.itemAlign > 0){
return ((this.y - this._list.itemHeight));
};
return (NaN);
}
public function set bottomY(num:Number):void{
if (this._list.itemAlign == 0){
this.y = (num - (this._list.itemHeight / 2));
};
if (this._list.itemAlign < 0){
this.y = (num - this._list.itemHeight);
};
if (this._list.itemAlign > 0){
this.y = num;
};
}
public function get bottomY():Number{
if (this._list.itemAlign == 0){
return ((this.y + (this._list.itemHeight / 2)));
};
if (this._list.itemAlign < 0){
return ((this.y + this._list.itemHeight));
};
if (this._list.itemAlign > 0){
return (this.y);
};
return (NaN);
}
public function set x(num:Number):void{
this._mc.x = (this._x = num);
}
public function get x():Number{
return (this._x);
}
public function set y(num:Number):void{
this._mc.y = (this._y = num);
}
public function get y():Number{
return (this._y);
}
public function get name():String{
return (this._name);
}
public function set name(v:String):void{
this._name = v;
}
public function get showId():int{
return (this._showId);
}
}
}//package zlong.breathxue_zelda.PicList
Section 184
//ItemEvent (zlong.breathxue_zelda.PicList.ItemEvent)
package zlong.breathxue_zelda.PicList {
import flash.display.*;
import flash.events.*;
public class ItemEvent extends Event {
private var _itemName:String;
private var _item:Sprite;
private var _pic:DisplayObject;
private var _showId:int;
public static const CLICK_ITEM:String = "click_item";
public static const ITEM_CREATE:String = "item_create";
public static const ITEM_DELETE:String = "item_delete";
public static const ITEM_ROLL_OVER:String = "item_roll_over";
public static const ITEM_ROLL_OUT:String = "item_roll_out";
public function ItemEvent(type:String, itemName:String, showId:int, item:Sprite=null, pic:DisplayObject=null){
super(type);
this._itemName = itemName;
this._item = item;
this._pic = pic;
this._showId = showId;
}
public function get itemName():String{
return (this._itemName);
}
public function get item():Sprite{
return (this._item);
}
public function get pic():DisplayObject{
return (this._pic);
}
public function get showId():int{
return (this._showId);
}
}
}//package zlong.breathxue_zelda.PicList
Section 185
//PicList (zlong.breathxue_zelda.PicList.PicList)
package zlong.breathxue_zelda.PicList {
import flash.display.*;
import flash.events.*;
public class PicList extends EventDispatcher {
private var _name:String;
private var _pmc:Sprite;
private var _maskMc:Sprite;
private var _beMaskMc:Sprite;
private var _mc:Sprite;
private var _picArr:Array;
private var _width:Number;
private var _maskWidth:Number;
private var _maskHeight:Number;
private var _height:Number;
private var _x:Number;
private var _y:Number;
private var _itemWidth:Number;
private var _itemHeight:Number;
private var _itemAlign:int;
private var _itemValign:int;
private var _itemSpaceBetweenX:Number;
private var _itemSpaceBetweenY:Number;
private var _itemScaleSpeed:Number;
private var _itemScaleValues:Number;
private var _itemAutoSize:Boolean;
private var _itemStaticScaleX:Number;
private var _itemStaticScaleY:Number;
private var _itemButtonMode:Boolean;
private var _isItemsStoped:Boolean;
private var _isErectStyle:Boolean;
private var _isGetMcInLib:Boolean;
private var _isCircular:Boolean;
private var _isExtEffect:Boolean;
private var _isConsecuEffect:Boolean;
private var _conEffTargetShowId:int;
private var _itemNum:int;
private var _showItemArr:Array;
private var _firstHand:int;
private var _endHand:int;
private var _circleIndex:int;
private var _running:Boolean;
private var _highSpeed:Number;
private var _isAddSpeed:Boolean;
private var _addSpeed:Number;
private var _speed:Number;
private var _moveItemNum:int;
private var _autoAdjust:int;
public static var __debug__:Boolean = true;
public function PicList(pmc:Sprite, picArr:Array=null, isErectStyle:Boolean=false, isGetMcInLib:Boolean=true){
super();
this._running = false;
this._pmc = pmc;
this._picArr = picArr;
this._isErectStyle = isErectStyle;
this._isGetMcInLib = isGetMcInLib;
if (this._picArr == null){
this._picArr = new Array();
};
this._width = 350;
this._maskWidth = 400;
this._height = 100;
this._maskHeight = 120;
this._x = 0;
this._y = 0;
this._itemWidth = 50;
this._itemHeight = 50;
this._itemAlign = 0;
this._itemValign = 0;
this._itemSpaceBetweenX = 15;
this._itemSpaceBetweenY = 10;
this._itemStaticScaleX = 1;
this._itemStaticScaleY = 1;
this._itemScaleSpeed = 0.2;
this._itemScaleValues = 2;
this._itemButtonMode = true;
this._itemAutoSize = false;
this._highSpeed = 10;
this._isAddSpeed = true;
this._addSpeed = 1;
this._isItemsStoped = true;
this._isExtEffect = false;
this._isCircular = true;
this._isConsecuEffect = false;
this._conEffTargetShowId = 100;
this.initialzation();
}
public function del():void{
this._picArr = null;
this._running = false;
this.delItem();
this.delDis();
this.removeEvent();
}
public function setPicClassNameArray(arr:Array):void{
this._picArr = arr;
}
public function reset():void{
this._running = false;
this.delItem();
this.delDis();
this.removeEvent();
this.initialzation();
}
public function run():void{
if (this._running){
this.autoMove();
this.runMove();
this.checkFirstItem();
this.checkEndItem();
this.resortShowId();
};
}
public function forward():void{
this._isItemsStoped = false;
if (this._running){
if (this._isAddSpeed){
if (Math.abs(this._speed) < this._highSpeed){
this._speed = (this._speed - this._addSpeed);
};
} else {
this._speed = -(this._highSpeed);
};
};
}
public function back():void{
this._isItemsStoped = false;
if (this._running){
if (this._isAddSpeed){
if (Math.abs(this._speed) < this._highSpeed){
this._speed = (this._speed + this._addSpeed);
};
} else {
this._speed = this._highSpeed;
};
};
}
public function nextItem(num:int=1):void{
var temp:int;
this._isItemsStoped = false;
if (this._running){
if (this._moveItemNum < 0){
temp = (this._moveItemNum % num);
this._moveItemNum = temp;
};
if (!this._isCircular){
if (this._endHand < ((this._picArr.length - 1) - this._moveItemNum)){
this._moveItemNum = (this._moveItemNum + num);
} else {
if (this._endHand == (this._picArr.length - 1)){
return;
};
this._moveItemNum = ((this._picArr.length - 1) - this._endHand);
};
} else {
this._moveItemNum = (this._moveItemNum + num);
};
};
}
public function prevItem(num:int=1):void{
var temp:int;
this._isItemsStoped = false;
if (this._running){
if (this._moveItemNum > 0){
temp = (this._moveItemNum % num);
this._moveItemNum = temp;
};
if (!this._isCircular){
if (this._firstHand > -(this._moveItemNum)){
this._moveItemNum = (this._moveItemNum - num);
} else {
if (this._firstHand == 0){
return;
};
this._moveItemNum = -(this._firstHand);
};
} else {
this._moveItemNum = (this._moveItemNum - num);
};
};
}
private function initialzation():void{
this._firstHand = 0;
this._showItemArr = new Array();
this._speed = 0;
this._moveItemNum = 0;
this._circleIndex;
this.initDis();
this.initItem();
this.initEvent();
}
private function initDis():void{
this._mc = new Sprite();
this._maskMc = new Sprite();
this._beMaskMc = new Sprite();
this._mc.x = this._x;
this._mc.y = this._y;
this._pmc.addChild(this._mc);
this._mc.addChild(this._beMaskMc);
this._maskMc.graphics.beginFill(0);
this._maskMc.graphics.moveTo(((this._maskWidth / 2) * -1), ((this._maskHeight / 2) * -1));
this._maskMc.graphics.lineTo((this._maskWidth / 2), ((this._maskHeight / 2) * -1));
this._maskMc.graphics.lineTo((this._maskWidth / 2), (this._maskHeight / 2));
this._maskMc.graphics.lineTo(((this._maskWidth / 2) * -1), (this._maskHeight / 2));
this._maskMc.graphics.lineTo(((this._maskWidth / 2) * -1), ((this._maskHeight / 2) * -1));
this._maskMc.graphics.endFill();
this._mc.addChild(this._maskMc);
this._beMaskMc.mask = this._maskMc;
if (__debug__){
this._beMaskMc.graphics.lineStyle(1, 0, 0.5);
this._beMaskMc.graphics.beginFill(0, 0.3);
this._beMaskMc.graphics.moveTo(((this._maskWidth / 2) * -1), ((this._maskHeight / 2) * -1));
this._beMaskMc.graphics.lineTo((this._maskWidth / 2), ((this._maskHeight / 2) * -1));
this._beMaskMc.graphics.lineTo((this._maskWidth / 2), (this._maskHeight / 2));
this._beMaskMc.graphics.lineTo(((this._maskWidth / 2) * -1), (this._maskHeight / 2));
this._beMaskMc.graphics.lineTo(((this._maskWidth / 2) * -1), ((this._maskHeight / 2) * -1));
this._beMaskMc.graphics.endFill();
};
}
private function delDis():void{
this._maskMc.graphics.clear();
this._mc.removeChild(this._maskMc);
this._mc.removeChild(this._beMaskMc);
this._pmc.removeChild(this._mc);
this._maskMc = null;
this._beMaskMc = null;
this._mc = null;
}
private function initItem():void{
var tempYu:Number;
var itemSpace:Number;
var startX:int;
var startY:int;
if ((((this._picArr == null)) || ((this._picArr.length == 0)))){
return;
};
if (this._isErectStyle){
this._itemNum = int((this._height / (this._itemHeight + this._itemSpaceBetweenY)));
tempYu = (this._height % (this._itemHeight + this._itemSpaceBetweenY));
itemSpace = this._itemSpaceBetweenY;
} else {
this._itemNum = int((this._width / (this._itemWidth + this._itemSpaceBetweenX)));
tempYu = (this._width % (this._itemWidth + this._itemSpaceBetweenX));
itemSpace = this._itemSpaceBetweenX;
};
if (tempYu > itemSpace){
this._itemNum = (this._itemNum + 1);
};
var tempItem:Item = new Item(this, this._beMaskMc);
if (this._isErectStyle){
startX = 0;
tempItem.x = startX;
startY = (-(this._height) / 2);
tempItem.topY = startY;
if (this._itemValign < 0){
startX = (-(this._width) / 2);
tempItem.leftX = startX;
} else {
if (this._itemValign > 0){
startX = (this._width / 2);
tempItem.rightX = startX;
};
};
} else {
startX = (-(this._width) / 2);
tempItem.leftX = startX;
startY = 0;
tempItem.y = startY;
if (this._itemValign < 0){
startY = (-(this._height) / 2);
tempItem.topY = startY;
} else {
if (this._itemValign > 0){
startY = (this._height / 2);
tempItem.bottomY = startY;
};
};
};
this._endHand = 0;
tempItem.addDis(this._isGetMcInLib, this._picArr[this._endHand]);
this._showItemArr.push(tempItem);
var i = 1;
while (i < this._itemNum) {
this.createNextItem();
i++;
};
this.resortShowId();
this._running = true;
}
private function delItem():void{
var i = 1;
while (i < this._showItemArr.length) {
this._showItemArr[i].del();
i++;
};
this._showItemArr = null;
}
private function initEvent():void{
if (this._isExtEffect){
this.addEventListener(ItemEvent.ITEM_ROLL_OVER, this.ExtEffect);
this.addEventListener(ItemEvent.ITEM_ROLL_OUT, this.resumeFromExtEffect);
};
if (this._isConsecuEffect){
this.addEventListener(ItemEvent.ITEM_ROLL_OVER, this.recieveConEffTargetShowId);
this.addEventListener(MouseEvent.ROLL_OVER, this.consecuEffect);
this.addEventListener(MouseEvent.ROLL_OUT, this.resumeFromConsecuEffect);
};
}
private function removeEvent():void{
this.removeEventListener(ItemEvent.ITEM_ROLL_OVER, this.ExtEffect);
this.removeEventListener(ItemEvent.ITEM_ROLL_OUT, this.resumeFromExtEffect);
this.removeEventListener(ItemEvent.ITEM_ROLL_OVER, this.recieveConEffTargetShowId);
this.removeEventListener(MouseEvent.ROLL_OVER, this.consecuEffect);
this.removeEventListener(MouseEvent.ROLL_OUT, this.resumeFromConsecuEffect);
}
private function ExtEffect(e:ItemEvent):void{
var flag:Boolean;
var runFrame:Number = (Math.abs((this._itemScaleValues - e.item.scaleX)) / this._itemScaleSpeed);
var m = 1;
var n = 1;
if (e.showId < int(((this._itemNum - 1) / 2))){
flag = true;
} else {
flag = false;
};
var i:int;
while (i < (this._itemNum - 1)) {
if (m == (this._itemNum - e.showId)){
flag = false;
};
if (n == (e.showId + 1)){
flag = true;
};
if (flag){
while (m < (this._itemNum - e.showId)) {
flag = !(flag);
if (this._showItemArr[(e.showId + m)] != null){
(this._showItemArr[(e.showId + m)] as Item).extEffectByShowId(e.showId, this._itemNum, runFrame, e.item, this._itemSpaceBetweenX, this._itemSpaceBetweenY, this._isItemsStoped, this._isErectStyle);
};
m = (m + 1);
break;
};
} else {
while (n <= e.showId) {
flag = !(flag);
if (this._showItemArr[(e.showId - n)] != null){
(this._showItemArr[(e.showId - n)] as Item).extEffectByShowId(e.showId, this._itemNum, runFrame, e.item, this._itemSpaceBetweenX, this._itemSpaceBetweenY, this._isItemsStoped, this._isErectStyle);
};
n = (n + 1);
break;
};
};
i++;
};
}
private function resumeFromExtEffect(e:ItemEvent):void{
var flag:Boolean;
var runFrame:Number = (Math.abs((1 - e.item.scaleX)) / this._itemScaleSpeed);
var m = 1;
var n = 1;
if (e.showId < int(((this._itemNum - 1) / 2))){
flag = true;
} else {
flag = false;
};
var i:int;
while (i < (this._itemNum - 1)) {
if (m == (this._itemNum - e.showId)){
flag = false;
};
if (n == (e.showId + 1)){
flag = true;
};
if (flag){
while (m < (this._itemNum - e.showId)) {
flag = !(flag);
if (this._showItemArr[(e.showId + m)] != null){
(this._showItemArr[(e.showId + m)] as Item).resumeFromExtEffect(e.showId, runFrame, this._isItemsStoped);
};
m = (m + 1);
break;
};
} else {
while (n <= e.showId) {
flag = !(flag);
if (this._showItemArr[(e.showId - n)] != null){
(this._showItemArr[(e.showId - n)] as Item).resumeFromExtEffect(e.showId, runFrame, this._isItemsStoped);
};
n = (n + 1);
break;
};
};
i++;
};
}
private function recieveConEffTargetShowId(e:ItemEvent):void{
this._conEffTargetShowId = e.showId;
}
private function consecuEffect(e:MouseEvent):void{
}
private function resumeFromConsecuEffect(e:MouseEvent):void{
}
private function runMove():void{
var tempItem:Item;
var i:int;
while (i < this._showItemArr.length) {
tempItem = this._showItemArr[i];
if (this._isErectStyle){
tempItem.y = (tempItem.y + this._speed);
} else {
tempItem.x = (tempItem.x + this._speed);
};
i++;
};
if (this._isAddSpeed){
if (this._speed > (this._addSpeed / 2)){
this._speed = (this._speed - (this._addSpeed / 2));
} else {
if (this._speed < (-(this._addSpeed) / 2)){
this._speed = (this._speed + (this._addSpeed / 2));
} else {
this._speed = 0;
};
};
} else {
this._speed = 0;
};
}
private function autoMove():void{
var lessSpeedLength1:Number;
var targetItemTopY:Number;
var targetItemLeftX:Number;
var lessSpeedLength2:Number;
var targetItemBottomY:Number;
var targetItemRightX:Number;
var tempItem3:Item;
var tempItem4:Item;
if (this._moveItemNum > 0){
lessSpeedLength1 = ((((Math.abs(this._speed) + (this._addSpeed / 2)) * Math.abs(this._speed)) / this._addSpeed) + Math.abs(this._speed));
if (this._isErectStyle){
targetItemTopY = (this._showItemArr[0].topY + (this._moveItemNum * (this._itemHeight + this._itemSpaceBetweenY)));
if (Math.abs((targetItemTopY - (-(this._height) / 2))) > lessSpeedLength1){
this.forward();
};
} else {
targetItemLeftX = (this._showItemArr[0].leftX + (this._moveItemNum * (this._itemWidth + this._itemSpaceBetweenX)));
if (Math.abs((targetItemLeftX - (-(this._width) / 2))) > lessSpeedLength1){
this.forward();
};
};
this._autoAdjust = 1;
} else {
if (this._moveItemNum < 0){
lessSpeedLength2 = ((((Math.abs(this._speed) + (this._addSpeed / 2)) * Math.abs(this._speed)) / this._addSpeed) + Math.abs(this._speed));
if (this._isErectStyle){
targetItemBottomY = (this._showItemArr[(this._showItemArr.length - 1)].bottomY + (this._moveItemNum * (this._itemHeight + this._itemSpaceBetweenY)));
if (Math.abs(((this._height / 2) - targetItemBottomY)) > lessSpeedLength2){
this.back();
};
} else {
targetItemRightX = (this._showItemArr[(this._showItemArr.length - 1)].rightX + (this._moveItemNum * (this._itemWidth + this._itemSpaceBetweenX)));
if (Math.abs(((this._width / 2) - targetItemRightX)) > lessSpeedLength2){
this.back();
};
};
this._autoAdjust = -1;
} else {
if (this._autoAdjust > 0){
tempItem3 = this._showItemArr[0];
if (((this._isErectStyle) && ((Math.abs((tempItem3.topY - (-(this._height) / 2))) > (this._addSpeed / 2))))){
this._speed = (this._speed + ((tempItem3.topY < (-(this._height) / 2))) ? (this._addSpeed / 2) : (-(this._addSpeed) / 2));
} else {
if (((!(this._isErectStyle)) && ((Math.abs((tempItem3.leftX - (-(this._width) / 2))) > (this._addSpeed / 2))))){
this._speed = (this._speed + ((tempItem3.leftX < (-(this._width) / 2))) ? (this._addSpeed / 2) : (-(this._addSpeed) / 2));
} else {
if (this._speed == 0){
this._autoAdjust = 0;
this._isItemsStoped = true;
};
};
};
} else {
if (this._autoAdjust < 0){
tempItem4 = this._showItemArr[(this._showItemArr.length - 1)];
if (((this._isErectStyle) && ((Math.abs((tempItem4.bottomY - (this._height / 2))) > (this._addSpeed / 2))))){
this._speed = (this._speed + ((tempItem4.bottomY < (this._height / 2))) ? (this._addSpeed / 2) : (-(this._addSpeed) / 2));
} else {
if (((!(this._isErectStyle)) && ((Math.abs((tempItem4.rightX - (this._width / 2))) > (this._addSpeed / 2))))){
this._speed = (this._speed + ((tempItem4.rightX < (this._width / 2))) ? (this._addSpeed / 2) : (-(this._addSpeed) / 2));
} else {
if (this._speed == 0){
this._autoAdjust = 0;
this._isItemsStoped = true;
};
};
};
};
};
};
};
}
private function createNextItem():void{
this._endHand++;
if (this._endHand >= this._picArr.length){
this._endHand = 0;
};
var lastItem:Item = this._showItemArr[(this._showItemArr.length - 1)];
var tempItem:Item = new Item(this, this._beMaskMc);
if (this._isErectStyle){
tempItem.x = lastItem.x;
tempItem.y = ((lastItem.y + this._itemHeight) + this._itemSpaceBetweenY);
} else {
tempItem.x = ((lastItem.x + this._itemWidth) + this._itemSpaceBetweenX);
tempItem.y = lastItem.y;
};
tempItem.addDis(this._isGetMcInLib, this._picArr[this._endHand]);
this._showItemArr.push(tempItem);
}
private function createPrevItem():void{
this._firstHand--;
if (this._firstHand < 0){
this._firstHand = (this._picArr.length - 1);
};
var firstItem:Item = this._showItemArr[0];
var tempItem:Item = new Item(this, this._beMaskMc);
if (this._isErectStyle){
tempItem.x = firstItem.x;
tempItem.y = ((firstItem.y - this._itemHeight) - this._itemSpaceBetweenY);
} else {
tempItem.x = ((firstItem.x - this._itemWidth) - this._itemSpaceBetweenX);
tempItem.y = firstItem.y;
};
tempItem.addDis(this._isGetMcInLib, this._picArr[this._firstHand]);
this._showItemArr.unshift(tempItem);
}
private function removePrevItem():void{
this._firstHand++;
if (this._firstHand >= this._picArr.length){
this._firstHand = 0;
};
var tempItem:Item = this._showItemArr.shift();
tempItem.del();
if (this._moveItemNum > 0){
this._moveItemNum--;
};
}
private function removeNextItem():void{
this._endHand--;
if (this._endHand < 0){
this._endHand = (this._picArr.length - 1);
};
var tempItem:Item = this._showItemArr.pop();
tempItem.del();
if (this._moveItemNum < 0){
this._moveItemNum++;
};
}
private function checkEndItem():void{
if (this._isErectStyle){
if ((this._showItemArr[0].topY - this._itemSpaceBetweenY) > -((this._height / 2))){
this.createPrevItem();
};
if (this._showItemArr[0].bottomY < -((this._height / 2))){
this.removePrevItem();
};
} else {
if ((this._showItemArr[0].leftX - this._itemSpaceBetweenX) > -((this._width / 2))){
this.createPrevItem();
};
if (this._showItemArr[0].rightX < -((this._width / 2))){
this.removePrevItem();
};
};
}
private function checkFirstItem():void{
if (this._isErectStyle){
if ((this._showItemArr[(this._showItemArr.length - 1)].bottomY + this._itemSpaceBetweenY) < (this._height / 2)){
this.createNextItem();
};
if (this._showItemArr[(this._showItemArr.length - 1)].topY > (this._height / 2)){
this.removeNextItem();
};
} else {
if ((this._showItemArr[(this._showItemArr.length - 1)].rightX + this._itemSpaceBetweenX) < (this._width / 2)){
this.createNextItem();
};
if (this._showItemArr[(this._showItemArr.length - 1)].leftX > (this._width / 2)){
this.removeNextItem();
};
};
}
private function resortShowId():void{
var i:int;
while (i < this._itemNum) {
if (this._showItemArr[i] != null){
this._showItemArr[i].setShowId(i);
};
i++;
};
}
public function get showItemArr():Array{
return (this._showItemArr);
}
public function set x(num:Number):void{
this._mc.x = (this._x = num);
}
public function get x():Number{
return (this._x);
}
public function set y(num:Number):void{
this._mc.y = (this._y = num);
}
public function get y():Number{
return (this._y);
}
public function set width(num:Number):void{
this._width = num;
}
public function get width():Number{
return (this._width);
}
public function set height(num:Number):void{
this._height = num;
}
public function get height():Number{
return (this._height);
}
public function set itemWidth(num:Number):void{
this._itemWidth = num;
}
public function get itemWidth():Number{
return (this._itemWidth);
}
public function set itemHeight(num:Number):void{
this._itemHeight = num;
}
public function get itemHeight():Number{
return (this._itemHeight);
}
public function set itemSpaceBetweenX(num:Number):void{
this._itemSpaceBetweenX = num;
}
public function get itemSpaceBetweenX():Number{
return (this._itemSpaceBetweenX);
}
public function set itemSpaceBetweenY(num:Number):void{
this._itemSpaceBetweenY = num;
}
public function get itemSpaceBetweenY():Number{
return (this._itemSpaceBetweenY);
}
public function set itemAlign(num:int):void{
this._itemAlign = num;
}
public function get itemAlign():int{
return (this._itemAlign);
}
public function set itemValign(num:int):void{
this._itemValign = num;
}
public function get itemValign():int{
return (this._itemValign);
}
public function set speed(num:Number):void{
this._highSpeed = num;
}
public function get speed():Number{
return (this._highSpeed);
}
public function set addSpeed(num:Number):void{
this._addSpeed = num;
}
public function get addSpeed():Number{
return (this._addSpeed);
}
public function set isAddSpeed(b:Boolean):void{
this._isAddSpeed = b;
}
public function get isAddSpeed():Boolean{
return (this._isAddSpeed);
}
public function get itemScaleSpeed():Number{
return (this._itemScaleSpeed);
}
public function set itemScaleSpeed(v:Number):void{
this._itemScaleSpeed = v;
}
public function get itemScaleValues():Number{
return (this._itemScaleValues);
}
public function set itemScaleValues(v:Number):void{
this._itemScaleValues = v;
}
public function get maskWidth():Number{
return (this._maskWidth);
}
public function set maskWidth(v:Number):void{
this._maskWidth = v;
}
public function get maskHeight():Number{
return (this._maskHeight);
}
public function set maskHeight(v:Number):void{
this._maskHeight = v;
}
public function get itemAutoSize():Boolean{
return (this._itemAutoSize);
}
public function set itemAutoSize(v:Boolean):void{
this._itemAutoSize = v;
}
public function get itemStaticScaleX():Number{
return (this._itemStaticScaleX);
}
public function set itemStaticScaleX(v:Number):void{
this._itemStaticScaleX = v;
}
public function get itemStaticScaleY():Number{
return (this._itemStaticScaleY);
}
public function set itemStaticScaleY(v:Number):void{
this._itemStaticScaleY = v;
}
public function get itemButtonMode():Boolean{
return (this._itemButtonMode);
}
public function set itemButtonMode(v:Boolean):void{
this._itemButtonMode = v;
}
public function set isErectStyle(v:Boolean):void{
this._isErectStyle = v;
}
public function get isErectStyle():Boolean{
return (this._isErectStyle);
}
public function set isGetMcInLib(v:Boolean):void{
this._isGetMcInLib = v;
}
public function get isGetMcInLib():Boolean{
return (this._isGetMcInLib);
}
public function set isCircular(v:Boolean):void{
this._isCircular = v;
}
public function get isCircular():Boolean{
return (this._isCircular);
}
public function set isExtEffect(v:Boolean):void{
this._isExtEffect = v;
}
public function get isExtEffect():Boolean{
return (this._isExtEffect);
}
public function get mc():Sprite{
return (this._mc);
}
public function set name(v:String):void{
this._name = v;
this.showItemArr;
}
public function get name():String{
return (this._name);
}
}
}//package zlong.breathxue_zelda.PicList
Section 186
//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.01.201004281148";
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 187
//CountriesData (zlong.country.CountriesData)
package zlong.country {
import zlong.*;
class CountriesData {
localComponent_internal static const VERSION:String = "v1.04.201006181400";
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 188
//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.201006181400";
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 189
//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.01.201004281148";
}
}//package zlong.country
Section 190
//CountryCookie (zlong.data.CountryCookie)
package zlong.data {
import flash.net.*;
import zlong.*;
public class CountryCookie {
localComponent_internal static const VERSION:String = "v1.01.201004281148";
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 191
//GameInfo (zlong.data.GameInfo)
package zlong.data {
import zlong.*;
public class GameInfo {
localComponent_internal static const VERSION:String = "v1.01.201004281148";
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 192
//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.01.201004281148";
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 193
//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.01.201004281148";
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 194
//BindingDisplayManager (zlong.display.BindingDisplayManager)
package zlong.display {
import flash.events.*;
public class BindingDisplayManager extends EventDispatcher {
localComponent_internal static const VERSION:String = "v1.01.201004281148";
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 195
//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.01.201004281148";
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 196
//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.201006181400";
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 197
//Dispatcher (zlong.display.Dispatcher)
package zlong.display {
import flash.events.*;
import zlong.*;
class Dispatcher {
localComponent_internal static const VERSION:String = "v1.01.201004281148";
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 198
//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.01.201004281148";
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 199
//HyvesLoading (zlong.display.HyvesLoading)
package zlong.display {
import flash.display.*;
import zlong.country.*;
import zlong.*;
public class HyvesLoading extends Sprite {
public function HyvesLoading(){
super();
if (CountryInfo.instance.portal != GameSetting.PORTAL_TYPE_HYVES){
this.visible = false;
};
}
}
}//package zlong.display
Section 200
//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.01.201004281148";
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 201
//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.01.201004281148";
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 202
//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.01.201004281148";
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 203
//DomainData (zlong.domain.DomainData)
package zlong.domain {
import zlong.*;
final class DomainData {
localComponent_internal static const VERSION:String = "v1.01.201004281148";
static const allowedDomain:Array = ["www8.agame.com", "www.zlonggamestest.com", "gamedev.dev.spilgames.com"];
}
}//package zlong.domain
Section 204
//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.01.201004281148";
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 205
//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.01.201004281148";
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");
}
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");
}
}
}//package zlong.navigate
Section 206
//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.201006181400";
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 207
//SiteData (zlong.site.SiteData)
package zlong.site {
import zlong.*;
public final class SiteData {
localComponent_internal static const VERSION:String = "v1.04.201006181400";
public static const URL:String = "http://www8.agame.com/games/sitelock/sites.xml";
public static var allowedSite:XML;
}
}//package zlong.site
Section 208
//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.201006181400";
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 209
//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 {
private var _spilGamesServices:SpilGamesServices;
private var _debug:Boolean;
private var _mc:DisplayObjectContainer;
framework_internal static const VERSION:String = "v1.10t2.201006211630";
public static const AWORD_HIGHSCORE_TOOL_INITIALIZED_COMPONENT:String = "AWORD_HIGHSCORE_TOOL_INITIALIZED_COMPONENT";
public static const AWORD_HIGHSCORE_TOOL_INITIALIZED_FAILED:String = "AWORD_HIGHSCORE_TOOL_INITIALIZED_FAILED";
static var _instance:Award_HighScore;
private static var _initialized_finish:Boolean = true;
public function Award_HighScore(){
super();
_initialized_finish = false;
this._spilGamesServices = SpilGamesServices.getInstance();
this._spilGamesServices.addEventListener("servicesReady", this.onServicesReady);
this._spilGamesServices.addEventListener("servicesFailed", this.onServicesFailed);
}
public function init(gameName:String, container:DisplayObjectContainer, debug:Boolean=false, isLive:Boolean=true):void{
this._debug = debug;
this._mc = container;
if (container.stage == null){
throw (new ArgumentError("container need be added in stage"));
};
if (this._spilGamesServices){
this._spilGamesServices.connect(container);
};
}
public function isAwardsServiceAvailable():Boolean{
return (AwardsService.isAvailable());
}
public function isScoreServiceAvailable():Boolean{
return (ScoreService.isAvailable());
}
private function onServicesReady(event:Event):void{
this._spilGamesServices.addEventListener("servicesReady", this.onServicesReady);
this._spilGamesServices.addEventListener("servicesFailed", this.onServicesFailed);
if (this._debug){
Trace(("Award_HighScore_Tool_Initialized_Component" + event));
if (this._mc){
this._mc.stage.addEventListener(KeyboardEvent.KEY_DOWN, this.keyBoardSendAwards);
};
};
this.dispatchEvent(new Event(AWORD_HIGHSCORE_TOOL_INITIALIZED_COMPONENT));
_initialized_finish = true;
}
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)));
};
}
private function onServicesFailed(event:ErrorEvent):void{
this._spilGamesServices.addEventListener("servicesReady", this.onServicesReady);
this._spilGamesServices.addEventListener("servicesFailed", this.onServicesFailed);
if (this._debug){
Trace(("Award_HighScore_Tool_Initialized_Failed" + event.text));
};
this.dispatchEvent(new Event(AWORD_HIGHSCORE_TOOL_INITIALIZED_FAILED));
_initialized_finish = true;
this._spilGamesServices = null;
}
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 (this._spilGamesServices){
if (ScoreService.isAvailable()){
ScoreService.submitScore(score);
} else {
Trace("No...isAvailable");
};
};
}
public function submitAchievement(achievement):void{
if (this._spilGamesServices){
if (AwardsService.isAvailable()){
AwardsService.submitAward(achievement);
} else {
Trace("No...isAvailable");
};
};
}
public function isComponentInitialized():Boolean{
return (false);
}
public function isDomainAllowed():Boolean{
return (((AwardsService.isAvailable()) && (ScoreService.isAvailable())));
}
public function destroy():void{
}
public function dispatchEvent(event:Event):Boolean{
return (false);
}
public function hasEventListener(type:String):Boolean{
return (false);
}
public function willTrigger(type:String):Boolean{
return (false);
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
}
public static function get instance():Award_HighScore{
if (_instance == null){
_instance = new (Award_HighScore);
};
return (_instance);
}
public static function get initializedFinish():Boolean{
return (_initialized_finish);
}
}
}//package zlong.spilSystemTool
Section 210
//GamatarSender (zlong.spilSystemTool.GamatarSender)
package zlong.spilSystemTool {
import flash.display.*;
import flash.events.*;
import com.spilgames.api.*;
public class GamatarSender {
private var _gamatarid:String;
private var _gamatartype:String;
private var _eventDispatcher:EventDispatcher;
private var _isAvatar:Boolean;
framework_internal static const VERSION:String = "v1.10t2.201006211630";
public static const GAMATAR_SENT_COMPLETE:String = "GAMATAR_SENT_COMPLETE";
public static const GAMATAR_SENT_ERROR:String = "GAMATAR_SENT_ERROR";
private static var _initialized_finish:Boolean = true;
static var _spilGamesServices:SpilGamesServices;
private static var _isDebug:Boolean;
private static var _gameName:String;
public function GamatarSender():void{
super();
this._isAvatar = false;
this._eventDispatcher = new EventDispatcher();
}
public function sendAvatar(picPreview:BitmapData, picRendering:BitmapData):Boolean{
this._isAvatar = true;
return (true);
}
public function send(picPreview:BitmapData, picRendering:BitmapData, encodeQuality:Number=100, title:String=null, description:String=null):Boolean{
var options:Object = {encodingQuality:encodeQuality, title:((title == null)) ? "" : title, description:((description == null)) ? "" : description};
var callbackID:int = AlbumService.addItem(picRendering, picPreview, this.onAlbumItemSaved, options);
if (_isDebug){
Trace("callbackID", callbackID);
};
this._isAvatar = false;
return (true);
}
private function onAlbumItemSaved(callbackID:int, args:Object):void{
var xml:XML;
var str:String;
var i:String;
if (args.success){
xml = new XML(args["xml"]);
this._gamatarid = xml.result.id;
this._gamatartype = xml.result.type;
this._eventDispatcher.dispatchEvent(new Event(GAMATAR_SENT_COMPLETE));
if (_isDebug){
str = "onAlbumItemSaved\n";
for (i in args) {
str = (str + (((("\t" + i) + ": ") + args[i]) + "\n"));
};
Trace(str);
Trace("_gamatarid", this._gamatarid);
Trace("_gamatartype", this._gamatartype);
};
} else {
this._eventDispatcher.dispatchEvent(new Event(GAMATAR_SENT_ERROR));
if (_isDebug){
Trace(("Upload of album item failed due to " + args.errorMessage));
};
};
}
public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{
this._eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
}
public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{
this._eventDispatcher.removeEventListener(type, listener, useCapture);
}
public function del():void{
}
public function get renderingUrl():String{
return (null);
}
public function get previewUrl():String{
return (null);
}
public static function init(disObj:DisplayObjectContainer, gameName:String, isDebug:Boolean=false):void{
_isDebug = isDebug;
_gameName = gameName;
if (!SpilSetting._instance){
SpilSetting.instance.init(disObj, gameName, isDebug);
};
_initialized_finish = false;
if (!Award_HighScore._instance){
_spilGamesServices = SpilGamesServices.getInstance();
_spilGamesServices.addEventListener("servicesReady", onServicesReady);
_spilGamesServices.addEventListener("servicesFailed", onServicesFailed);
_spilGamesServices.connect(disObj);
} else {
_initialized_finish = true;
};
}
public static function isAvailable():Boolean{
return (AlbumService.isAvailable());
}
private static function onServicesReady(event:Event):void{
_spilGamesServices.addEventListener("servicesReady", onServicesReady);
_spilGamesServices.addEventListener("servicesFailed", onServicesFailed);
if (AlbumService.isAvailable()){
if (_isDebug){
Trace(("GAMATAR_SENDER_Tool_Initialized_Component" + event));
};
} else {
if (_isDebug){
Trace(("GAMATAR_SENDER_Tool_Initialized_Failed" + event));
};
};
_initialized_finish = true;
}
private static function onServicesFailed(event:ErrorEvent):void{
_spilGamesServices.addEventListener("servicesReady", onServicesReady);
_spilGamesServices.addEventListener("servicesFailed", onServicesFailed);
if (_isDebug){
Trace(("GAMATAR_SENDER_Tool_Initialized_Failed" + event.text));
};
_initialized_finish = true;
}
}
}//package zlong.spilSystemTool
Section 211
//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.10t2.201006211630";
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 212
//SpilSetting (zlong.spilSystemTool.SpilSetting)
package zlong.spilSystemTool {
import flash.display.*;
import flash.external.*;
import flash.system.*;
public class SpilSetting {
private var _username:String;
private var _hash:String;
private var _siteId:String;
private var _itemId:String;
private var _isDebug:Boolean;
private var _mc:DisplayObject;
framework_internal static const VERSION:String = "v1.10t2.201006211630";
static var _instance:SpilSetting;
public function SpilSetting(){
super();
this._username = null;
this._hash = null;
this._siteId = null;
this._itemId = null;
}
public function init(disObj:DisplayObject, gameName:String, isDebug:Boolean=false):void{
this._mc = disObj;
this._isDebug = isDebug;
this.getHtmlParameters();
if (!this._siteId){
Trace("Can`t get siteId from html");
};
if (!this._itemId){
Trace("Can`t get itemId from html");
};
if (!this.checkUserLogin()){
};
}
private function getHtmlParameters():void{
this._username = this._mc.root.loaderInfo.parameters["username"];
if (this._username){
this._username = decodeURIComponent(this._username);
};
this._hash = this._mc.root.loaderInfo.parameters["hash"];
if (this._hash){
this._hash = decodeURIComponent(this._hash);
};
this._siteId = this._mc.root.loaderInfo.parameters["siteId"];
if (this._siteId){
this._siteId = decodeURIComponent(this._siteId);
};
this._itemId = this._mc.root.loaderInfo.parameters["itemId"];
if (this._itemId){
this._itemId = decodeURIComponent(this._itemId);
};
}
public function checkUserLogin():Boolean{
if (((this._username) && (this._hash))){
return (true);
};
return (false);
}
private function initJsCallBackFunction():void{
Security.allowDomain("*");
ExternalInterface.addCallback("UPDATE_USER", this.updateUser);
//unresolved jump
var _slot1 = e;
Trace("ExternalInterface.addCallback");
}
private function updateUser(username:String, hash:String):void{
if (this._isDebug){
Trace("Function updateUser!!");
};
this._username = username;
this._hash = hash;
}
function callUpdateGalleryToJs(id:String, type:String):void{
var id = id;
var type = type;
var Data:Object = {call:"UPDATE_GALLERY", params:{id:id, type:type}};
ExternalInterface.call("SWFtoJS", Data);
//unresolved jump
var _slot1 = e;
Trace("callUpdateGalleryToJs");
}
function callUpdateAvatarToJs(id:String, type:String):void{
var id = id;
var type = type;
var Data:Object = {call:"UPDATE_AVATAR", params:{id:id, type:type}};
ExternalInterface.call("SWFtoJS", Data);
//unresolved jump
var _slot1 = e;
Trace("callUpdateGalleryToJs");
}
function callUpdateGalleryFailedToJS(msg:String):void{
var msg = msg;
var Data:Object = {call:"UPDATE_GALLERY_FAILED", params:{message:msg}};
ExternalInterface.call("SWFtoJS", Data);
//unresolved jump
var _slot1 = e;
Trace("callUpdateFailedToJS");
}
function callUpdateAvatarFailedToJS(msg:String):void{
var msg = msg;
var Data:Object = {call:"UPDATE_AVATAR_FAILED", params:{message:msg}};
ExternalInterface.call("SWFtoJS", Data);
//unresolved jump
var _slot1 = e;
Trace("callUpdateFailedToJS");
}
public function get itemId():String{
return (this._itemId);
}
public function get siteId():String{
return (this._siteId);
}
public function get username():String{
return (this._username);
}
public function get hash():String{
return (this._hash);
}
public static function get instance():SpilSetting{
if (_instance == null){
_instance = new (SpilSetting);
};
return (_instance);
}
static function callUnknowUserToJS(id:String):void{
var id = id;
var Data:Object = {call:"UNKNOWN_USER", params:{id:id}};
ExternalInterface.call("SWFtoJS", Data);
//unresolved jump
var _slot1 = e;
Trace("callUnknowUserToJS");
}
}
}//package zlong.spilSystemTool
Section 213
//AbstractLoadingClass (zlong.Template.AbstractLoadingClass)
package zlong.Template {
import flash.display.*;
import flash.utils.*;
public class AbstractLoadingClass {
protected var _pmc:Sprite;
framework_internal static const VERSION:String = "v1.10t2.201006211630";
public function AbstractLoadingClass(pmc:Sprite){
super();
if (getQualifiedClassName(this) == "zlong::Template::AbstractLoadingClass"){
throw (new ArgumentError("can't be constructed"));
};
this._pmc = pmc;
}
public function destroy():void{
throw (new ArgumentError("function destroy must be override"));
}
}
}//package zlong.Template
Section 214
//AbstractMainClass (zlong.Template.AbstractMainClass)
package zlong.Template {
import flash.display.*;
import zlong.spilSystemTool.*;
import flash.text.*;
import flash.utils.*;
import net.hires.debug.*;
import zlong.utils.*;
public class AbstractMainClass {
private var __mainMc:Sprite;
protected var __GameMc:Sprite;
private var _childClass:Class;
framework_internal static const VERSION:String = "v1.10t2.201006211630";
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, 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 215
//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.10t2.201006211630";
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 216
//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.10t2.201006211630";
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 217
//SharedObjectUtil (zlong.utils.SharedObjectUtil)
package zlong.utils {
import flash.events.*;
import flash.net.*;
public class SharedObjectUtil {
framework_internal static const VERSION:String = "v1.10t2.201006211630";
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("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("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("save successed");
};
};
operatedSharedObject.removeEventListener(NetStatusEvent.NET_STATUS, statusHandler);
operatedSharedObject = null;
}
}
}//package zlong.utils
Section 218
//framework_internal (zlong.framework_internal)
package zlong {
public namespace framework_internal = "http://www.zlonggames.com/flash/framework/internal";
}//package zlong
Section 219
//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.201006181400";
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 220
//localComponent_internal (zlong.localComponent_internal)
package zlong {
public namespace localComponent_internal = "http://www.zlonggames.com/flash/localComponent/internal";
}//package zlong
Section 221
//Album (Album)
package {
import tools.*;
import flash.utils.*;
public dynamic class Album extends SimpleButton {
public var __setPropDict:Dictionary;
public var __id2_:Logo;
public function Album(){
__setPropDict = new Dictionary(true);
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
if ((((__setPropDict[__id2_] == undefined)) || (!((int(__setPropDict[__id2_]) == 3))))){
__setPropDict[__id2_] = currentFrame;
__setProp___id2__Album_Layer1_3();
};
}
function frame1(){
if ((((__setPropDict[__id2_] == undefined)) || (!((((int(__setPropDict[__id2_]) >= 1)) && ((int(__setPropDict[__id2_]) <= 2))))))){
__setPropDict[__id2_] = currentFrame;
__setProp___id2__Album_Layer1_1();
};
}
function __setProp___id2__Album_Layer1_1(){
try {
__id2_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id2_.alignHorizontal = "Center";
__id2_.alignVertical = "Center";
__id2_.maxHeight = 80;
__id2_.maxWidth = 200;
__id2_.position = "logo_preloader";
try {
__id2_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame2(){
if ((((__setPropDict[__id2_] == undefined)) || (!((((int(__setPropDict[__id2_]) >= 1)) && ((int(__setPropDict[__id2_]) <= 2))))))){
__setPropDict[__id2_] = currentFrame;
__setProp___id2__Album_Layer1_1();
};
}
function __setProp___id2__Album_Layer1_3(){
try {
__id2_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id2_.alignHorizontal = "Center";
__id2_.alignVertical = "Center";
__id2_.maxHeight = 70;
__id2_.maxWidth = 180;
__id2_.position = "logo_preloader";
try {
__id2_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 222
//allCloth (allCloth)
package {
import flash.display.*;
public dynamic class allCloth extends MovieClip {
}
}//package
Section 223
//amethyst (amethyst)
package {
import tools.*;
public dynamic class amethyst extends PencilButton {
}
}//package
Section 224
//AnimalchooseUI (AnimalchooseUI)
package {
import flash.display.*;
public dynamic class AnimalchooseUI extends MovieClip {
public var guide:bearGuide;
public var rabbit:whiteRabbit;
public var wolf:whiteWolf;
public var more_btn:MoreGames;
public var bear:whiteBear;
public var cat:whiteCat;
public var horse:whiteHorse;
public var text_mc:animalText;
public var back:back_btn;
public function AnimalchooseUI(){
__setProp_more_btn_Animalchoose__1();
}
function __setProp_more_btn_Animalchoose__1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_animal_choose";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 225
//animalText (animalText)
package {
import tools.*;
public dynamic class animalText extends GuideText {
}
}//package
Section 226
//areyousure (areyousure)
package {
import zlong.display.*;
public dynamic class areyousure extends TranText {
}
}//package
Section 227
//arrow_press (arrow_press)
package {
import flash.media.*;
public dynamic class arrow_press extends Sound {
}
}//package
Section 228
//arrow_touch (arrow_touch)
package {
import flash.media.*;
public dynamic class arrow_touch extends Sound {
}
}//package
Section 229
//back_btn (back_btn)
package {
import tools.*;
public dynamic class back_btn extends SimpleButton {
}
}//package
Section 230
//BackGround_Complete (BackGround_Complete)
package {
import flash.display.*;
public dynamic class BackGround_Complete extends MovieClip {
}
}//package
Section 231
//badover (badover)
package {
import flash.media.*;
public dynamic class badover extends Sound {
}
}//package
Section 232
//BadText (BadText)
package {
import flash.display.*;
public dynamic class BadText extends MovieClip {
public var bad_btn:MovieClip;
}
}//package
Section 233
//bear_complete (bear_complete)
package {
import flash.display.*;
public dynamic class bear_complete extends MovieClip {
public var cloth:MovieClip;
public var tag_position:MovieClip;
public var eye:MovieClip;
public var mouth:MovieClip;
public var nose:MovieClip;
}
}//package
Section 234
//bear_cut_1 (bear_cut_1)
package {
import flash.display.*;
public dynamic class bear_cut_1 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 235
//bear_cut_2 (bear_cut_2)
package {
import flash.display.*;
public dynamic class bear_cut_2 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 236
//bear_cut_3 (bear_cut_3)
package {
import flash.display.*;
public dynamic class bear_cut_3 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 237
//bear_decorate (bear_decorate)
package {
import flash.display.*;
public dynamic class bear_decorate extends MovieClip {
public var noseposition:MovieClip;
public var cloth:MovieClip;
public var eyeposition:MovieClip;
public var mouthposition:MovieClip;
}
}//package
Section 238
//bear_fill (bear_fill)
package {
import flash.display.*;
public dynamic class bear_fill extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 239
//bear_line1 (bear_line1)
package {
import tools.*;
public dynamic class bear_line1 extends Way {
}
}//package
Section 240
//bear_line2 (bear_line2)
package {
import tools.*;
public dynamic class bear_line2 extends Way {
}
}//package
Section 241
//bear_line3 (bear_line3)
package {
import tools.*;
public dynamic class bear_line3 extends Way {
}
}//package
Section 242
//bear_out_1 (bear_out_1)
package {
import tools.*;
public dynamic class bear_out_1 extends OutMask {
}
}//package
Section 243
//bear_out_2 (bear_out_2)
package {
import tools.*;
public dynamic class bear_out_2 extends OutMask {
}
}//package
Section 244
//bear_out_3 (bear_out_3)
package {
import tools.*;
public dynamic class bear_out_3 extends OutMask {
}
}//package
Section 245
//bear_sew (bear_sew)
package {
import flash.display.*;
public dynamic class bear_sew extends MovieClip {
public var cloth:MovieClip;
public var bearsew3:MovieClip;
public var bearsew2:MovieClip;
public var bearsew1:MovieClip;
public var bear_position1:MovieClip;
public var bear_position3:MovieClip;
public var bear_position2:MovieClip;
public var inside_2:MovieClip;
public var inside_3:MovieClip;
public var inside_1:MovieClip;
}
}//package
Section 246
//bear_sew_1 (bear_sew_1)
package {
import flash.display.*;
public dynamic class bear_sew_1 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var bear_startpoint_1:Point_movie;
public var level:MovieClip;
}
}//package
Section 247
//bear_sew_2 (bear_sew_2)
package {
import flash.display.*;
public dynamic class bear_sew_2 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var bear_startpoint_2:Point_movie;
public var level:MovieClip;
}
}//package
Section 248
//bear_sew_3 (bear_sew_3)
package {
import flash.display.*;
public dynamic class bear_sew_3 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var level:MovieClip;
public var bear_startpoint_3:Point_movie;
}
}//package
Section 249
//bear_sew_bitmap (bear_sew_bitmap)
package {
import flash.display.*;
public dynamic class bear_sew_bitmap extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 250
//bearGuide (bearGuide)
package {
import tools.*;
public dynamic class bearGuide extends Guide {
}
}//package
Section 251
//blue (blue)
package {
import tools.*;
public dynamic class blue extends PencilButton {
}
}//package
Section 252
//blueness (blueness)
package {
import tools.*;
public dynamic class blueness extends PencilButton {
}
}//package
Section 253
//bt_contiune (bt_contiune)
package {
import tools.*;
public dynamic class bt_contiune extends SimpleButton {
}
}//package
Section 254
//Btn_YES (Btn_YES)
package {
import tools.*;
public dynamic class Btn_YES extends SimpleButton {
}
}//package
Section 255
//cat_complete (cat_complete)
package {
import flash.display.*;
public dynamic class cat_complete extends MovieClip {
public var cloth:MovieClip;
public var tag_position:MovieClip;
public var eye:MovieClip;
public var mouth:MovieClip;
public var nose:MovieClip;
}
}//package
Section 256
//cat_cut_1 (cat_cut_1)
package {
import flash.display.*;
public dynamic class cat_cut_1 extends MovieClip {
public var level:MovieClip;
public var inside1:cat_out_1;
}
}//package
Section 257
//cat_cut_2 (cat_cut_2)
package {
import flash.display.*;
public dynamic class cat_cut_2 extends MovieClip {
public var level:MovieClip;
public var inside2:cat_out_2;
}
}//package
Section 258
//cat_cut_3 (cat_cut_3)
package {
import flash.display.*;
public dynamic class cat_cut_3 extends MovieClip {
public var level:MovieClip;
public var inside3:cat_out_3;
}
}//package
Section 259
//cat_decorate (cat_decorate)
package {
import flash.display.*;
public dynamic class cat_decorate extends MovieClip {
public var noseposition:MovieClip;
public var cloth:MovieClip;
public var eyeposition:MovieClip;
public var mouthposition:MovieClip;
}
}//package
Section 260
//cat_fill (cat_fill)
package {
import flash.display.*;
public dynamic class cat_fill extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 261
//cat_line1 (cat_line1)
package {
import tools.*;
public dynamic class cat_line1 extends Way {
}
}//package
Section 262
//cat_line2 (cat_line2)
package {
import tools.*;
public dynamic class cat_line2 extends Way {
}
}//package
Section 263
//cat_line3 (cat_line3)
package {
import tools.*;
public dynamic class cat_line3 extends Way {
}
}//package
Section 264
//cat_out_1 (cat_out_1)
package {
import tools.*;
public dynamic class cat_out_1 extends OutMask {
}
}//package
Section 265
//cat_out_2 (cat_out_2)
package {
import tools.*;
public dynamic class cat_out_2 extends OutMask {
}
}//package
Section 266
//cat_out_3 (cat_out_3)
package {
import tools.*;
public dynamic class cat_out_3 extends OutMask {
}
}//package
Section 267
//cat_sew (cat_sew)
package {
import flash.display.*;
public dynamic class cat_sew extends MovieClip {
public var cat_position2:MovieClip;
public var cat_position3:MovieClip;
public var cloth:MovieClip;
public var catsew2:MovieClip;
public var catsew3:MovieClip;
public var catsew1:MovieClip;
public var inside_2:MovieClip;
public var inside_3:MovieClip;
public var inside_1:MovieClip;
public var cat_position1:MovieClip;
}
}//package
Section 268
//cat_sew_1 (cat_sew_1)
package {
import flash.display.*;
public dynamic class cat_sew_1 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var cat_startpoint_1:Point_movie;
public var level:MovieClip;
}
}//package
Section 269
//cat_sew_2 (cat_sew_2)
package {
import flash.display.*;
public dynamic class cat_sew_2 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var cat_startpoint_2:Point_movie;
public var level:MovieClip;
public var cat_position1:MovieClip;
}
}//package
Section 270
//cat_sew_3 (cat_sew_3)
package {
import flash.display.*;
public dynamic class cat_sew_3 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var cat_startpoint_3:Point_movie;
public var level:MovieClip;
}
}//package
Section 271
//cat_sew_bitmap (cat_sew_bitmap)
package {
import flash.display.*;
public dynamic class cat_sew_bitmap extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 272
//click (click)
package {
import flash.media.*;
public dynamic class click extends Sound {
}
}//package
Section 273
//cloth1 (cloth1)
package {
import flash.display.*;
public dynamic class cloth1 extends MovieClip {
}
}//package
Section 274
//cloth10 (cloth10)
package {
import flash.display.*;
public dynamic class cloth10 extends MovieClip {
}
}//package
Section 275
//cloth2 (cloth2)
package {
import flash.display.*;
public dynamic class cloth2 extends MovieClip {
}
}//package
Section 276
//cloth3 (cloth3)
package {
import flash.display.*;
public dynamic class cloth3 extends MovieClip {
}
}//package
Section 277
//cloth4 (cloth4)
package {
import flash.display.*;
public dynamic class cloth4 extends MovieClip {
}
}//package
Section 278
//cloth5 (cloth5)
package {
import flash.display.*;
public dynamic class cloth5 extends MovieClip {
}
}//package
Section 279
//cloth6 (cloth6)
package {
import flash.display.*;
public dynamic class cloth6 extends MovieClip {
}
}//package
Section 280
//cloth7 (cloth7)
package {
import flash.display.*;
public dynamic class cloth7 extends MovieClip {
}
}//package
Section 281
//cloth8 (cloth8)
package {
import flash.display.*;
public dynamic class cloth8 extends MovieClip {
}
}//package
Section 282
//cloth9 (cloth9)
package {
import flash.display.*;
public dynamic class cloth9 extends MovieClip {
}
}//package
Section 283
//ClothchooseUI (ClothchooseUI)
package {
import flash.display.*;
public dynamic class ClothchooseUI extends MovieClip {
public var guide:bearGuide;
public var right_arrow:MovieClip;
public var more_btn:MoreGames;
public var left_arrow:MovieClip;
public var text_mc:clothText;
public var back:back_btn;
public function ClothchooseUI(){
__setProp_more_btn_ClothchooseUI__1();
}
function __setProp_more_btn_ClothchooseUI__1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_cloth_choose";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 284
//clothText (clothText)
package {
import tools.*;
public dynamic class clothText extends GuideText {
}
}//package
Section 285
//completeText (completeText)
package {
import tools.*;
public dynamic class completeText extends GuideText {
}
}//package
Section 286
//CompleteUI (CompleteUI)
package {
import flash.display.*;
public dynamic class CompleteUI extends MovieClip {
public var home_btn:home;
public var guide:bearGuide;
public var upload_btn:upData;
public var paint:pen;
public var more_btn:MoreGames;
public var back_ground:BackGround_Complete;
public var text_mc:completeText;
public function CompleteUI(){
__setProp_more_btn_CompleteUI_Layer2_1();
}
function __setProp_more_btn_CompleteUI_Layer2_1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_congratulations_moregames";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 287
//Copyright (Copyright)
package {
import zlong.display.*;
public dynamic class Copyright extends Copyright {
}
}//package
Section 288
//cotton (cotton)
package {
import flash.display.*;
public dynamic class cotton extends MovieClip {
}
}//package
Section 289
//cotton_sound (cotton_sound)
package {
import flash.media.*;
public dynamic class cotton_sound extends Sound {
}
}//package
Section 290
//cottons (cottons)
package {
import flash.display.*;
public dynamic class cottons extends MovieClip {
}
}//package
Section 291
//CountriesBox (CountriesBox)
package {
import zlong.display.*;
public dynamic class CountriesBox extends CountriesBox {
}
}//package
Section 292
//cutText (cutText)
package {
import tools.*;
public dynamic class cutText extends GuideText {
}
}//package
Section 293
//CuttingUI (CuttingUI)
package {
import flash.display.*;
public dynamic class CuttingUI extends MovieClip {
public var guide:bearGuide;
public var next_btn:ok_btn;
public var lace_mc:MovieClip;
public var more_btn:MoreGames;
public var text_mc:cutText;
public var back:back_btn;
public function CuttingUI(){
__setProp_more_btn_CuttingUI__1();
}
function __setProp_more_btn_CuttingUI__1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_cut";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 294
//Data (Data)
package {
import flash.display.*;
public class Data {
public static var cutList:Object = {cat1:30, cat2:30, cat3:20, horse1:25, horse2:25, horse3:25, rabbit1:35, rabbit2:30, rabbit3:20, bear1:30, bear2:25, bear3:25, wolf1:35, wolf2:30, wolf3:25};
public static var tagName:String = "tag1";
public static var mouth:String = "null";
public static var sewFirst:Boolean = true;
public static var sewOnce:Boolean = true;
public static var cutOnce:Boolean = true;
public static var nose:String = "null";
public static var cutStatus:int = 1;
public static var cloth:String = "";
public static var cutFirst:Boolean = true;
public static var tag:MovieClip;
public static var isMute:Boolean = false;
public static var soundPlay:Boolean = true;
public static var CookieName:String = "TeddyTextile";
public static var eye:String = "null";
public static var sewList:Object = {cat1:27, cat2:20, cat3:21, horse1:20, horse2:22, horse3:19, rabbit1:17, rabbit2:17, rabbit3:20, bear1:19, bear2:19, bear3:18, wolf1:25, wolf2:19, wolf3:20};
public static var sewStatus:int = 1;
public static var animalList:Array = ["cat", "horse", "wolf", "bear", "rabbit"];
public static var animal:String = "";
public static var quality:String = "high";
public function Data(){
super();
}
public static function setBack():void{
animal = "";
cloth = "";
tagName = "tag1";
cutStatus = 1;
sewStatus = 1;
eye = "null";
mouth = "null";
nose = "null";
cutFirst = true;
sewFirst = true;
cutOnce = true;
sewOnce = true;
}
}
}//package
Section 295
//decorateText (decorateText)
package {
import tools.*;
public dynamic class decorateText extends GuideText {
}
}//package
Section 296
//DecorateUI (DecorateUI)
package {
import flash.display.*;
public dynamic class DecorateUI extends MovieClip {
public var next:ok_btn;
public var guide:bearGuide;
public var mouthbtn:MovieClip;
public var more_btn:MoreGames;
public var eyebtn:MovieClip;
public var nosebtn:MovieClip;
public var table:MovieClip;
public var text_mc:decorateText;
public var back:back_btn;
public function DecorateUI(){
__setProp_more_btn_DecorateUI__1();
}
function __setProp_more_btn_DecorateUI__1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_decorate";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 297
//decoration (decoration)
package {
import flash.media.*;
public dynamic class decoration extends Sound {
}
}//package
Section 298
//EnterName_txt (EnterName_txt)
package {
import zlong.display.*;
public dynamic class EnterName_txt extends TranText {
}
}//package
Section 299
//Eraser (Eraser)
package {
import tools.*;
public dynamic class Eraser extends SimpleButton {
}
}//package
Section 300
//eye_table (eye_table)
package {
import flash.display.*;
public dynamic class eye_table extends MovieClip {
public var eye3:eye3_all;
public var eye4:eye4_all;
public var eye2:eye2_all;
public var eye1:eye1_all;
}
}//package
Section 301
//eye1_all (eye1_all)
package {
import tools.*;
public dynamic class eye1_all extends Prop {
}
}//package
Section 302
//eye2_all (eye2_all)
package {
import tools.*;
public dynamic class eye2_all extends Prop {
}
}//package
Section 303
//eye3_all (eye3_all)
package {
import tools.*;
public dynamic class eye3_all extends Prop {
}
}//package
Section 304
//eye4_all (eye4_all)
package {
import tools.*;
public dynamic class eye4_all extends Prop {
}
}//package
Section 305
//fillText (fillText)
package {
import tools.*;
public dynamic class fillText extends GuideText {
}
}//package
Section 306
//FillUI (FillUI)
package {
import flash.display.*;
public dynamic class FillUI extends MovieClip {
public var persent_bar:MovieClip;
public var next:ok_btn;
public var guide:bearGuide;
public var lace_mc:MovieClip;
public var funneldown:MovieClip;
public var cottonheap:cottons;
public var more_btn:MoreGames;
public var funnelup:MovieClip;
public var text_mc:fillText;
public var back:back_btn;
public function FillUI(){
__setProp_more_btn_FillUI__1();
}
function __setProp_more_btn_FillUI__1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_fill";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 307
//get_sound (get_sound)
package {
import flash.media.*;
public dynamic class get_sound extends Sound {
}
}//package
Section 308
//goodover (goodover)
package {
import flash.media.*;
public dynamic class goodover extends Sound {
}
}//package
Section 309
//GoodText (GoodText)
package {
import flash.display.*;
public dynamic class GoodText extends MovieClip {
public var good_btn:MovieClip;
}
}//package
Section 310
//great (great)
package {
import zlong.display.*;
public dynamic class great extends TranText {
}
}//package
Section 311
//greatMovie (greatMovie)
package {
import flash.display.*;
public dynamic class greatMovie extends MovieClip {
}
}//package
Section 312
//green (green)
package {
import tools.*;
public dynamic class green extends PencilButton {
}
}//package
Section 313
//HideConsole (HideConsole)
package {
public var HideConsole:Boolean;
HideConsole = false;
}//package
Section 314
//home (home)
package {
import tools.*;
public dynamic class home extends SimpleButton {
}
}//package
Section 315
//homeInfo (homeInfo)
package {
import zlong.display.*;
public dynamic class homeInfo extends TranText {
}
}//package
Section 316
//horse_complete (horse_complete)
package {
import flash.display.*;
public dynamic class horse_complete extends MovieClip {
public var cloth:MovieClip;
public var tag_position:MovieClip;
public var eye:MovieClip;
public var mouth:MovieClip;
public var nose:MovieClip;
}
}//package
Section 317
//horse_cut_1 (horse_cut_1)
package {
import flash.display.*;
public dynamic class horse_cut_1 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 318
//horse_cut_2 (horse_cut_2)
package {
import flash.display.*;
public dynamic class horse_cut_2 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 319
//horse_cut_3 (horse_cut_3)
package {
import flash.display.*;
public dynamic class horse_cut_3 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 320
//horse_decorate (horse_decorate)
package {
import flash.display.*;
public dynamic class horse_decorate extends MovieClip {
public var noseposition:MovieClip;
public var cloth:MovieClip;
public var eyeposition:MovieClip;
public var mouthposition:MovieClip;
}
}//package
Section 321
//horse_fill (horse_fill)
package {
import flash.display.*;
public dynamic class horse_fill extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 322
//horse_line1 (horse_line1)
package {
import tools.*;
public dynamic class horse_line1 extends Way {
}
}//package
Section 323
//horse_line2 (horse_line2)
package {
import tools.*;
public dynamic class horse_line2 extends Way {
}
}//package
Section 324
//horse_line3 (horse_line3)
package {
import tools.*;
public dynamic class horse_line3 extends Way {
}
}//package
Section 325
//horse_out_1 (horse_out_1)
package {
import tools.*;
public dynamic class horse_out_1 extends OutMask {
}
}//package
Section 326
//horse_out_2 (horse_out_2)
package {
import tools.*;
public dynamic class horse_out_2 extends OutMask {
}
}//package
Section 327
//horse_out_3 (horse_out_3)
package {
import tools.*;
public dynamic class horse_out_3 extends OutMask {
}
}//package
Section 328
//horse_sew (horse_sew)
package {
import flash.display.*;
public dynamic class horse_sew extends MovieClip {
public var cloth:MovieClip;
public var horse_position3:MovieClip;
public var horse_position2:MovieClip;
public var horse_position1:MovieClip;
public var inside_2:MovieClip;
public var inside_3:MovieClip;
public var inside_1:MovieClip;
public var horsesew1:MovieClip;
public var horsesew2:MovieClip;
public var horsesew3:MovieClip;
}
}//package
Section 329
//horse_sew_1 (horse_sew_1)
package {
import flash.display.*;
public dynamic class horse_sew_1 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var level:MovieClip;
public var horse_startpoint_1:Point_movie;
}
}//package
Section 330
//horse_sew_2 (horse_sew_2)
package {
import flash.display.*;
public dynamic class horse_sew_2 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var level:MovieClip;
public var horse_startpoint_2:Point_movie;
}
}//package
Section 331
//horse_sew_3 (horse_sew_3)
package {
import flash.display.*;
public dynamic class horse_sew_3 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var level:MovieClip;
public var horse_startpoint_3:Point_movie;
}
}//package
Section 332
//horse_sew_bitmap (horse_sew_bitmap)
package {
import flash.display.*;
public dynamic class horse_sew_bitmap extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 333
//HyvesLoading (HyvesLoading)
package {
import zlong.display.*;
public dynamic class HyvesLoading extends HyvesLoading {
}
}//package
Section 334
//introduceText (introduceText)
package {
import tools.*;
public dynamic class introduceText extends GuideText {
}
}//package
Section 335
//IntroductionUI (IntroductionUI)
package {
import flash.display.*;
public dynamic class IntroductionUI extends MovieClip {
public var more_btn:MoreGames;
public var guid:MovieClip;
public var text_mc:introduceText;
public function IntroductionUI(){
__setProp_more_btn_IntroductionUI__1();
}
function __setProp_more_btn_IntroductionUI__1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_introduction";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 336
//light (light)
package {
import tools.*;
public dynamic class light extends Light {
}
}//package
Section 337
//loading (loading)
package {
import zlong.display.*;
public dynamic class loading extends TranText {
}
}//package
Section 338
//Loading_txt (Loading_txt)
package {
import zlong.display.*;
public dynamic class Loading_txt extends TranText {
}
}//package
Section 339
//LoadingInfo (LoadingInfo)
package {
import flash.display.*;
import flash.text.*;
public dynamic class LoadingInfo extends MovieClip {
public var info:TextField;
}
}//package
Section 340
//LoadingUI (LoadingUI)
package {
import flash.display.*;
public dynamic class LoadingUI extends MovieClip {
public var persent:MovieClip;
public var more_btn:Logo;
public function LoadingUI(){
__setProp_more_btn_LoadingUI__1();
}
function __setProp_more_btn_LoadingUI__1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.alignHorizontal = "Center";
more_btn.alignVertical = "Center";
more_btn.maxHeight = 80;
more_btn.maxWidth = 260;
more_btn.position = "button_preloader";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 341
//localization (localization)
package {
import flash.display.*;
public dynamic class localization extends MovieClip {
}
}//package
Section 342
//Logo (Logo)
package {
import zlong.display.*;
public dynamic class Logo extends Logo {
}
}//package
Section 343
//Main (Main)
package {
import flash.display.*;
import core.*;
import zlong.spilSystemTool.*;
import zlong.Template.*;
import zlong.breathxue.utils.debug.*;
public class Main extends AbstractMainClass {
private var _manage:Game;
public static const __debug__:Boolean = false;
public static const VERSION_NUM:String = "";
private static var _instance:Main;
public function Main(mainMc:Sprite){
_instance = this;
super(mainMc);
showVersion(VERSION_NUM);
if (_slot1.__debug__){
TC.InitTC(__GameMc);
showFPS();
};
gameStart();
}
private function gameStart():void{
GamatarSender.init(__GameMc, "TeddyTextile", false);
_manage = new Game();
__GameMc.addChild(_manage);
_manage.init();
}
public static function get instance():Main{
return (_instance);
}
}
}//package
Section 344
//mainscreen (mainscreen)
package {
import flash.media.*;
public dynamic class mainscreen extends Sound {
}
}//package
Section 345
//MakeSure (MakeSure)
package {
import flash.display.*;
public dynamic class MakeSure extends MovieClip {
public var ok_btn:yes;
public var no_btn:no;
}
}//package
Section 346
//menuPress (menuPress)
package {
import flash.media.*;
public dynamic class menuPress extends Sound {
}
}//package
Section 347
//menuTouch (menuTouch)
package {
import flash.media.*;
public dynamic class menuTouch extends Sound {
}
}//package
Section 348
//MenuUI (MenuUI)
package {
import flash.display.*;
public dynamic class MenuUI extends MovieClip {
public var quality_btn:MovieClip;
public var sound_btn:MovieClip;
public var music_btn:MovieClip;
public var more_btn:MoreGames;
public var start_btn:start;
public function MenuUI(){
__setProp_more_btn_MenuUI__1();
}
function __setProp_more_btn_MenuUI__1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_mainscreen_moregames";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 349
//MoreGames (MoreGames)
package {
import zlong.display.*;
import flash.utils.*;
public dynamic class MoreGames extends ExtButton {
public var __setPropDict:Dictionary;
public var __id1_:Logo;
public function MoreGames(){
__setPropDict = new Dictionary(true);
super();
addFrameScript(1, frame2, 0, frame1);
}
function __setProp___id1__MoreGames__1(){
try {
__id1_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id1_.alignHorizontal = "Center";
__id1_.alignVertical = "Center";
__id1_.maxHeight = 60;
__id1_.maxWidth = 300;
__id1_.position = "logo_preloader";
try {
__id1_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame1(){
if ((((__setPropDict[__id1_] == undefined)) || (!((int(__setPropDict[__id1_]) == 1))))){
__setPropDict[__id1_] = currentFrame;
__setProp___id1__MoreGames__1();
};
}
function frame2(){
if ((((__setPropDict[__id1_] == undefined)) || (!((int(__setPropDict[__id1_]) == 2))))){
__setPropDict[__id1_] = currentFrame;
__setProp___id1__MoreGames__2();
};
}
function __setProp___id1__MoreGames__2(){
try {
__id1_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id1_.alignHorizontal = "Center";
__id1_.alignVertical = "Center";
__id1_.maxHeight = 70;
__id1_.maxWidth = 220;
__id1_.position = "logo_preloader";
try {
__id1_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 350
//moregamestxt (moregamestxt)
package {
import zlong.display.*;
public dynamic class moregamestxt extends TranText {
}
}//package
Section 351
//moregamestxt1 (moregamestxt1)
package {
import zlong.display.*;
public dynamic class moregamestxt1 extends TranText {
}
}//package
Section 352
//moregame文字 (moregameæ–‡å—)
package {
import flash.display.*;
public dynamic class moregame文字 extends MovieClip {
}
}//package
Section 353
//mouth_table (mouth_table)
package {
import flash.display.*;
public dynamic class mouth_table extends MovieClip {
public var mouth3:mouth3_all;
public var mouth2:mouth2_all;
public var mouth1:mouth1_all;
public var mouth4:mouth4_all;
}
}//package
Section 354
//mouth1_all (mouth1_all)
package {
import tools.*;
public dynamic class mouth1_all extends Prop {
}
}//package
Section 355
//mouth2_all (mouth2_all)
package {
import tools.*;
public dynamic class mouth2_all extends Prop {
}
}//package
Section 356
//mouth3_all (mouth3_all)
package {
import tools.*;
public dynamic class mouth3_all extends Prop {
}
}//package
Section 357
//mouth4_all (mouth4_all)
package {
import tools.*;
public dynamic class mouth4_all extends Prop {
}
}//package
Section 358
//no (no)
package {
import tools.*;
public dynamic class no extends SimpleButton {
}
}//package
Section 359
//no_1 (no_1)
package {
import zlong.display.*;
public dynamic class no_1 extends TranText {
}
}//package
Section 360
//nose_table (nose_table)
package {
import flash.display.*;
public dynamic class nose_table extends MovieClip {
public var nose1:nose1_all;
public var nose4:nose4_all;
public var nose2:nose2_all;
public var nose3:nose3_all;
}
}//package
Section 361
//nose1_all (nose1_all)
package {
import tools.*;
public dynamic class nose1_all extends Prop {
}
}//package
Section 362
//nose2_all (nose2_all)
package {
import tools.*;
public dynamic class nose2_all extends Prop {
}
}//package
Section 363
//nose3_all (nose3_all)
package {
import tools.*;
public dynamic class nose3_all extends Prop {
}
}//package
Section 364
//nose4_all (nose4_all)
package {
import tools.*;
public dynamic class nose4_all extends Prop {
}
}//package
Section 365
//ok_btn (ok_btn)
package {
import tools.*;
public dynamic class ok_btn extends SimpleButton {
}
}//package
Section 366
//orange (orange)
package {
import tools.*;
public dynamic class orange extends PencilButton {
}
}//package
Section 367
//pen (pen)
package {
import tools.*;
public dynamic class pen extends SimpleButton {
}
}//package
Section 368
//pencil (pencil)
package {
import flash.display.*;
public dynamic class pencil extends MovieClip {
}
}//package
Section 369
//Point_movie (Point_movie)
package {
import tools.*;
public dynamic class Point_movie extends Light {
}
}//package
Section 370
//rabbit_complete (rabbit_complete)
package {
import flash.display.*;
public dynamic class rabbit_complete extends MovieClip {
public var cloth:MovieClip;
public var tag_position:MovieClip;
public var eye:MovieClip;
public var mouth:MovieClip;
public var nose:MovieClip;
}
}//package
Section 371
//rabbit_cut_1 (rabbit_cut_1)
package {
import flash.display.*;
public dynamic class rabbit_cut_1 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 372
//rabbit_cut_2 (rabbit_cut_2)
package {
import flash.display.*;
public dynamic class rabbit_cut_2 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 373
//rabbit_cut_3 (rabbit_cut_3)
package {
import flash.display.*;
public dynamic class rabbit_cut_3 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 374
//rabbit_decorate (rabbit_decorate)
package {
import flash.display.*;
public dynamic class rabbit_decorate extends MovieClip {
public var noseposition:MovieClip;
public var cloth:MovieClip;
public var eyeposition:MovieClip;
public var mouthposition:MovieClip;
}
}//package
Section 375
//rabbit_fill (rabbit_fill)
package {
import flash.display.*;
public dynamic class rabbit_fill extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 376
//rabbit_line1 (rabbit_line1)
package {
import tools.*;
public dynamic class rabbit_line1 extends Way {
}
}//package
Section 377
//rabbit_line2 (rabbit_line2)
package {
import tools.*;
public dynamic class rabbit_line2 extends Way {
}
}//package
Section 378
//rabbit_line3 (rabbit_line3)
package {
import tools.*;
public dynamic class rabbit_line3 extends Way {
}
}//package
Section 379
//rabbit_out_1 (rabbit_out_1)
package {
import tools.*;
public dynamic class rabbit_out_1 extends OutMask {
}
}//package
Section 380
//rabbit_out_2 (rabbit_out_2)
package {
import tools.*;
public dynamic class rabbit_out_2 extends OutMask {
}
}//package
Section 381
//rabbit_out_3 (rabbit_out_3)
package {
import tools.*;
public dynamic class rabbit_out_3 extends OutMask {
}
}//package
Section 382
//rabbit_sew (rabbit_sew)
package {
import flash.display.*;
public dynamic class rabbit_sew extends MovieClip {
public var cloth:MovieClip;
public var rabbit_position1:MovieClip;
public var rabbit_position2:MovieClip;
public var rabbit_position3:MovieClip;
public var rabbitsew2:MovieClip;
public var rabbitsew3:MovieClip;
public var rabbitsew1:MovieClip;
public var inside_2:MovieClip;
public var inside_3:MovieClip;
public var inside_1:MovieClip;
}
}//package
Section 383
//rabbit_sew_1 (rabbit_sew_1)
package {
import flash.display.*;
public dynamic class rabbit_sew_1 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var level:MovieClip;
public var rabbit_startpoint_1:Point_movie;
}
}//package
Section 384
//rabbit_sew_2 (rabbit_sew_2)
package {
import flash.display.*;
public dynamic class rabbit_sew_2 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var level:MovieClip;
public var rabbit_startpoint_2:Point_movie;
}
}//package
Section 385
//rabbit_sew_3 (rabbit_sew_3)
package {
import flash.display.*;
public dynamic class rabbit_sew_3 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var level:MovieClip;
public var rabbit_startpoint_3:Point_movie;
}
}//package
Section 386
//rabbit_sew_bitmap (rabbit_sew_bitmap)
package {
import flash.display.*;
public dynamic class rabbit_sew_bitmap extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 387
//red (red)
package {
import tools.*;
public dynamic class red extends PencilButton {
}
}//package
Section 388
//result (result)
package {
import flash.media.*;
public dynamic class result extends Sound {
}
}//package
Section 389
//Root (Root)
package {
import zlong.Template.*;
import zlong.*;
public class Root extends AbstractRootClass {
public static const STAGE_WIGHT:int = 700;
public static const VERSION_NUM:String = "v1.00";
public static const STAGE_HEIGHT:int = 510;
public static const PORTAL_TYPE:String = GameSetting.PORTAL_TYPE_GIRL;
public static const __debug__:Boolean = false;
public static const LOADING_CLASS_NAME:String = "manager.Loading";
public static const GAME_NAME:String = "TeddyTextile";
public static const GAME_FRAMERATE:int = 30;
public static const GAME_CLASS_NAME:String = "Main";
public function Root(){
super();
}
override protected function script0():void{
Trace("script0");
}
override protected function script1():void{
Trace("script1");
}
override protected function script2():void{
Trace("script2");
}
}
}//package
Section 390
//save_txt (save_txt)
package {
import zlong.display.*;
public dynamic class save_txt extends TranText {
}
}//package
Section 391
//selectPress (selectPress)
package {
import flash.media.*;
public dynamic class selectPress extends Sound {
}
}//package
Section 392
//selectTouch (selectTouch)
package {
import flash.media.*;
public dynamic class selectTouch extends Sound {
}
}//package
Section 393
//sew_sound (sew_sound)
package {
import flash.media.*;
public dynamic class sew_sound extends Sound {
}
}//package
Section 394
//SewBadText (SewBadText)
package {
import flash.display.*;
public dynamic class SewBadText extends MovieClip {
public var bad_btn:MovieClip;
}
}//package
Section 395
//SewGoodText (SewGoodText)
package {
import flash.display.*;
public dynamic class SewGoodText extends MovieClip {
public var good_btn:MovieClip;
}
}//package
Section 396
//sewText (sewText)
package {
import tools.*;
public dynamic class sewText extends GuideText {
}
}//package
Section 397
//SewUI (SewUI)
package {
import flash.display.*;
public dynamic class SewUI extends MovieClip {
public var guide:bearGuide;
public var next_btn:ok_btn;
public var lace_mc:MovieClip;
public var sew_machine:MovieClip;
public var more_btn:MoreGames;
public var text_mc:sewText;
public var back:back_btn;
public function SewUI(){
__setProp_more_btn_SewUI__1();
}
function __setProp_more_btn_SewUI__1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_sew";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 398
//shear (shear)
package {
import flash.display.*;
public dynamic class shear extends MovieClip {
}
}//package
Section 399
//shear_sound (shear_sound)
package {
import flash.media.*;
public dynamic class shear_sound extends Sound {
}
}//package
Section 400
//start (start)
package {
import tools.*;
public dynamic class start extends SimpleButton {
}
}//package
Section 401
//startcopy (startcopy)
package {
import zlong.display.*;
public dynamic class startcopy extends TranText {
}
}//package
Section 402
//Successful_txt (Successful_txt)
package {
import zlong.display.*;
public dynamic class Successful_txt extends TranText {
}
}//package
Section 403
//SWC (SWC)
package {
import flash.display.*;
public dynamic class SWC extends MovieClip {
}
}//package
Section 404
//tag_1 (tag_1)
package {
import flash.display.*;
public dynamic class tag_1 extends MovieClip {
public var tag1_mc:tag1;
public var paper:MovieClip;
}
}//package
Section 405
//tag_2 (tag_2)
package {
import flash.display.*;
public dynamic class tag_2 extends MovieClip {
public var tag2_mc:MovieClip;
public var paper:MovieClip;
}
}//package
Section 406
//tag_3 (tag_3)
package {
import flash.display.*;
public dynamic class tag_3 extends MovieClip {
public var paper:MovieClip;
public var tag3_mc:tag3;
}
}//package
Section 407
//tag_4 (tag_4)
package {
import flash.display.*;
public dynamic class tag_4 extends MovieClip {
public var tag4_mc:MovieClip;
public var paper:MovieClip;
}
}//package
Section 408
//tag1 (tag1)
package {
import flash.display.*;
public dynamic class tag1 extends MovieClip {
}
}//package
Section 409
//tag1_btn (tag1_btn)
package {
import tools.*;
public dynamic class tag1_btn extends TagButton {
}
}//package
Section 410
//tag2_btn (tag2_btn)
package {
import tools.*;
public dynamic class tag2_btn extends TagButton {
}
}//package
Section 411
//tag3 (tag3)
package {
import flash.display.*;
public dynamic class tag3 extends MovieClip {
}
}//package
Section 412
//tag3_btn (tag3_btn)
package {
import tools.*;
public dynamic class tag3_btn extends TagButton {
}
}//package
Section 413
//tag4_btn (tag4_btn)
package {
import tools.*;
public dynamic class tag4_btn extends TagButton {
}
}//package
Section 414
//tagInfo (tagInfo)
package {
import zlong.display.*;
public dynamic class tagInfo extends TranText {
}
}//package
Section 415
//TagUI (TagUI)
package {
import flash.display.*;
public dynamic class TagUI extends MovieClip {
public var tag2:tag2_btn;
public var blue_btn:blueness;
public var pencil_mc:pencil;
public var yellow_btn:yellow;
public var green_btn:green;
public var amethyst_btn:amethyst;
public var red_btn:red;
public var eraser:Eraser;
public var blueness_btn:blue;
public var orange_btn:orange;
public var over:ok_btn;
public var tag1:tag1_btn;
public var tag3:tag3_btn;
public var tag4:tag4_btn;
}
}//package
Section 416
//text_sound (text_sound)
package {
import flash.media.*;
public dynamic class text_sound extends Sound {
}
}//package
Section 417
//TEXT_TO_SAVE_AVATAR (TEXT_TO_SAVE_AVATAR)
package {
import zlong.display.*;
public dynamic class TEXT_TO_SAVE_AVATAR extends TranText {
}
}//package
Section 418
//textmask (textmask)
package {
import flash.display.*;
public dynamic class textmask extends Sprite {
}
}//package
Section 419
//Trace (Trace)
package {
import zlong.breathxue.utils.debug.*;
import flash.utils.*;
public function Trace(... _args):void{
var TcClass:Class;
var args = _args;
if (!HideConsole){
trace(args);
};
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"](args);
};
};
}
}//package
Section 420
//tran_continue (tran_continue)
package {
import zlong.display.*;
public dynamic class tran_continue extends TranText {
}
}//package
Section 421
//TXT_upload_faild (TXT_upload_faild)
package {
import zlong.display.*;
public dynamic class TXT_upload_faild extends TranText {
}
}//package
Section 422
//txt_YES (txt_YES)
package {
import zlong.display.*;
public dynamic class txt_YES extends TranText {
}
}//package
Section 423
//UI_setlock (UI_setlock)
package {
import flash.display.*;
public dynamic class UI_setlock extends MovieClip {
public var goon:bt_contiune;
public var agame:Album;
}
}//package
Section 424
//UI_uploadfailed (UI_uploadfailed)
package {
import flash.display.*;
public dynamic class UI_uploadfailed extends MovieClip {
public var back_btn:Btn_YES;
public var __id0_:Logo;
public function UI_uploadfailed(){
__setProp___id0__UI_uploadfailed__1();
}
function __setProp___id0__UI_uploadfailed__1(){
try {
__id0_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id0_.alignHorizontal = "Center";
__id0_.alignVertical = "Center";
__id0_.maxHeight = 40;
__id0_.maxWidth = 200;
__id0_.position = "logo_upload";
try {
__id0_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 425
//upData (upData)
package {
import tools.*;
public dynamic class upData extends SimpleButton {
}
}//package
Section 426
//upInfo (upInfo)
package {
import zlong.display.*;
public dynamic class upInfo extends TranText {
}
}//package
Section 427
//UploadFailed_txt (UploadFailed_txt)
package {
import zlong.display.*;
public dynamic class UploadFailed_txt extends TranText {
}
}//package
Section 428
//upLoadUI (upLoadUI)
package {
import flash.display.*;
import flash.text.*;
public dynamic class upLoadUI extends MovieClip {
public var home_btn:back_btn;
public var inputText:TextField;
public var upLoad_btn:upData;
public var pictureShape:MovieClip;
public var successful_txt:Successful_txt;
public var enter_Name_txt:EnterName_txt;
public var more_btn:MoreGames;
public var saving_txt:save_txt;
public function upLoadUI(){
__setProp_more_btn_upLoadUI_Layer1_1();
}
function __setProp_more_btn_upLoadUI_Layer1_1(){
try {
more_btn["componentInspectorSetting"] = true;
} catch(e:Error) {
};
more_btn.position = "button_up";
more_btn.type = "moregames";
try {
more_btn["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 429
//well (well)
package {
import flash.display.*;
public dynamic class well extends MovieClip {
}
}//package
Section 430
//whiteBear (whiteBear)
package {
import tools.*;
public dynamic class whiteBear extends AnimalButton {
}
}//package
Section 431
//whiteCat (whiteCat)
package {
import tools.*;
public dynamic class whiteCat extends AnimalButton {
}
}//package
Section 432
//whiteHorse (whiteHorse)
package {
import tools.*;
public dynamic class whiteHorse extends AnimalButton {
}
}//package
Section 433
//whiteRabbit (whiteRabbit)
package {
import tools.*;
public dynamic class whiteRabbit extends AnimalButton {
}
}//package
Section 434
//whiteWolf (whiteWolf)
package {
import tools.*;
public dynamic class whiteWolf extends AnimalButton {
}
}//package
Section 435
//wolf_complete (wolf_complete)
package {
import flash.display.*;
public dynamic class wolf_complete extends MovieClip {
public var cloth:MovieClip;
public var tag_position:MovieClip;
public var eye:MovieClip;
public var mouth:MovieClip;
public var nose:MovieClip;
}
}//package
Section 436
//wolf_cut_1 (wolf_cut_1)
package {
import flash.display.*;
public dynamic class wolf_cut_1 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 437
//wolf_cut_2 (wolf_cut_2)
package {
import flash.display.*;
public dynamic class wolf_cut_2 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 438
//wolf_cut_3 (wolf_cut_3)
package {
import flash.display.*;
public dynamic class wolf_cut_3 extends MovieClip {
public var level:MovieClip;
}
}//package
Section 439
//wolf_decorate (wolf_decorate)
package {
import flash.display.*;
public dynamic class wolf_decorate extends MovieClip {
public var noseposition:MovieClip;
public var cloth:MovieClip;
public var eyeposition:MovieClip;
public var mouthposition:MovieClip;
}
}//package
Section 440
//wolf_fill (wolf_fill)
package {
import flash.display.*;
public dynamic class wolf_fill extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 441
//wolf_line1 (wolf_line1)
package {
import tools.*;
public dynamic class wolf_line1 extends Way {
}
}//package
Section 442
//wolf_line2 (wolf_line2)
package {
import tools.*;
public dynamic class wolf_line2 extends Way {
}
}//package
Section 443
//wolf_line3 (wolf_line3)
package {
import tools.*;
public dynamic class wolf_line3 extends Way {
}
}//package
Section 444
//wolf_out_1 (wolf_out_1)
package {
import tools.*;
public dynamic class wolf_out_1 extends OutMask {
}
}//package
Section 445
//wolf_out_2 (wolf_out_2)
package {
import tools.*;
public dynamic class wolf_out_2 extends OutMask {
}
}//package
Section 446
//wolf_out_3 (wolf_out_3)
package {
import tools.*;
public dynamic class wolf_out_3 extends OutMask {
}
}//package
Section 447
//wolf_sew (wolf_sew)
package {
import flash.display.*;
public dynamic class wolf_sew extends MovieClip {
public var cloth:MovieClip;
public var wolf_position1:MovieClip;
public var wolf_position2:MovieClip;
public var wolf_position3:MovieClip;
public var inside_2:MovieClip;
public var inside_3:MovieClip;
public var inside_1:MovieClip;
public var wolfsew1:MovieClip;
public var wolfsew2:MovieClip;
public var wolfsew3:MovieClip;
}
}//package
Section 448
//wolf_sew_1 (wolf_sew_1)
package {
import flash.display.*;
public dynamic class wolf_sew_1 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var wolf_startpoint_1:Point_movie;
public var level:MovieClip;
}
}//package
Section 449
//wolf_sew_2 (wolf_sew_2)
package {
import flash.display.*;
public dynamic class wolf_sew_2 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var wolf_startpoint_2:Point_movie;
public var level:MovieClip;
}
}//package
Section 450
//wolf_sew_3 (wolf_sew_3)
package {
import flash.display.*;
public dynamic class wolf_sew_3 extends MovieClip {
public var inside:MovieClip;
public var cloth:MovieClip;
public var position:MovieClip;
public var wolf_startpoint_3:Point_movie;
public var level:MovieClip;
}
}//package
Section 451
//wolf_sew_bitmap (wolf_sew_bitmap)
package {
import flash.display.*;
public dynamic class wolf_sew_bitmap extends MovieClip {
public var cloth:MovieClip;
}
}//package
Section 452
//yellow (yellow)
package {
import tools.*;
public dynamic class yellow extends PencilButton {
}
}//package
Section 453
//yes (yes)
package {
import tools.*;
public dynamic class yes extends SimpleButton {
}
}//package
Section 454
//yes_1 (yes_1)
package {
import zlong.display.*;
public dynamic class yes_1 extends TranText {
}
}//package
Section 455
//元件_1 (元件_1)
package {
import zlong.display.*;
public dynamic class 元件_1 extends TranText {
}
}//package
Section 456
//元件_2 (元件_2)
package {
import zlong.display.*;
public dynamic class 元件_2 extends TranText {
}
}//package
Section 457
//标题2 (æ ‡é¢˜2)
package {
import zlong.display.*;
public dynamic class 标题2 extends TranText {
}
}//package
Section 458
//泰迪文字1 (泰迪文å—1)
package {
import zlong.display.*;
public dynamic class 泰迪文字1 extends TranText {
}
}//package
Section 459
//泰迪文字10 (泰迪文å—10)
package {
import zlong.display.*;
public dynamic class 泰迪文字10 extends TranText {
}
}//package
Section 460
//泰迪文字2 (泰迪文å—2)
package {
import zlong.display.*;
public dynamic class 泰迪文字2 extends TranText {
}
}//package
Section 461
//泰迪文字3 (泰迪文å—3)
package {
import zlong.display.*;
public dynamic class 泰迪文字3 extends TranText {
}
}//package
Section 462
//泰迪文字4 (泰迪文å—4)
package {
import zlong.display.*;
public dynamic class 泰迪文字4 extends TranText {
}
}//package
Section 463
//泰迪文字5 (泰迪文å—5)
package {
import zlong.display.*;
public dynamic class 泰迪文字5 extends TranText {
}
}//package
Section 464
//泰迪文字6 (泰迪文å—6)
package {
import zlong.display.*;
public dynamic class 泰迪文字6 extends TranText {
}
}//package
Section 465
//泰迪文字7 (泰迪文å—7)
package {
import zlong.display.*;
public dynamic class 泰迪文字7 extends TranText {
}
}//package
Section 466
//泰迪文字8 (泰迪文å—8)
package {
import zlong.display.*;
public dynamic class 泰迪文字8 extends TranText {
}
}//package
Section 467
//泰迪文字9 (泰迪文å—9)
package {
import zlong.display.*;
public dynamic class 泰迪文字9 extends TranText {
}
}//package