final public class XClassBytesLoader extends EventDispatcher
{
private var loader:Loader;
private var Ǵ:String;
private var ǵ:Class;
private var Ƕ:URLStream;
private var Ƿ:ByteArray;
private var Ǹ:int = 32;
private var ǹ:int = 1;
private var Ǻ:Boolean;
private var ǻ:uint;
private var Ǽ:uint;
public static const CLASS_LOADED:String = "classLoaded";
public static const DOWNLOAD_IO_ERROR:String = "downloadError";
public static const DOWNLOAD_SECURITY_ERROR:String = "downloadError";
public static const LOAD_IO_ERROR:String = "loadIOError";
public static const LOAD_SECURITY_RROR:String = "loadSecurityError";
public function XClassBytesLoader()
{
Ƕ = new URLStream();
loader = new Loader();
loader.contentLoaderInfo.addEventListener("complete", ǿ);
loader.contentLoaderInfo.addEventListener("ioError", ǽ);
loader.contentLoaderInfo.addEventListener("securityError", Ǿ);
return;
}// end function
public function get bytesLoaded() : uint
{
return ǻ;
}// end function
public function get bytesTotal() : uint
{
return Ǽ;
}// end function
private function ǽ(event:Event) : void
{
Ǹ = 16 << ǹ;
dispatchEvent(new Event("loadIOError"));
return;
}// end function
private function Ǿ(event:Event) : void
{
Ǹ = 16 << ǹ;
dispatchEvent(new Event("loadSecurityError"));
return;
}// end function
public function load(param1:String, param2:Boolean = true) : void
{
ǻ = 0;
Ǽ = 0;
Ǻ = param2;
(Ǹ - 1);
if (Ǹ < 256)
{
Ǹ = Ǹ * (Ǹ / 2);
}
Ǵ = param1;
var _loc_3:* = new URLRequest(param1);
Ƕ.addEventListener("complete", ȁ);
Ƕ.addEventListener("ioError", Ȃ);
Ƕ.addEventListener("securityError", ȃ);
Ƕ.addEventListener("progress", Ȅ);
if (Ƿ == null)
{
Ƿ = new ByteArray();
}
Ƕ.load(_loc_3);
return;
}// end function
public function getClass(param1:String) : Class
{
try
{
var _loc_3:* = loader.contentLoaderInfo.applicationDomain.getDefinition(param1) as Class;
return _loc_3;
}
catch (e:Error)
{
}
return null;
}// end function
private function ǿ(event:Event) : void
{
dispatchEvent(new Event("classLoaded"));
return;
}// end function