74 lines
2.1 KiB
ActionScript
74 lines
2.1 KiB
ActionScript
package com
|
|
{
|
|
import com.comfig.PathConfig;
|
|
import com.control.ConnectService;
|
|
import com.view.ui.login.LoginUI;
|
|
import flash.display.Sprite;
|
|
import flash.display.StageAlign;
|
|
import flash.display.StageScaleMode;
|
|
import flash.events.Event;
|
|
import flash.net.URLLoader;
|
|
import flash.net.URLRequest;
|
|
|
|
public class Main extends Sprite
|
|
{
|
|
|
|
private var xml:String = "xml/resource.xml";
|
|
|
|
private var urlloader:URLLoader;
|
|
|
|
private var verson:String;
|
|
|
|
public function Main()
|
|
{
|
|
super();
|
|
if(stage)
|
|
{
|
|
this.init();
|
|
}
|
|
else
|
|
{
|
|
addEventListener(Event.ADDED_TO_STAGE,this.init);
|
|
}
|
|
}
|
|
|
|
private function init(param1:Event = null) : void
|
|
{
|
|
removeEventListener(Event.ADDED_TO_STAGE,this.init);
|
|
stage.scaleMode = StageScaleMode.NO_SCALE;
|
|
stage.align = StageAlign.TOP_LEFT;
|
|
var _loc2_:Object = root.loaderInfo.parameters;
|
|
if(_loc2_["verson"] != null)
|
|
{
|
|
this.verson = _loc2_["verson"];
|
|
}
|
|
else
|
|
{
|
|
this.verson = "";
|
|
}
|
|
PathConfig.getInstance().setVerson(this.verson);
|
|
this.loadXML();
|
|
}
|
|
|
|
private function loadXML() : void
|
|
{
|
|
this.urlloader = new URLLoader(new URLRequest(this.xml));
|
|
this.urlloader.addEventListener(Event.COMPLETE,this.loadedXmlComplete);
|
|
}
|
|
|
|
private function loadedXmlComplete(param1:Event) : void
|
|
{
|
|
this.urlloader.removeEventListener(Event.COMPLETE,this.loadedXmlComplete);
|
|
this.urlloader = null;
|
|
PathConfig.getInstance().Init(XML(param1.target.data));
|
|
InstallFace.getInstance().stage = stage;
|
|
var _loc2_:LoginUI = new LoginUI();
|
|
ConnectService.getInstance();
|
|
InstallFace.getInstance().addMc(_loc2_);
|
|
_loc2_.x = int(InstallFace.getInstance().stage.stageWidth / 2);
|
|
_loc2_.y = int(InstallFace.getInstance().stage.stageHeight / 2);
|
|
}
|
|
}
|
|
}
|
|
|