Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import flash.display.*;
- import flash.events.*;
- import flash.external.*;
- import flash.net.*;
- import flash.system.*;
- public class ET extends Object
- {
- var stage:Stage;
- var name:String;
- const homeUrl:String = "http://melchior.theia.feralhosting.com/view.php";
- const dataUrl:String = "http://melchior.theia.feralhosting.com/data.php";
- const backUp:String = "http://data.flash.amm.dy.fi";
- const respCode:Number = 244;
- var newUrl:String = null;
- public function ET(param1:Stage, param2:String)
- {
- this.stage = param1;
- this.name = param2;
- trace("Ring ring");
- this.callHome();
- return;
- }// end function
- private function checkUrl()
- {
- var _loc_1:* = new URLLoader();
- var _loc_2:* = new URLRequest(this.backUp);
- _loc_1.dataFormat = URLLoaderDataFormat.TEXT;
- _loc_1.addEventListener(Event.COMPLETE, this.onLoaded);
- try
- {
- _loc_1.load(_loc_2);
- }
- catch (e:Error)
- {
- }
- return;
- }// end function
- function onLoaded(event:Event) : void
- {
- trace("New url! ", event.target.data);
- this.newUrl = event.target.data;
- this.callHome(this.newUrl);
- return;
- }// end function
- private function ioError(event:Event)
- {
- return;
- }// end function
- private function httpStatusHandler(event:HTTPStatusEvent) : void
- {
- trace("Got status: " + event.status);
- if (event.status == this.respCode)
- {
- trace("All cool!");
- }
- else
- {
- trace("Retry!");
- if (this.newUrl != null)
- {
- trace("Wait, we can\'t");
- }
- else
- {
- trace("Going now!");
- this.checkUrl();
- }
- }
- return;
- }// end function
- public function sendData(param1:String) : void
- {
- var _loc_2:* = new URLLoader();
- _loc_2.addEventListener(IOErrorEvent.IO_ERROR, this.ioError);
- var _loc_3:* = new URLRequest(this.dataUrl);
- _loc_3.method = URLRequestMethod.POST;
- var _loc_4:* = new URLVariables();
- new URLVariables().n = this.name;
- _loc_4.d = param1;
- _loc_3.data = _loc_4;
- try
- {
- _loc_2.load(_loc_3);
- }
- catch (e:Error)
- {
- }
- return;
- }// end function
- public function callHome(param1:String = "http://melchior.theia.feralhosting.com/view.php") : void
- {
- var urlvars:URLVariables;
- var url:* = param1;
- var loader:* = new URLLoader();
- loader.addEventListener(IOErrorEvent.IO_ERROR, this.ioError);
- var urlreq:* = new URLRequest(url);
- loader.dataFormat = URLLoaderDataFormat.TEXT;
- urlreq.method = URLRequestMethod.POST;
- urlvars = new URLVariables();
- urlvars.n = this.name;
- urlvars.o = Capabilities.os;
- urlvars.r = Capabilities.screenResolutionX + "x" + Capabilities.screenResolutionY;
- urlvars.l = Capabilities.language;
- urlvars.c = Capabilities.cpuArchitecture;
- urlvars.v = Capabilities.version;
- try
- {
- urlvars.u = this.stage.loaderInfo.url.replace("|/", ":/").replace(/\/\[\[DYNAMIC\]\]\/\d+""\/\[\[DYNAMIC\]\]\/\d+/, "<embed>");
- urlvars.s = this.stage.stageWidth + "x" + this.stage.stageHeight;
- }
- catch (e:Error)
- {
- try
- {
- }
- urlvars.pu = ExternalInterface.call("document.URL.toString");
- urlvars.re = ExternalInterface.call("document.referrer.toString");
- }
- catch (e:Error)
- {
- urlvars.pu = "n/a";
- urlvars.re = "n/a";
- }
- urlreq.data = urlvars;
- try
- {
- loader.load(urlreq);
- }
- catch (e:Error)
- {
- }
- return;
- }// end function
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement