home *** CD-ROM | disk | FTP | other *** search
- package com.memecounter
- {
- import flash.display.*;
- import flash.events.*;
- import flash.net.*;
- import flash.system.*;
- import flash.utils.*;
-
- public class Tracker
- {
-
- private static var ori_dom:String;
-
- private static var lurl:String;
-
- private static var _isReady:Boolean = false;
-
- public static var a:uint = 0;
-
- public static var root:DisplayObject;
-
- public static var c:uint;
-
- public static var d:String = "";
-
- private static var _isInited:Boolean = false;
-
- public static var fpv:String = "";
-
- private static var l:Loader;
-
- private static var tracker:MovieClip;
-
- public static var da:Array = ["distralytics.com","distralytics.co.uk"];
-
-
- public function Tracker()
- {
- super();
- }
-
- private static function loadError(param1:Event) : void
- {
- ++a;
- lc();
- }
-
- public static function init(param1:DisplayObject, param2:uint) : void
- {
- var _loc3_:uint = 0;
- if(!_isInited)
- {
- _isInited = true;
- root = param1;
- Tracker.c = param2;
- _loc3_ = 0;
- while(_loc3_ < da.length)
- {
- Security.allowDomain(da[_loc3_],param2 + ".c." + da[_loc3_],"*." + da[_loc3_]);
- _loc3_++;
- }
- ori_dom = root.hasOwnProperty("ori_dom") ? String(root["ori_dom"]) : "";
- d = ori_dom != "" ? ori_dom : (root.loaderInfo.loaderURL.split("/")[0].indexOf("http") == -1 ? "Local" : String(root.loaderInfo.loaderURL.split("/")[2].split("?")[0]));
- fpv = Capabilities.version.split(" ")[1].split(",")[0];
- lurl = "/control/tracking/trackerAS3.swf" + "?c=" + param2 + "&r=" + Math.floor(Math.random() * 10000000000) + "&d=" + d + "&p=" + fpv + "&as=3";
- l = new Loader();
- l.contentLoaderInfo.addEventListener(Event.INIT,loadComplete);
- l.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,loadError);
- lc();
- }
- }
-
- public static function get isReady() : Boolean
- {
- return isReady;
- }
-
- public static function kvClick(param1:uint) : void
- {
- if(_isReady)
- {
- tracker.kvClick(param1);
- }
- }
-
- public static function kvCountry() : String
- {
- if(_isReady)
- {
- return tracker.kvCountry();
- }
- return "";
- }
-
- public static function kvEvent(param1:uint) : void
- {
- if(_isReady)
- {
- tracker.kvEvent(param1);
- }
- }
-
- private static function lc() : void
- {
- var _loc1_:String = "http://" + c + ".c." + da[a % da.length] + lurl;
- Security.allowDomain(_loc1_);
- l.load(new URLRequest(_loc1_));
- }
-
- private static function loadComplete(param1:Event) : void
- {
- tracker = param1.target.content;
- tracker.init(getDefinitionByName("com.memecounter.Tracker"),root);
- _isReady = true;
- }
- }
- }
-