Merge branch 'localfile'
[potlatch2.git] / net / systemeD / potlatch2 / collections / VectorBackgrounds.as
index 9b64e3a0a7ac6b3324124c01bc7d6357239ac02e..0a8d61086548fd4d982f9a6800b0942e89a2952d 100644 (file)
@@ -6,7 +6,7 @@ package net.systemeD.potlatch2.collections {
        import net.systemeD.halcyon.Map;
        import net.systemeD.halcyon.MapPaint;
        import net.systemeD.halcyon.connection.Connection;
-       import net.systemeD.halcyon.DebugURLRequest;
+       import net.systemeD.halcyon.FileBank;
        import net.systemeD.potlatch2.utils.*;
                
        public class VectorBackgrounds extends EventDispatcher {
@@ -19,14 +19,11 @@ package net.systemeD.potlatch2.collections {
 
                public function init(map:Map):void {
                        _map = map;
-                       var request:DebugURLRequest = new DebugURLRequest("vectors.xml");
-                       var loader:URLLoader = new URLLoader();
-                       loader.addEventListener(Event.COMPLETE, onConfigLoad);
-                       loader.load(request.request);
+            FileBank.getInstance().addFromFile("vectors.xml", onConfigLoad);
                }
 
-               public function onConfigLoad(e:Event):void {
-                       var xml:XML = XML(e.target.data);
+               private function onConfigLoad(fileBank:FileBank, filename:String):void {
+                       var xml:XML = new XML(fileBank.getAsString(filename));
 
                        // reconstitute results as Array, as we can't run .forEach over an XMLList
                        var sets:Array = [];