Load vector background catalogue through FileBank
authorTom Hughes <tom@compton.nu>
Sat, 24 Mar 2012 19:21:17 +0000 (19:21 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 25 Mar 2012 11:46:47 +0000 (12:46 +0100)
net/systemeD/potlatch2/collections/VectorBackgrounds.as

index 34a4fcc..446799b 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 = [];