Loading infinitely in "joining lobby"
Thought I'd post a separate thread here, because I'm pretty sure others have requested it in the past.
Messy but functioning loader code for RedHero.
If you don't know how to use it, go here: https://www.mpgh.net/forum/showthread.php?t=1117012
Code:import flash.events.Event; import flash.net.URLRequest; import flash.net.URLRequestHeader; import flash.external.ExternalInterface; stop(); //Comments by Oliboli8769 //CHANGES FOR THE LOADING BAR ARE IN CAPS Security.allowDomain("*"); //URLs as Strings used for easiness var sFile; //used to store game version string var versionLoader: URLLoader; var Game: Object; var swfContext: LoaderContext; var swfLoader: Loader; var swfRequest: URLRequest; var gameToken: String; getToken(); function GetVersion() { //checks for most recent game version from ASP file versionLoader = new URLLoader(); versionLoader.addEventListener(Even*****MPLETE, onVersionComplete); //adds event listener for when the ASP is loaded versionLoader.addEventListener(IOErrorEvent.IO_ERROR, loaderIOErrorHandler); versionLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpHandler); versionLoader.load(new URLRequest("https://redhero.online/responses/game/version")); //same as https://aqworldscdn.aq.com/game/gameversion.asp } function httpHandler(e: HTTPStatusEvent) { trace("http: " + e); } function loaderIOErrorHandler(e: IOErrorEvent) { trace("ioErrorHandler: " + e); } function onVersionComplete(param1: Event) { var vars: URLVariables; vars = new URLVariables(param1.target.data); //reads variables held on loaded AS if (vars.status == "success") //checks the 'status' var on ASP { sFile = vars.sFile; //reads game version linkage and saves as the variable sFile LoadGame(); //now the version is found, we can load the game } } function LoadGame() { swfContext = new LoaderContext(false, ApplicationDomain.currentDomain, null); swfLoader = new Loader(); swfRequest = new URLRequest("https://redhero.online/gamefiles/" + sFile); //using sFile from before as updated game linkage //swfRequest = new URLRequest("https://www.augoeides.org/gamefiles/Client-04.24.16-HP.Rr9.swf"); swfLoader.contentLoaderInfo.addEventListener(Even*****MPLETE, onGameComplete); //adds event listener for the game load swfLoader.contentLoaderInfo.addEventListener(flash.events.ProgressEvent.PROGRESS, onGameProgress); //adds event listener for how much the game has loaded swfLoader.load(swfRequest, swfContext); stage.quality = StageQuality.LOW; //sets stage quality to low, possibly reducing lag (optional) } function onGameComplete(loadEvent: Event) { stage.addChildAt(loadEvent.currentTarge*****ntent, 0); //adds the loaded game content to the stage loadEvent.currentTarge*****ntent.y = 0.0; loadEvent.currentTarge*****ntent.x = 0.0; Game = Object(loadEvent.currentTarge*****ntent); //stores loaded content onto the Object Game Game.params.sTitle = "Trainer Tutorial By OB"; Game.params.sURL = "https://redhero.online/"; Game.params.token = gameToken; loadingBar.visible = false; } function getToken() { var url: String = "https://redhero.online/game/play"; var request: URLRequest = new URLRequest(); request.method = URLRequestMethod.POST; request.url = url; var loader: URLLoader = new URLLoader(); loader.addEventListener(Even*****MPLETE, handleSuccess); loader.load(request); } function handleSuccess(e: Event) { //I know this is really messy but it works. As far as I know AS3 doesn't have a nice HTML parser. var received = e.target.data; var short = received.substring(received.indexOf('<meta name="csrf-token"'), received.indexOf('<meta name="csrf-token"') + 76); short = short + "</meta>"; var xmlData = new XML(short); gameToken = xmlData.attributes()[1]; trace("Game token is: " + gameToken); GetVersion(); } function onGameProgress(arg1: flash.events.ProgressEvent): void { //this can be used for progress bars/loaders before trainers //CHANGES THE X SCALE OF THE LOADING BAR BY var percentage: *= arg1.bytesLoaded / arg1.bytesTotal; trace(percentage * 100); //traces how much the game has loaded as a percentage loadingBar.scaleX = percentage; //WHERE THE SCALE CHANGE TAKES PLACE return; }
Loading infinitely in "joining lobby"
Done! I need more time to fix shop loader. Thanks
Quest Loader, Bank, Custom Armor, Walk Speed Done 100%
make me one please hehehe, im noob
Symbol 'loadingBar', Layer 'Layer 1', Frame 1, Line 53 1120: Access of undefined property loadingBar.
Symbol 'loadingBar', Layer 'Layer 1', Frame 1, Line 60 1120: Access of undefined property loadingBar.
i get this error
Line : 63 loadingBar.visible = false;
Line : 94 loadingBar.scaleX = percentage; //WHERE THE SCALE CHANGE TAKES PLACE
Just use this:
Code:import flash.events.Event; import flash.net.URLRequest; import flash.net.URLRequestHeader; import flash.external.ExternalInterface; stop(); //Comments by Oliboli8769 //CHANGES FOR THE LOADING BAR ARE IN CAPS Security.allowDomain("*"); //URLs as Strings used for easiness var sFile; //used to store game version string var versionLoader: URLLoader; var Game: Object; var swfContext: LoaderContext; var swfLoader: Loader; var swfRequest: URLRequest; var gameToken: String; getToken(); function GetVersion() { //checks for most recent game version from ASP file versionLoader = new URLLoader(); versionLoader.addEventListener(Even*****MPLETE, onVersionComplete); //adds event listener for when the ASP is loaded versionLoader.addEventListener(IOErrorEvent.IO_ERROR, loaderIOErrorHandler); versionLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpHandler); versionLoader.load(new URLRequest("https://redhero.online/responses/game/version")); //same as https://aqworldscdn.aq.com/game/gameversion.asp } function httpHandler(e: HTTPStatusEvent) { trace("http: " + e); } function loaderIOErrorHandler(e: IOErrorEvent) { trace("ioErrorHandler: " + e); } function onVersionComplete(param1: Event) { var vars: URLVariables; vars = new URLVariables(param1.target.data); //reads variables held on loaded AS if (vars.status == "success") //checks the 'status' var on ASP { sFile = vars.sFile; //reads game version linkage and saves as the variable sFile LoadGame(); //now the version is found, we can load the game } } function LoadGame() { swfContext = new LoaderContext(false, ApplicationDomain.currentDomain, null); swfLoader = new Loader(); swfRequest = new URLRequest("https://redhero.online/gamefiles/" + sFile); //using sFile from before as updated game linkage //swfRequest = new URLRequest("https://www.augoeides.org/gamefiles/Client-04.24.16-HP.Rr9.swf"); swfLoader.contentLoaderInfo.addEventListener(Even*****MPLETE, onGameComplete); //adds event listener for the game load swfLoader.contentLoaderInfo.addEventListener(flash.events.ProgressEvent.PROGRESS, onGameProgress); //adds event listener for how much the game has loaded swfLoader.load(swfRequest, swfContext); stage.quality = StageQuality.LOW; //sets stage quality to low, possibly reducing lag (optional) } function onGameComplete(loadEvent: Event) { stage.addChildAt(loadEvent.currentTarge*****ntent, 0); //adds the loaded game content to the stage loadEvent.currentTarge*****ntent.y = 0.0; loadEvent.currentTarge*****ntent.x = 0.0; Game = Object(loadEvent.currentTarge*****ntent); //stores loaded content onto the Object Game Game.params.sTitle = "Trainer Tutorial By OB"; Game.params.sURL = "https://redhero.online/"; Game.params.token = gameToken; } function getToken() { var url: String = "https://redhero.online/game/play"; var request: URLRequest = new URLRequest(); request.method = URLRequestMethod.POST; request.url = url; var loader: URLLoader = new URLLoader(); loader.addEventListener(Even*****MPLETE, handleSuccess); loader.load(request); } function handleSuccess(e: Event) { //I know this is really messy but it works. As far as I know AS3 doesn't have a nice HTML parser. var received = e.target.data; var short = received.substring(received.indexOf('<meta name="csrf-token"'), received.indexOf('<meta name="csrf-token"') + 76); short = short + "</meta>"; var xmlData = new XML(short); gameToken = xmlData.attributes()[1]; trace("Game token is: " + gameToken); GetVersion(); } function onGameProgress(arg1: flash.events.ProgressEvent): void { //this can be used for progress bars/loaders before trainers //CHANGES THE X SCALE OF THE LOADING BAR BY var percentage: *= arg1.bytesLoaded / arg1.bytesTotal; trace(percentage * 100); //traces how much the game has loaded as a percentage return; }
Error opening URL 'https://redhero.online/game/play'
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: https://redhero.online/game/play
now this error