@THESANNIN
Code:
package Loader_20180525a_fla
{
import flash.display.Loader;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
import flash.system.Security;
public dynamic class MainTimeline extends MovieClip
{
public var mcLoading:MovieClip;
public var sFile;
public var sTitle;
public var sBG:String;
public var sURL:String;
public var isWeb:Boolean;
public var doSignup:Boolean;
public var isEU:Boolean;
public var loginURL;
public var versionURL:String;
public var loader:URLLoader;
public var loaderVars;
public var titleDomain:ApplicationDomain;
public function MainTimeline()
{
super();
addFrameScript(0,this.frame1);
}
public function onDataComplete(evt:Event) : void
{
trace("onDataComplete:" + evt.target.data);
var vars:URLVariables = new URLVariables(evt.target.data);
if(vars.status == "success")
{
this.sFile = vars.sFile;
this.sTitle = vars.sTitle;
this.sBG = vars.sBG;
this.isEU = vars.isEU == "true";
trace("FlugelHorn = " + this.isEU);
this.loginURL = vars.LoginURL;
this.loaderVars = vars;
this.loadTitle();
}
else
{
trace(vars.strReason);
}
}
public function loadTitle() : void
{
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Even*****MPLETE,this.onTitleComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,this.onTitleError);
loader.load(new URLRequest(this.sURL + "gamefiles/title/" + this.sBG),new LoaderContext(false,this.titleDomain));
}
public function onTitleComplete(e:Event) : void
{
trace("Title Loaded");
this.loadGame();
}
public function onTitleError(e:IOErrorEvent) : void
{
Loader(e.target.loader).removeEventListener(IOErrorEvent.IO_ERROR,this.onTitleError);
trace("Title Loading Error: " + e);
this.loadGame();
}
public function loadGame() : void
{
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,this.onProgress);
loader.contentLoaderInfo.addEventListener(Even*****MPLETE,this.onComplete);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,this.onError);
loader.load(new URLRequest(this.sURL + "gamefiles/" + this.sFile));
this.mcLoading.strLoad.text = "Loading 0%";
}
public function onProgress(evt:ProgressEvent) : void
{
var percent:int = evt.currentTarget.bytesLoaded / evt.currentTarget.bytesTotal * 100;
this.mcLoading.strLoad.text = "Loading " + percent + "%";
}
public function onComplete(e:Event) : void
{
var stg:* = stage;
stg.removeChildAt(0);
var game:* = stg.addChild(MovieClip(Loader(e.target.loader).content));
game.params.sTitle = this.sTitle;
game.params.vars = this.loaderVars;
game.params.isWeb = this.isWeb;
game.params.sURL = this.sURL;
game.params.sBG = this.sBG;
game.params.isEU = this.isEU;
game.params.doSignup = this.doSignup;
game.params.loginURL = this.loginURL;
trace("Game ISWEB? " + game.params.isWeb);
trace("Game.isEU = " + game.params.isEU);
game.titleDomain = this.titleDomain;
}
public function onError(e:IOErrorEvent) : void
{
trace("Preloader IOError: " + e);
Loader(e.target.loader).removeEventListener(IOErrorEvent.IO_ERROR,this.onError);
}
function frame1() : *
{
Security.allowDomain("*.aq.com");
Security.allowDomain("*.aqworlds.com");
stop();
this.sURL = this.loaderInfo.url.substring(0,this.loaderInfo.url.lastIndexOf("gamefiles/"));
this.isWeb = false;
this.doSignup = false;
this.isEU = false;
this.loginURL = "https://game.aq.com/game/cf-userlogin.asp";
try
{
this.isWeb = root.loaderInfo.parameters.isweb == "true";
this.doSignup = root.loaderInfo.parameters.dosignup == "true";
trace("isWeb? " + this.isWeb + " doSignup=" + this.doSignup);
}
catch(e:Error)
{
trace("standalone");
isWeb = false;
doSignup = false;
}
this.versionURL = "gameversion.asp?ver=" + Math.random();
this.versionURL = this.sURL + this.versionURL;
trace("versionURL: " + this.versionURL);
this.loader = new URLLoader();
this.loader.addEventListener(Even*****MPLETE,this.onDataComplete);
this.loader.load(new URLRequest(this.versionURL));
this.titleDomain = new ApplicationDomain();
}
}
}
Good to see you trying to make something.
Here is the official game's loader code decompiled. I found this using an SWF decompiler called FFDec.
If you compare this official loader code, to the loader code you're using, you'll notice several differences.
You can't copy/paste this official loader code exactly, but you can see what's new in it - the clue is in the parameters being set when the game has loaded.
I haven't touched this code in a long time, but there are a few new ones that you'll want to try to include, e.g:
Code:
game.params.isWeb = this.isWeb;
game.params.sBG = this.sBG;
game.params.isEU = this.isEU;
I can remember it was one of these parameters that stopped that "download AE launcher" message.
Good luck and if you still struggle, I'll happily try whip up a working loader for you, but this is probably a good place for you to learn instead