Support @import directives in MapCSS files
[potlatch2.git] / net / systemeD / halcyon / styleparser / RuleSet.as
index 81232bebd3bd9b64bea1436f8451606d61b07358..f66609b70c647a2df1f3edbf78107ee4b88bcdc5 100644 (file)
@@ -248,20 +248,13 @@ package net.systemeD.halcyon.styleparser {
                public function loadFromCSS(str:String):void {
                        if (str.match(/[\s\n\r\t]/)!=null) { parseCSS(str); loaded=true; redrawCallback(); return; }
 
-                       var request:DebugURLRequest=new DebugURLRequest(str);
-                       var loader:URLLoader=new URLLoader();
-
-//                     request.method=URLRequestMethod.GET;
-                       loader.dataFormat = URLLoaderDataFormat.TEXT;
-                       loader.addEventListener(Event.COMPLETE,                                         doParseCSS);
-                       loader.addEventListener(HTTPStatusEvent.HTTP_STATUS,            httpStatusHandler);
-                       loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,      securityErrorHandler);
-                       loader.addEventListener(IOErrorEvent.IO_ERROR,                          ioErrorHandler);
-                       loader.load(request.request);
+                       var cssLoader:NestedCSSLoader=new NestedCSSLoader();
+                       cssLoader.addEventListener(Event.COMPLETE, doParseCSS);
+                       cssLoader.load(str);
                }
 
                private function doParseCSS(e:Event):void {
-                       parseCSS(e.target.data);
+                       parseCSS(e.target.css);
                }
 
                private function parseCSS(str:String):void {
@@ -434,7 +427,7 @@ package net.systemeD.halcyon.styleparser {
                private function saveEval(expr:String):Eval {
                        evalsToLoad++;
                        var e:Eval=new Eval(expr);
-                       e.addEventListener("swf_loaded",evalLoaded);
+                       e.addEventListener("swf_loaded",evalLoaded, false, 0, true);
                        evals.push(e);
                        return e;
                }