Section 1
//ApplicationLoader (fizzy.ApplicationLoader)
package fizzy {
import flash.events.*;
import flash.display.*;
import flash.system.*;
import flash.net.*;
public class ApplicationLoader extends Sprite {
private var loader:Loader;
private var initObject:Object;
public static const FIZZY_DOMAIN:String = "http://www.fizzy.com";
private static const GAME_NAME:String = "orion_defence_network";
public static const REMOTE_DOMAIN:String = "http://www.fizzy.com";
public static const FRAMEWORK_REMOTE_URL:String = (FIZZY_DOMAIN + "/swf/fizzy_framework.swf");
public static const FRAMEWORK_HOSTED_URL:String = (FIZZY_DOMAIN + "/swf/fizzy_framework.swf");
public function ApplicationLoader(){
Security.allowDomain("*");
this.initialize();
}
private function initializeFramework(_arg1:Event){
trace(("Game: " + this.initObject.gameName), _slot1.GAME_NAME);
(loader.content as Object).initialize(this.initObject);
}
public function initialize(){
var _local1:Number;
var _local2:URLRequest;
var _local3:RegExp;
var _local4:String;
if (_slot1.GAME_NAME.charAt(0) == "<"){
this.initObject = this.loaderInfo.parameters;
} else {
_local3 = /^(\w+)(\:\/\/)(\/*)([^\/]+)(\/*)(.*)$/i;
_local4 = this.loaderInfo.url.replace(_local3, "$1$2$3$4");
this.initObject = {gameName:_slot1.GAME_NAME, hostDomain:_local4, user_id:0, load_seed:""};
};
_local1 = Math.floor((Math.random() * 1000));
_local2 = new URLRequest(((_slot1.FRAMEWORK_HOSTED_URL + "?r=") + _local1));
this.loader = new Loader();
this.loader.load(_local2);
this.loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.initializeFramework);
this.addChild(this.loader);
}
}
}//package fizzy