mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-20 09:37:50 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,154 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import flash.events.EventDispatcher;
|
||||
|
||||
public class BaseFileServer extends EventDispatcher
|
||||
{
|
||||
|
||||
private var _contentPath:String;
|
||||
|
||||
private var _loaderArray:Array;
|
||||
|
||||
private var _cacheArray:Array;
|
||||
|
||||
public function BaseFileServer(param1:String)
|
||||
{
|
||||
super();
|
||||
this._contentPath = param1;
|
||||
this._loaderArray = new Array();
|
||||
this._cacheArray = new Array();
|
||||
}
|
||||
|
||||
public function updatePath(param1:String) : void
|
||||
{
|
||||
this._contentPath = param1;
|
||||
}
|
||||
|
||||
public function clearFromCache(param1:String, param2:int) : void
|
||||
{
|
||||
if(this._cacheArray[param1])
|
||||
{
|
||||
if(this._cacheArray[param1][param2])
|
||||
{
|
||||
delete this._cacheArray[param1][param2];
|
||||
}
|
||||
}
|
||||
if(this._loaderArray[param1])
|
||||
{
|
||||
if(this._loaderArray[param1][param2])
|
||||
{
|
||||
delete this._loaderArray[param1][param2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function requestFile(param1:uint, param2:Boolean = false, param3:int = 0, param4:Boolean = true) : void
|
||||
{
|
||||
var _loc5_:LoaderCacheEntry_URL = null;
|
||||
if(param2 || this.getFromCache(param1) == false)
|
||||
{
|
||||
if(!(this._loaderArray[this._contentPath] ? this._loaderArray[this._contentPath][param1] : false))
|
||||
{
|
||||
_loc5_ = new LoaderCacheEntry_URL(this._contentPath + param1,false);
|
||||
_loc5_.id = param1;
|
||||
_loc5_.contentType = param3;
|
||||
_loc5_.addEventListener(LoaderEvent.ON_LOAD_COMPLETE,this.onResultGetData);
|
||||
_loc5_.load("binary",param4);
|
||||
if(this._loaderArray[this._contentPath] == null)
|
||||
{
|
||||
this._loaderArray[this._contentPath] = [];
|
||||
}
|
||||
this._loaderArray[this._contentPath][param1] = {
|
||||
"l":_loc5_,
|
||||
"c":1
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
++this._loaderArray[this._contentPath][param1].c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function requestFiles(param1:Array) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < param1.length)
|
||||
{
|
||||
this.requestFile(param1[_loc2_]);
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
|
||||
private function getFromCache(param1:uint) : Boolean
|
||||
{
|
||||
var _loc2_:Object = this.searchCache(param1);
|
||||
if(_loc2_)
|
||||
{
|
||||
this.newEvent(_loc2_.id,_loc2_.data,true,_loc2_.contentType);
|
||||
}
|
||||
return _loc2_ == null ? false : true;
|
||||
}
|
||||
|
||||
private function searchCache(param1:uint) : Object
|
||||
{
|
||||
return this._cacheArray[this._contentPath] ? this._cacheArray[this._contentPath][param1] : null;
|
||||
}
|
||||
|
||||
private function onResultGetData(param1:LoaderEvent) : void
|
||||
{
|
||||
var _loc5_:* = 0;
|
||||
var _loc2_:FileServerEvent = new FileServerEvent(FileServerEvent.ON_NEW_DATA);
|
||||
_loc2_.id = param1.entry.id;
|
||||
_loc2_.contentType = param1.entry.contentType;
|
||||
var _loc3_:Object = param1.entry.data;
|
||||
if(_loc3_ == null)
|
||||
{
|
||||
_loc2_.success = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_.data = _loc3_;
|
||||
if(this._cacheArray[this._contentPath] == null)
|
||||
{
|
||||
this._cacheArray[this._contentPath] = [];
|
||||
}
|
||||
this._cacheArray[this._contentPath][_loc2_.id] = {
|
||||
"id":_loc2_.id,
|
||||
"data":_loc3_,
|
||||
"contentType":_loc2_.contentType
|
||||
};
|
||||
}
|
||||
var _loc4_:Object = this._loaderArray[this._contentPath][_loc2_.id];
|
||||
if(_loc4_)
|
||||
{
|
||||
_loc4_.l.removeEventListener(LoaderEvent.ON_LOAD_COMPLETE,this.onResultGetData);
|
||||
_loc5_ = int(_loc4_.c);
|
||||
this._loaderArray[this._contentPath][_loc2_.id] = null;
|
||||
while(_loc5_-- > 0)
|
||||
{
|
||||
this.newEvent(_loc2_.id,_loc2_.data,_loc2_.success,_loc2_.contentType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function newEvent(param1:int, param2:*, param3:Boolean, param4:int = 0) : void
|
||||
{
|
||||
var _loc5_:FileServerEvent = new FileServerEvent(FileServerEvent.ON_NEW_DATA);
|
||||
_loc5_.id = param1;
|
||||
_loc5_.data = param2;
|
||||
_loc5_.success = param3;
|
||||
_loc5_.contentType = param4;
|
||||
dispatchEvent(_loc5_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SingletonLock
|
||||
{
|
||||
|
||||
public function SingletonLock()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class FileServerEvent extends Event
|
||||
{
|
||||
|
||||
public static const ON_NEW_DATA:String = "OnNewData";
|
||||
|
||||
public static const JSON_TYPE:int = 0;
|
||||
|
||||
public static const PLAIN_TEXT_TYPE:int = 1;
|
||||
|
||||
public static const AMF3_TYPE:int = 2;
|
||||
|
||||
public var id:uint;
|
||||
|
||||
public var data:*;
|
||||
|
||||
public var success:Boolean = true;
|
||||
|
||||
public var contentType:int = 0;
|
||||
|
||||
public function FileServerEvent(param1:String)
|
||||
{
|
||||
super(param1);
|
||||
}
|
||||
|
||||
override public function clone() : Event
|
||||
{
|
||||
return new FileServerEvent(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
public interface IResourceStackable
|
||||
{
|
||||
|
||||
function init(param1:Function) : void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class ImageServerEvent extends Event
|
||||
{
|
||||
|
||||
public static const ON_NEW_DATA:String = "OnNewData";
|
||||
|
||||
public static const ON_GLOBAL_PALETTE:String = "OnGlobalPalette";
|
||||
|
||||
public var id:uint;
|
||||
|
||||
public var layer:int;
|
||||
|
||||
public var imageData:*;
|
||||
|
||||
public var versionNum:int;
|
||||
|
||||
public var genericData:*;
|
||||
|
||||
public var frames:int;
|
||||
|
||||
public var success:Boolean = true;
|
||||
|
||||
public function ImageServerEvent(param1:String)
|
||||
{
|
||||
super(param1);
|
||||
}
|
||||
|
||||
override public function clone() : Event
|
||||
{
|
||||
return new ImageServerEvent(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import com.sbi.graphics.ImageArray;
|
||||
import com.sbi.graphics.ImageArrayHelper;
|
||||
import com.sbi.graphics.PaletteHelper;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
public class ImageServerURL extends EventDispatcher
|
||||
{
|
||||
|
||||
private static var _instance:ImageServerURL;
|
||||
|
||||
private static const IMAGE_ARRAY_PATH:String = "imageArrays/";
|
||||
|
||||
private static const PALETTE_NAME:String = "paletteData";
|
||||
|
||||
private var _imageCacheArray:Array;
|
||||
|
||||
private var _loaderCacheArray:Array;
|
||||
|
||||
private var _layerInfo:Object;
|
||||
|
||||
public function ImageServerURL(param1:Class)
|
||||
{
|
||||
super();
|
||||
if(param1 != SingletonLock)
|
||||
{
|
||||
throw new Error("Invalid Singleton access. Use ImageServerURL.instance.");
|
||||
}
|
||||
this._imageCacheArray = new Array();
|
||||
this._loaderCacheArray = new Array();
|
||||
}
|
||||
|
||||
public static function get instance() : ImageServerURL
|
||||
{
|
||||
if(!_instance)
|
||||
{
|
||||
_instance = new ImageServerURL(SingletonLock);
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
|
||||
public function set layerInfo(param1:Object) : void
|
||||
{
|
||||
this._layerInfo = param1;
|
||||
}
|
||||
|
||||
public function getLayerIndex(param1:int) : int
|
||||
{
|
||||
return this._layerInfo[param1];
|
||||
}
|
||||
|
||||
public function requestGlobalPalette() : void
|
||||
{
|
||||
var _loc1_:ImageServerEvent = null;
|
||||
var _loc2_:LoaderCacheEntry_URL = null;
|
||||
if(this.isGlobalPaletteCached())
|
||||
{
|
||||
_loc1_ = new ImageServerEvent(ImageServerEvent.ON_GLOBAL_PALETTE);
|
||||
_loc1_.imageData = null;
|
||||
dispatchEvent(_loc1_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = new LoaderCacheEntry_URL(PALETTE_NAME);
|
||||
_loc2_.addEventListener(LoaderEvent.ON_LOAD_COMPLETE,this.onResultGetGamePalette);
|
||||
_loc2_.load();
|
||||
this._loaderCacheArray["palette"] = {"l":_loc2_};
|
||||
}
|
||||
}
|
||||
|
||||
public function requestImage(param1:uint, param2:Boolean = true) : void
|
||||
{
|
||||
var _loc3_:LoaderCacheEntry_URL = null;
|
||||
if(!param2 || this.getFromCache(param1) == false)
|
||||
{
|
||||
if(!this._loaderCacheArray[param1])
|
||||
{
|
||||
_loc3_ = new LoaderCacheEntry_URL(IMAGE_ARRAY_PATH + param1);
|
||||
_loc3_.id = param1;
|
||||
_loc3_.addEventListener(LoaderEvent.ON_LOAD_COMPLETE,this.onResultGetImageData);
|
||||
_loc3_.load();
|
||||
this._loaderCacheArray[param1] = {
|
||||
"l":_loc3_,
|
||||
"c":1
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
++this._loaderCacheArray[param1].c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function requestImages(param1:Array) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
while(_loc2_ < param1.length)
|
||||
{
|
||||
this.requestImage(param1[_loc2_]);
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
|
||||
private function getFromCache(param1:uint) : Boolean
|
||||
{
|
||||
var _loc3_:ImageServerEvent = null;
|
||||
var _loc2_:Object = this.searchCache(param1);
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc3_ = new ImageServerEvent(ImageServerEvent.ON_NEW_DATA);
|
||||
_loc3_.id = _loc2_.id;
|
||||
_loc3_.imageData = _loc2_.imageData;
|
||||
_loc3_.frames = _loc2_.frames;
|
||||
_loc3_.layer = _loc2_.layer;
|
||||
_loc3_.success = _loc3_.imageData == null ? false : true;
|
||||
dispatchEvent(_loc3_);
|
||||
}
|
||||
return _loc2_ == null ? false : true;
|
||||
}
|
||||
|
||||
private function isGlobalPaletteCached() : Boolean
|
||||
{
|
||||
return Boolean(PaletteHelper.gamePalette);
|
||||
}
|
||||
|
||||
private function searchCache(param1:uint) : Object
|
||||
{
|
||||
return this._imageCacheArray[param1];
|
||||
}
|
||||
|
||||
private function onResultGetGamePalette(param1:LoaderEvent) : void
|
||||
{
|
||||
var _loc2_:ImageServerEvent = null;
|
||||
var _loc3_:ByteArray = null;
|
||||
var _loc4_:ByteArray = null;
|
||||
var _loc5_:ByteArray = null;
|
||||
var _loc6_:ByteArray = null;
|
||||
var _loc7_:int = 0;
|
||||
var _loc8_:int = 0;
|
||||
if(param1)
|
||||
{
|
||||
this._loaderCacheArray["palette"].l.removeEventListener(LoaderEvent.ON_LOAD_COMPLETE,this.onResultGetGamePalette);
|
||||
this._loaderCacheArray["palette"] = null;
|
||||
_loc2_ = new ImageServerEvent(ImageServerEvent.ON_GLOBAL_PALETTE);
|
||||
_loc3_ = param1.entry.data as ByteArray;
|
||||
_loc4_ = new ByteArray();
|
||||
_loc5_ = new ByteArray();
|
||||
_loc6_ = new ByteArray();
|
||||
_loc3_.position = 0;
|
||||
_loc7_ = _loc3_.readInt();
|
||||
_loc8_ = 4;
|
||||
_loc4_.writeBytes(_loc3_,_loc8_,_loc7_);
|
||||
_loc4_.position = 0;
|
||||
_loc8_ += _loc7_;
|
||||
_loc3_.position = _loc8_;
|
||||
_loc7_ = _loc3_.readInt();
|
||||
_loc8_ += 4;
|
||||
_loc5_.writeBytes(_loc3_,_loc8_,_loc7_);
|
||||
_loc5_.position = 0;
|
||||
_loc8_ += _loc7_;
|
||||
_loc3_.position = _loc8_;
|
||||
_loc7_ = _loc3_.readInt();
|
||||
_loc8_ += 4;
|
||||
_loc6_.writeBytes(_loc3_,_loc8_,_loc7_);
|
||||
_loc6_.position = 0;
|
||||
_loc2_.genericData = {
|
||||
"palette":_loc4_,
|
||||
"avatarPalette1":_loc5_,
|
||||
"avatarPalette2":_loc6_
|
||||
};
|
||||
dispatchEvent(_loc2_);
|
||||
return;
|
||||
}
|
||||
throw new Error("Got 0 for GetGamePalette request!");
|
||||
}
|
||||
|
||||
private function onResultGetImageData(param1:LoaderEvent) : void
|
||||
{
|
||||
var _loc5_:ImageServerEvent = null;
|
||||
var _loc2_:ImageServerEvent = new ImageServerEvent(ImageServerEvent.ON_NEW_DATA);
|
||||
_loc2_.id = param1.entry.id;
|
||||
var _loc3_:Object = param1.entry.data;
|
||||
if(_loc3_ == null)
|
||||
{
|
||||
this._imageCacheArray[_loc2_.id] = {
|
||||
"id":_loc2_.id,
|
||||
"imageData":null,
|
||||
"layer":0,
|
||||
"frames":0
|
||||
};
|
||||
_loc2_.success = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_loc3_.v != ImageArray.VERSION)
|
||||
{
|
||||
throw new Error("ERROR: Unrecognized version number(" + _loc3_.v.toString(16) + ")!");
|
||||
}
|
||||
_loc2_.imageData = _loc3_;
|
||||
_loc2_.layer = this._layerInfo[ImageArrayHelper.layerId(_loc2_.id)];
|
||||
_loc2_.frames = _loc3_.f.length;
|
||||
this._imageCacheArray[_loc2_.id] = {
|
||||
"id":_loc2_.id,
|
||||
"imageData":_loc3_,
|
||||
"layer":_loc2_.layer,
|
||||
"frames":_loc2_.frames
|
||||
};
|
||||
}
|
||||
this._loaderCacheArray[_loc2_.id].l.removeEventListener(LoaderEvent.ON_LOAD_COMPLETE,this.onResultGetImageData);
|
||||
var _loc4_:* = int(this._loaderCacheArray[_loc2_.id].c);
|
||||
this._loaderCacheArray[_loc2_.id] = null;
|
||||
while(_loc4_-- > 0)
|
||||
{
|
||||
_loc5_ = new ImageServerEvent(ImageServerEvent.ON_NEW_DATA);
|
||||
_loc5_.id = _loc2_.id;
|
||||
_loc5_.imageData = _loc2_.imageData;
|
||||
_loc5_.layer = _loc2_.layer;
|
||||
_loc5_.frames = _loc2_.frames;
|
||||
_loc5_.success = _loc2_.success;
|
||||
dispatchEvent(_loc5_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SingletonLock
|
||||
{
|
||||
|
||||
public function SingletonLock()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import com.adobe.crypto.MD5;
|
||||
import com.sbi.debug.DebugUtility;
|
||||
import flash.net.URLRequest;
|
||||
|
||||
public class LoaderCache
|
||||
{
|
||||
|
||||
public static var cdnSalt:String;
|
||||
|
||||
public static var mainClassNames:Array;
|
||||
|
||||
public static var _contentURL:String = "http://dev-sfs01.smartbombinteractive.com:8008/animal/";
|
||||
|
||||
public static var buildVersion:String = "0";
|
||||
|
||||
public static var deployVersion:String = "0";
|
||||
|
||||
public static var localMode:Boolean = true;
|
||||
|
||||
private static var _clientIp:String = "127.0.0.1";
|
||||
|
||||
private var _list:Array = null;
|
||||
|
||||
public function LoaderCache()
|
||||
{
|
||||
super();
|
||||
this._list = new Array();
|
||||
}
|
||||
|
||||
public static function get contentURL() : String
|
||||
{
|
||||
return _contentURL;
|
||||
}
|
||||
|
||||
public static function set contentURL(param1:String) : void
|
||||
{
|
||||
_contentURL = param1;
|
||||
}
|
||||
|
||||
public static function get clientIp() : String
|
||||
{
|
||||
return _clientIp;
|
||||
}
|
||||
|
||||
public static function set clientIp(param1:String) : void
|
||||
{
|
||||
_clientIp = param1;
|
||||
}
|
||||
|
||||
public static function fetchCDNHash(param1:String, param2:String = "/") : String
|
||||
{
|
||||
var _loc3_:String = cdnSalt + param2 + param1 + clientIp;
|
||||
return MD5.hash(_loc3_);
|
||||
}
|
||||
|
||||
public static function fetchCDNURL(param1:String, param2:String = "/", param3:Boolean = true) : String
|
||||
{
|
||||
var _loc8_:String = null;
|
||||
var _loc4_:String = param2;
|
||||
var _loc5_:String = "";
|
||||
var _loc6_:String = deployVersion;
|
||||
if(_loc6_ != "0" && param3)
|
||||
{
|
||||
_loc5_ = _loc6_ + "/";
|
||||
_loc4_ += _loc5_;
|
||||
}
|
||||
var _loc7_:String = fetchCDNHash(param1,_loc4_);
|
||||
if(param3)
|
||||
{
|
||||
_loc8_ = contentURL + _loc5_ + param1 + "?px-hash=" + _loc7_ + "&v=" + LoaderCache.buildVersion;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc8_ = contentURL + _loc5_ + param1 + "?px-hash=" + _loc7_;
|
||||
}
|
||||
return _loc8_;
|
||||
}
|
||||
|
||||
public static function fetchCDNURLRequest(param1:String, param2:String = "/", param3:Boolean = true) : URLRequest
|
||||
{
|
||||
var _loc4_:String = fetchCDNURL(param1,param2,param3);
|
||||
return new URLRequest(_loc4_);
|
||||
}
|
||||
|
||||
public function openFile(param1:String, param2:Function, param3:Function = null, param4:String = "binary") : void
|
||||
{
|
||||
var _loc5_:* = undefined;
|
||||
if(!this.findFile(param1))
|
||||
{
|
||||
_loc5_ = this.createLoaderCacheEntry(param1);
|
||||
this._list[param1] = _loc5_;
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugUtility.debugTrace("*LoaderCache name collision: " + param1);
|
||||
}
|
||||
this._list[param1].setCompleteCallback(param2);
|
||||
if(param3 != null)
|
||||
{
|
||||
this._list[param1].setProgressCallback(param3);
|
||||
}
|
||||
this._list[param1].load(param4);
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
var _loc1_:Object = null;
|
||||
for(_loc1_ in this._list)
|
||||
{
|
||||
this.remove(String(_loc1_));
|
||||
}
|
||||
}
|
||||
|
||||
private function findFile(param1:String) : Boolean
|
||||
{
|
||||
return this._list[param1] == null ? false : true;
|
||||
}
|
||||
|
||||
public function remove(param1:String) : void
|
||||
{
|
||||
this._list[param1].destroy();
|
||||
this._list[param1] = null;
|
||||
}
|
||||
|
||||
private function createLoaderCacheEntry(param1:String) : *
|
||||
{
|
||||
var _loc4_:* = undefined;
|
||||
var _loc2_:int = param1.lastIndexOf(".");
|
||||
var _loc3_:String = param1.slice(_loc2_ + 1,param1.length).toLowerCase();
|
||||
switch(_loc3_)
|
||||
{
|
||||
case "swf":
|
||||
case "png":
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
_loc4_ = new LoaderCacheEntry_Loader(param1);
|
||||
break;
|
||||
default:
|
||||
_loc4_ = new LoaderCacheEntry_URL(param1);
|
||||
}
|
||||
_loc4_.parent = this;
|
||||
return _loc4_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import flash.display.Loader;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.events.IOErrorEvent;
|
||||
import flash.events.ProgressEvent;
|
||||
|
||||
public class LoaderCacheEntry_Base extends EventDispatcher
|
||||
{
|
||||
|
||||
protected var _parent:LoaderCache;
|
||||
|
||||
protected var _loader:*;
|
||||
|
||||
protected var _swf:String;
|
||||
|
||||
protected var _isLoaded:Boolean;
|
||||
|
||||
protected var _completeCallback:Function;
|
||||
|
||||
protected var _data:Object;
|
||||
|
||||
protected var _id:*;
|
||||
|
||||
protected var _contentType:int;
|
||||
|
||||
private var _percent:Number;
|
||||
|
||||
private var _err:String;
|
||||
|
||||
private var _progressCallback:Function;
|
||||
|
||||
public function LoaderCacheEntry_Base(param1:String)
|
||||
{
|
||||
super();
|
||||
this._swf = param1;
|
||||
}
|
||||
|
||||
public function set parent(param1:LoaderCache) : void
|
||||
{
|
||||
this._parent = param1;
|
||||
}
|
||||
|
||||
public function set id(param1:*) : void
|
||||
{
|
||||
this._id = param1;
|
||||
}
|
||||
|
||||
public function get id() : *
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public function set contentType(param1:int) : void
|
||||
{
|
||||
this._contentType = param1;
|
||||
}
|
||||
|
||||
public function get contentType() : int
|
||||
{
|
||||
return this._contentType;
|
||||
}
|
||||
|
||||
public function get name() : String
|
||||
{
|
||||
return this._swf;
|
||||
}
|
||||
|
||||
public function destroy() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function load(param1:String = "binary", param2:Boolean = true) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function setCompleteCallback(param1:Function) : void
|
||||
{
|
||||
if(this._completeCallback != param1)
|
||||
{
|
||||
if(this._completeCallback != null)
|
||||
{
|
||||
removeEventListener(LoaderEvent.ON_LOAD_COMPLETE,this._completeCallback);
|
||||
}
|
||||
addEventListener(LoaderEvent.ON_LOAD_COMPLETE,param1,false,0,true);
|
||||
this._completeCallback = param1;
|
||||
}
|
||||
}
|
||||
|
||||
public function setProgressCallback(param1:Function) : void
|
||||
{
|
||||
if(this._progressCallback != param1)
|
||||
{
|
||||
if(this._progressCallback != null)
|
||||
{
|
||||
removeEventListener(LoaderEvent.ON_LOAD_PROGRESS,this._progressCallback);
|
||||
}
|
||||
addEventListener(LoaderEvent.ON_LOAD_PROGRESS,param1,false,0,true);
|
||||
this._progressCallback = param1;
|
||||
}
|
||||
}
|
||||
|
||||
public function get progress() : Number
|
||||
{
|
||||
return this._percent;
|
||||
}
|
||||
|
||||
public function get loader() : Loader
|
||||
{
|
||||
return this._loader;
|
||||
}
|
||||
|
||||
public function get data() : Object
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
protected function onLoadCompleteEvent() : void
|
||||
{
|
||||
var _loc1_:LoaderEvent = new LoaderEvent(LoaderEvent.ON_LOAD_COMPLETE);
|
||||
_loc1_.status = true;
|
||||
_loc1_.entry = this;
|
||||
dispatchEvent(_loc1_);
|
||||
if(this._parent)
|
||||
{
|
||||
this._parent.remove(this._swf);
|
||||
}
|
||||
}
|
||||
|
||||
protected function onLoadProgressEvent() : void
|
||||
{
|
||||
var _loc1_:LoaderEvent = new LoaderEvent(LoaderEvent.ON_LOAD_PROGRESS);
|
||||
_loc1_.status = true;
|
||||
_loc1_.entry = this;
|
||||
_loc1_.percent = this._percent;
|
||||
dispatchEvent(_loc1_);
|
||||
}
|
||||
|
||||
protected function loadProgress(param1:ProgressEvent) : void
|
||||
{
|
||||
this._percent = param1.bytesLoaded / param1.bytesTotal;
|
||||
this._percent = Math.round(this._percent * 100);
|
||||
this.onLoadProgressEvent();
|
||||
}
|
||||
|
||||
protected function ioError(param1:IOErrorEvent) : void
|
||||
{
|
||||
var _loc2_:LoaderEvent = new LoaderEvent(LoaderEvent.ON_LOAD_COMPLETE);
|
||||
_loc2_.status = false;
|
||||
_loc2_.entry = this;
|
||||
_loc2_.message = param1.text;
|
||||
dispatchEvent(_loc2_);
|
||||
if(this._parent)
|
||||
{
|
||||
this._parent.remove(this._swf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import flash.display.Loader;
|
||||
import flash.display.LoaderInfo;
|
||||
import flash.events.Event;
|
||||
import flash.events.IOErrorEvent;
|
||||
import flash.events.ProgressEvent;
|
||||
import flash.net.URLRequest;
|
||||
import flash.system.ApplicationDomain;
|
||||
import flash.system.LoaderContext;
|
||||
import flash.system.SecurityDomain;
|
||||
|
||||
public class LoaderCacheEntry_Loader extends LoaderCacheEntry_Base
|
||||
{
|
||||
|
||||
public function LoaderCacheEntry_Loader(param1:String)
|
||||
{
|
||||
super(param1);
|
||||
_loader = new Loader();
|
||||
_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loadProgress,false,0,true);
|
||||
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE,this.loadComplete,false,0,true);
|
||||
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,ioError,false,0,true);
|
||||
}
|
||||
|
||||
override public function destroy() : void
|
||||
{
|
||||
_loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS,loadProgress);
|
||||
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,this.loadComplete);
|
||||
_loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,ioError);
|
||||
if(_completeCallback != null)
|
||||
{
|
||||
removeEventListener(LoaderEvent.ON_LOAD_COMPLETE,_completeCallback);
|
||||
_completeCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
override public function load(param1:String = "binary", param2:Boolean = true) : void
|
||||
{
|
||||
var _loc3_:URLRequest = null;
|
||||
var _loc4_:LoaderContext = null;
|
||||
if(!_isLoaded)
|
||||
{
|
||||
if(LoaderCache.localMode && (_swf.slice(0,7) == "assets/" || _swf.slice(0,6) == "games/" || _swf.indexOf("/") == -1))
|
||||
{
|
||||
_loc3_ = new URLRequest(_swf);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = LoaderCache.fetchCDNURLRequest(_swf,"/",param2);
|
||||
}
|
||||
_loc4_ = new LoaderContext(true,ApplicationDomain.currentDomain);
|
||||
if(!LoaderCache.localMode)
|
||||
{
|
||||
_loc4_.securityDomain = SecurityDomain.currentDomain;
|
||||
}
|
||||
_loader.load(_loc3_,_loc4_);
|
||||
}
|
||||
else
|
||||
{
|
||||
onLoadCompleteEvent();
|
||||
}
|
||||
}
|
||||
|
||||
private function loadComplete(param1:Event) : void
|
||||
{
|
||||
_isLoaded = true;
|
||||
var _loc2_:LoaderInfo = param1.target as LoaderInfo;
|
||||
_data = _loc2_.content;
|
||||
onLoadCompleteEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import flash.events.Event;
|
||||
import flash.events.IOErrorEvent;
|
||||
import flash.events.ProgressEvent;
|
||||
import flash.net.URLLoader;
|
||||
import flash.net.URLRequest;
|
||||
import flash.utils.ByteArray;
|
||||
|
||||
public class LoaderCacheEntry_URL extends LoaderCacheEntry_Base
|
||||
{
|
||||
|
||||
private var _isObj:Boolean;
|
||||
|
||||
public function LoaderCacheEntry_URL(param1:String, param2:Boolean = true)
|
||||
{
|
||||
super(param1);
|
||||
this._isObj = param2;
|
||||
_loader = new URLLoader();
|
||||
_loader.addEventListener(ProgressEvent.PROGRESS,loadProgress,false,0,true);
|
||||
_loader.addEventListener(Event.COMPLETE,this.loadComplete,false,0,true);
|
||||
_loader.addEventListener(IOErrorEvent.IO_ERROR,ioError,false,0,true);
|
||||
}
|
||||
|
||||
override public function destroy() : void
|
||||
{
|
||||
_loader.removeEventListener(ProgressEvent.PROGRESS,loadProgress);
|
||||
_loader.removeEventListener(Event.COMPLETE,this.loadComplete);
|
||||
_loader.removeEventListener(IOErrorEvent.IO_ERROR,ioError);
|
||||
if(_completeCallback != null)
|
||||
{
|
||||
removeEventListener(LoaderEvent.ON_LOAD_COMPLETE,_completeCallback);
|
||||
_completeCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
override public function load(param1:String = "binary", param2:Boolean = true) : void
|
||||
{
|
||||
var _loc3_:URLRequest = null;
|
||||
if(!_isLoaded)
|
||||
{
|
||||
_loc3_ = LoaderCache.fetchCDNURLRequest(_swf,"/",param2);
|
||||
_loader.dataFormat = param1;
|
||||
_loader.load(_loc3_);
|
||||
}
|
||||
else
|
||||
{
|
||||
onLoadCompleteEvent();
|
||||
}
|
||||
}
|
||||
|
||||
private function loadComplete(param1:Event) : void
|
||||
{
|
||||
var _loc2_:ByteArray = null;
|
||||
var _loc3_:Object = null;
|
||||
_isLoaded = true;
|
||||
_data = _loader.data;
|
||||
if(_data is ByteArray)
|
||||
{
|
||||
_loc2_ = _loader.data as ByteArray;
|
||||
try
|
||||
{
|
||||
_loc2_.uncompress();
|
||||
}
|
||||
catch(err:Error)
|
||||
{
|
||||
}
|
||||
_loc2_.position = 0;
|
||||
if(this._isObj)
|
||||
{
|
||||
_loc3_ = _loc2_.readObject();
|
||||
if(_loc2_.bytesAvailable == 0)
|
||||
{
|
||||
_data = _loc3_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_.position = 0;
|
||||
_data = _loc2_;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_data = _loc2_;
|
||||
}
|
||||
}
|
||||
onLoadCompleteEvent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
public class LoaderEvent extends Event
|
||||
{
|
||||
|
||||
public static const ON_LOAD_COMPLETE:String = "OnLoadComplete";
|
||||
|
||||
public static const ON_LOAD_PROGRESS:String = "OnLoadProgress";
|
||||
|
||||
public var status:Boolean;
|
||||
|
||||
public var entry:LoaderCacheEntry_Base;
|
||||
|
||||
public var message:String;
|
||||
|
||||
public var percent:Number;
|
||||
|
||||
public function LoaderEvent(param1:String)
|
||||
{
|
||||
super(param1);
|
||||
}
|
||||
|
||||
override public function clone() : Event
|
||||
{
|
||||
return new LoaderEvent(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import com.sbi.debug.DebugUtility;
|
||||
|
||||
public class ResourceStack
|
||||
{
|
||||
|
||||
private var _stack:Array;
|
||||
|
||||
private var _callback:Function;
|
||||
|
||||
private var _path:String;
|
||||
|
||||
private var _openFile:Function;
|
||||
|
||||
public function ResourceStack(param1:String, param2:Function)
|
||||
{
|
||||
super();
|
||||
this._path = param1;
|
||||
this._openFile = param2;
|
||||
this._stack = new Array();
|
||||
}
|
||||
|
||||
public function pushFile(param1:String, param2:Boolean = false) : void
|
||||
{
|
||||
this._stack.push({
|
||||
"type":"file",
|
||||
"data":param1,
|
||||
"isBlocking":param2,
|
||||
"inProgress":false
|
||||
});
|
||||
}
|
||||
|
||||
public function pushClass(param1:IResourceStackable, param2:Boolean = false) : void
|
||||
{
|
||||
this._stack.push({
|
||||
"type":"class",
|
||||
"data":param1,
|
||||
"isBlocking":param2,
|
||||
"inProgress":false
|
||||
});
|
||||
}
|
||||
|
||||
public function start(param1:Function) : void
|
||||
{
|
||||
this._callback = param1;
|
||||
this.fifo();
|
||||
}
|
||||
|
||||
private function fifo() : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:Object = null;
|
||||
var _loc1_:int = int(this._stack.length);
|
||||
DebugUtility.debugTrace("ResourceStack fifo len:" + _loc1_);
|
||||
if(!_loc1_)
|
||||
{
|
||||
if(this._callback != null)
|
||||
{
|
||||
this._callback();
|
||||
this._callback = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _loc1_)
|
||||
{
|
||||
_loc3_ = this._stack[_loc2_];
|
||||
if(!_loc3_.inProgress)
|
||||
{
|
||||
_loc3_.inProgress = true;
|
||||
switch(_loc3_.type)
|
||||
{
|
||||
case "file":
|
||||
this.loadFile(_loc3_.data);
|
||||
break;
|
||||
case "class":
|
||||
_loc3_.data.init(this.onInitClassComplete);
|
||||
}
|
||||
_loc2_ = -1;
|
||||
_loc1_ = int(this._stack.length);
|
||||
}
|
||||
else if(_loc3_.isBlocking)
|
||||
{
|
||||
break;
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function loadFile(param1:String) : void
|
||||
{
|
||||
var _loc2_:String = this._path + param1;
|
||||
this._openFile(_loc2_,this.onLoadComplete,this.onLoadProgress);
|
||||
}
|
||||
|
||||
private function onLoadComplete(param1:LoaderEvent) : void
|
||||
{
|
||||
if(param1.status)
|
||||
{
|
||||
this.removeResource("file",param1.entry.name);
|
||||
this.fifo();
|
||||
return;
|
||||
}
|
||||
throw new Error("could not load required resource!!! msg:" + param1.message);
|
||||
}
|
||||
|
||||
private function onLoadProgress(param1:LoaderEvent) : void
|
||||
{
|
||||
}
|
||||
|
||||
private function onInitClassComplete(param1:IResourceStackable) : void
|
||||
{
|
||||
this.removeResource("class",param1);
|
||||
this.fifo();
|
||||
}
|
||||
|
||||
private function removeResource(param1:String, param2:*) : void
|
||||
{
|
||||
var _loc5_:Object = null;
|
||||
var _loc3_:int = int(this._stack.length);
|
||||
var _loc4_:int = 0;
|
||||
while(_loc4_ < _loc3_)
|
||||
{
|
||||
_loc5_ = this._stack[_loc4_];
|
||||
if(_loc5_.type == param1 && _loc5_.data == param2)
|
||||
{
|
||||
this._stack.splice(_loc4_,1);
|
||||
break;
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
package com.sbi.loader
|
||||
{
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.Loader;
|
||||
import flash.display.LoaderInfo;
|
||||
import flash.display.MovieClip;
|
||||
import flash.events.Event;
|
||||
import flash.events.EventDispatcher;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.system.ApplicationDomain;
|
||||
import flash.system.LoaderContext;
|
||||
|
||||
public class SceneLoader extends EventDispatcher
|
||||
{
|
||||
|
||||
private var _offset:Point;
|
||||
|
||||
private var _scene:Object;
|
||||
|
||||
private var _loaderCount:int;
|
||||
|
||||
private var _loader:Array;
|
||||
|
||||
public function SceneLoader()
|
||||
{
|
||||
super();
|
||||
this._loader = new Array();
|
||||
}
|
||||
|
||||
public function getOffset(param1:DisplayObject) : Point
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
var _loc4_:Loader = null;
|
||||
var _loc5_:Rectangle = null;
|
||||
var _loc3_:Array = this.getActorList("ActorLayer");
|
||||
for each(_loc2_ in _loc3_)
|
||||
{
|
||||
_loc4_ = _loc2_.s;
|
||||
_loc5_ = _loc4_.getBounds(param1);
|
||||
if(_loc5_.x < this._offset.x)
|
||||
{
|
||||
this._offset.x = _loc5_.x;
|
||||
}
|
||||
if(_loc5_.y < this._offset.y)
|
||||
{
|
||||
this._offset.y = _loc5_.y;
|
||||
}
|
||||
}
|
||||
return this._offset;
|
||||
}
|
||||
|
||||
public function get isValid() : Boolean
|
||||
{
|
||||
return this._scene != null;
|
||||
}
|
||||
|
||||
public function setScene(param1:Object) : void
|
||||
{
|
||||
this.release();
|
||||
this._scene = param1;
|
||||
if(param1)
|
||||
{
|
||||
this.loadLayers();
|
||||
}
|
||||
}
|
||||
|
||||
public function getActorList(param1:String) : Array
|
||||
{
|
||||
return this._scene.actors[param1];
|
||||
}
|
||||
|
||||
public function getLayer(param1:String) : Object
|
||||
{
|
||||
return this.findLayer(param1);
|
||||
}
|
||||
|
||||
public function cloneAsset(param1:String) : Object
|
||||
{
|
||||
var _loc3_:Loader = null;
|
||||
var _loc2_:Object = this.findLayer(param1);
|
||||
if(_loc2_)
|
||||
{
|
||||
_loc3_ = this.newAsset(_loc2_.assetName);
|
||||
_loc3_.x = _loc2_.x;
|
||||
_loc3_.y = _loc2_.y;
|
||||
_loc2_.loader = _loc3_;
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
public function release() : void
|
||||
{
|
||||
var _loc1_:Loader = null;
|
||||
while(this._loader.length)
|
||||
{
|
||||
_loc1_ = this._loader.pop();
|
||||
_loc1_.unloadAndStop();
|
||||
}
|
||||
}
|
||||
|
||||
public function releaseCloneAsset(param1:Loader) : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:Loader = null;
|
||||
while(_loc2_ < this._loader.length)
|
||||
{
|
||||
_loc3_ = this._loader[_loc2_];
|
||||
if(_loc3_ == param1)
|
||||
{
|
||||
param1.unloadAndStop();
|
||||
this._loader.splice(_loc2_,1);
|
||||
break;
|
||||
}
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
|
||||
private function findLayer(param1:String) : Object
|
||||
{
|
||||
var _loc2_:Object = null;
|
||||
var _loc4_:int = 0;
|
||||
var _loc3_:Array = this.getActorList("ActorLayer");
|
||||
param1 = param1.toLowerCase();
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < _loc3_.length)
|
||||
{
|
||||
if(_loc3_[_loc4_].name == param1)
|
||||
{
|
||||
_loc2_ = new Object();
|
||||
_loc2_.assetName = _loc3_[_loc4_].assetName;
|
||||
_loc2_.loader = _loc3_[_loc4_].s;
|
||||
_loc2_.height = _loc3_[_loc4_].s.height;
|
||||
_loc2_.width = _loc3_[_loc4_].s.width;
|
||||
_loc2_.x = _loc3_[_loc4_].s.x;
|
||||
_loc2_.y = _loc3_[_loc4_].s.y;
|
||||
_loc2_.flip = _loc3_[_loc4_].flip;
|
||||
break;
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
if(_loc2_ == null)
|
||||
{
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
private function newAsset(param1:String) : Loader
|
||||
{
|
||||
var _loc2_:Loader = null;
|
||||
var _loc4_:int = 0;
|
||||
param1 = param1.toLowerCase();
|
||||
var _loc3_:Array = this._scene.assets;
|
||||
while(_loc4_ < _loc3_.length)
|
||||
{
|
||||
if(_loc3_[_loc4_].name.toLowerCase() == param1)
|
||||
{
|
||||
_loc2_ = new Loader();
|
||||
_loc2_.loadBytes(_loc3_[_loc4_].ba);
|
||||
_loc2_.contentLoaderInfo.addEventListener(Event.COMPLETE,this.onNewLoaderComplete);
|
||||
_loc2_.cacheAsBitmap = true;
|
||||
this._loader.push(_loc2_);
|
||||
return _loc2_;
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
private function onNewLoaderComplete(param1:Event) : void
|
||||
{
|
||||
var _loc2_:LoaderInfo = param1.target as LoaderInfo;
|
||||
_loc2_.removeEventListener(Event.COMPLETE,this.onLoaderComplete);
|
||||
if(_loc2_.content is MovieClip && MovieClip(_loc2_.content).totalFrames > 1)
|
||||
{
|
||||
_loc2_.content.cacheAsBitmap = false;
|
||||
}
|
||||
dispatchEvent(param1);
|
||||
}
|
||||
|
||||
private function loadLayers() : void
|
||||
{
|
||||
var _loc2_:int = 0;
|
||||
var _loc3_:Object = null;
|
||||
var _loc4_:Loader = null;
|
||||
this._offset = new Point(9999999,9999999);
|
||||
var _loc1_:Array = this.getActorList("ActorLayer");
|
||||
this._loaderCount = _loc1_.length;
|
||||
_loc2_ = 0;
|
||||
while(_loc2_ < _loc1_.length)
|
||||
{
|
||||
_loc3_ = _loc1_[_loc2_];
|
||||
_loc3_.dx = _loc3_.scrollX;
|
||||
_loc3_.dy = _loc3_.scrollY;
|
||||
_loc4_ = this.loadAsset(_loc3_.assetName);
|
||||
_loc3_.s = _loc4_;
|
||||
_loc4_.x = Math.round(_loc3_.x);
|
||||
_loc4_.y = Math.round(_loc3_.y);
|
||||
_loc4_.rotation = _loc3_.rot;
|
||||
_loc4_.scaleX = _loc3_.scaleX;
|
||||
_loc4_.scaleY = _loc3_.scaleY;
|
||||
_loc2_++;
|
||||
}
|
||||
}
|
||||
|
||||
private function loadAsset(param1:String) : Loader
|
||||
{
|
||||
var _loc2_:Loader = null;
|
||||
var _loc4_:int = 0;
|
||||
var _loc5_:LoaderContext = null;
|
||||
param1 = param1.toLowerCase();
|
||||
var _loc3_:Array = this._scene.assets;
|
||||
while(_loc4_ < _loc3_.length)
|
||||
{
|
||||
if(_loc3_[_loc4_].name.toLowerCase() == param1)
|
||||
{
|
||||
_loc2_ = new Loader();
|
||||
if(_loc3_[_loc4_].ba)
|
||||
{
|
||||
_loc5_ = new LoaderContext(false,ApplicationDomain.currentDomain);
|
||||
_loc2_.loadBytes(_loc3_[_loc4_].ba,_loc5_);
|
||||
_loc2_.contentLoaderInfo.addEventListener(Event.COMPLETE,this.onLoaderComplete);
|
||||
_loc2_.cacheAsBitmap = true;
|
||||
this._loader.push(_loc2_);
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
_loc4_++;
|
||||
}
|
||||
return _loc2_;
|
||||
}
|
||||
|
||||
private function onLoaderComplete(param1:Event) : void
|
||||
{
|
||||
var _loc2_:LoaderInfo = param1.target as LoaderInfo;
|
||||
_loc2_.removeEventListener(Event.COMPLETE,this.onLoaderComplete);
|
||||
if(_loc2_.content is MovieClip && MovieClip(_loc2_.content).totalFrames > 1)
|
||||
{
|
||||
_loc2_.content.cacheAsBitmap = false;
|
||||
}
|
||||
--this._loaderCount;
|
||||
if(this._loaderCount == 0)
|
||||
{
|
||||
this.allLoadingComplete();
|
||||
}
|
||||
}
|
||||
|
||||
private function allLoadingComplete() : void
|
||||
{
|
||||
var _loc1_:Event = new Event(Event.COMPLETE);
|
||||
dispatchEvent(_loc1_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user