ImageBank->FileBank
[potlatch2.git] / net / systemeD / potlatch2 / Preloader.as
index 1b25214eae42c68dfa54797b2a6b7c1554efc0a7..3b2c9c83859dae6c56feb1069c6f0f0893a78881 100644 (file)
@@ -6,7 +6,7 @@ package net.systemeD.potlatch2 {
     import flash.geom.Matrix;
     import flash.text.TextField;
     import flash.text.TextFormat;
-    import net.systemeD.halcyon.ImageBank;
+    import net.systemeD.halcyon.FileBank;
 
 
     public class Preloader extends net.systemeD.potlatch2.PreloaderDisplayBase {
@@ -45,16 +45,18 @@ package net.systemeD.potlatch2 {
 
                        // request .zip files
                        if (loaderInfo.parameters['assets']) {
-                               ImageBank.getInstance().addEventListener(ImageBank.ZIP_LOADED, zipLoaded);
+                               FileBank.getInstance().addEventListener(FileBank.ZIP_LOADED, zipLoaded);
                                for each (var file:String in loaderInfo.parameters['assets'].split(';')) {
                                        var asset:Array=file.split('=');
                                        assetscount++;
-                                       ImageBank.getInstance().loadFromZip(asset[0],asset[1]);
+                                       FileBank.getInstance().addFromZip(asset[0],asset[1]);
                                }
                        }
         }
 
                override protected function initProgressHandler(e:Event):void {
+                       // We don't let anything happen until the .zips are loaded
+                       // see http://stackoverflow.com/questions/2773617/how-to-preload-a-file-in-flex-before-the-application-initializes
                        if (assetscount>0) {
                                queuedEvents.push(e);
                                e.stopImmediatePropagation();