Support importing the <create> element only of <osmChange> files
[potlatch2.git] / net / systemeD / potlatch2 / utils / Importer.as
index e53355de6a04ae49d29c4f229b70642d90c55e8c..665e627f9d374921f94fc83f6bfae6611ffaa48d 100644 (file)
@@ -2,7 +2,6 @@ package net.systemeD.potlatch2.utils {
 
        import net.systemeD.halcyon.Map;
        import net.systemeD.halcyon.ExtendedURLLoader;
-       import net.systemeD.halcyon.DebugURLRequest;
     import net.systemeD.halcyon.connection.*;
        import flash.net.URLLoader;
        import flash.display.LoaderInfo;
@@ -30,7 +29,7 @@ package net.systemeD.potlatch2.utils {
                        // Use forEach to avoid closure problem (http://stackoverflow.com/questions/422784/how-to-fix-closure-problem-in-actionscript-3-as3#3971784)
                        filenames.forEach(function(fn:String, index:int, array:Array):void {
                                trace("requesting file "+index);
-                               var request:DebugURLRequest = new DebugURLRequest(fn);
+                               var request:URLRequest = new URLRequest(fn);
                                var loader:URLLoader = new URLLoader();
                                loader.dataFormat=URLLoaderDataFormat.BINARY;
                                loader.addEventListener(Event.COMPLETE,function(e:Event):void { fileLoaded(e,index); });
@@ -38,14 +37,14 @@ package net.systemeD.potlatch2.utils {
                                        loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,      securityErrorHandler);
                                        loader.addEventListener(IOErrorEvent.IO_ERROR,                          ioErrorHandler);
                                }
-                               loader.load(request.request);
+                               loader.load(request);
                        });
                }
                
                protected function fileLoaded(e:Event,filenum:uint):void {
-                       trace("loaded file "+filenum); 
                        files[filenum]=e.target.data;
                        filesloaded++;
+                       trace("loaded file "+filenum+" ("+filesloaded+"/"+filenames.length+")"); 
                        if (filesloaded==filenames.length) {
                 var action:CompositeUndoableAction = new CompositeUndoableAction("Import layer "+connection.name);
                                doImport(action.push);