Added failsafe to Preloader for small AIR binaries

This commit is contained in:
Matan Uberstein
2015-07-27 14:41:36 +02:00
parent e8434d4f59
commit 0abd3977c9

View File

@@ -286,7 +286,14 @@ class Preloader #if flash extends Sprite #end {
#if flash
private function current_onEnter (event:Event):Void {
// Failsafe for small binary missing the 'onComplete' handler
if(!complete && Lib.current.loaderInfo.bytesLoaded == Lib.current.loaderInfo.bytesTotal)
{
complete = true;
update (Lib.current.loaderInfo.bytesLoaded, Lib.current.loaderInfo.bytesTotal);
}
if (complete) {
Lib.current.removeEventListener (Event.ENTER_FRAME, current_onEnter);