home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 150
/
MOBICLIC150.ISO
/
pc
/
DATA
/
HOTE
/
launcher_as3
/
launcher.swf
/
scripts
/
com
/
milanpresse
/
launcher
/
HoteAS2.as
< prev
next >
Wrap
Text File
|
2012-12-18
|
5KB
|
161 lines
package com.milanpresse.launcher
{
import flash.display.DisplayObjectContainer;
import flash.display.Loader;
import flash.errors.IOError;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.net.URLRequest;
import mx.utils.UIDUtil;
public class HoteAS2
{
private var _callback:Function = null;
private var _callback_load:Function = null;
private var _callback_start:Function = null;
private var _callback_getConfig:Function = null;
private var _loader:Loader;
private var _localConnection:HoteAS2LocalConnection;
private var _mainMC;
private var _moduleController:CapsuleAlgo;
public function HoteAS2(param1:CapsuleAlgo, param2:Function)
{
super();
this._moduleController = param1;
this._callback = param2;
this.init();
}
private function init() : void
{
this._loader = new Loader();
this._loader.contentLoaderInfo.addEventListener(Event.INIT,this.loaderInitHandler);
this._loader.contentLoaderInfo.addEventListener(Event.COMPLETE,this.loaderCompleteHandler);
this._loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,this.ioErrorHandler);
var _loc1_:String = UIDUtil.createUID();
this._localConnection = new HoteAS2LocalConnection(this);
this._localConnection.connect(_loc1_);
this._loader.load(new URLRequest("DATA/HOTE/host_as2/bin/host_as2.swf?lc=" + _loc1_));
}
private function ioErrorHandler(param1:IOErrorEvent) : void
{
this._loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,this.ioErrorHandler);
throw new IOError(param1.text);
}
private function loaderInitHandler(param1:Event) : void
{
this._loader.contentLoaderInfo.removeEventListener(Event.INIT,this.loaderInitHandler);
}
private function loaderCompleteHandler(param1:Event) : void
{
this._loader.contentLoaderInfo.removeEventListener(Event.INIT,this.loaderInitHandler);
this._loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,this.ioErrorHandler);
this._loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,this.loaderCompleteHandler);
this._mainMC = this._loader;
}
public function hostIsInitialized() : void
{
this._callback();
}
public function changeModule(param1:Object = null) : void
{
this._moduleController.changeModule(param1);
}
public function print(param1:Object = null) : void
{
this._moduleController.print(param1);
}
public function moduleIsInit(param1:Object = null) : void
{
this._moduleController.moduleIsInit();
}
public function moduleStart(param1:Function) : void
{
this._localConnection.send("moduleStart");
}
public function moduleIsStart(param1:Object = null) : void
{
this._moduleController.moduleIsStart();
}
public function moduleAnimIsInit(param1:Object = null) : void
{
this._moduleController.moduleAnimIsInit();
}
public function getModuleConfig(param1:Function) : void
{
this._callback_getConfig = param1;
this._localConnection.send("getModuleConfig");
}
public function getModuleConfigReturn(param1:Object = null) : void
{
this._callback_getConfig(param1);
}
public function addToParent(param1:DisplayObjectContainer) : void
{
param1.addChild(this._mainMC);
}
public function removeFromParent() : void
{
if(this._mainMC.parent != null)
{
this._mainMC.parent.removeChild(this._mainMC);
}
}
public function loadModule(param1:Object, param2:Function) : void
{
this._callback_load = param2;
this._localConnection.send("setModule",null,param1);
}
public function set musicOn(param1:Boolean) : void
{
this._localConnection.send("musicOn",null,param1);
}
public function set subtitlesOn(param1:Boolean) : void
{
this._localConnection.send("subtitlesOn",null,param1);
}
public function closeModule() : void
{
this._localConnection.send("closeModule",null);
}
public function sleepModule() : void
{
this._localConnection.send("sleepModule",null);
}
public function wakeModule() : void
{
this._localConnection.send("wakeModule",null);
}
}
}