+
+
+ // ------------------------------------------------------------------------------------------------
+ // Load all referenced images
+ // ** currently only looks in PointRules
+ // ** will duplicate if referenced twice, shouldn't
+
+ public function loadImages():void {
+ var ps:PointStyle;
+ for each (var rule:* in rules) {
+ if (!(rule is PointRule)) { continue; }
+ if (!(rule.pointStyle)) { continue; }
+ if (!(rule.pointStyle.icon)) { continue; }
+
+ var request:URLRequest=new URLRequest(rule.pointStyle.icon);
+ var loader:ImageLoader=new ImageLoader();
+ loader.dataFormat=URLLoaderDataFormat.BINARY;
+ loader.filename=rule.pointStyle.icon;
+ loader.addEventListener(Event.COMPLETE, loadedImage, false, 0, true);
+ loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler, false, 0, true);
+ loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler, false, 0, true);
+ loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler, false, 0, true);
+ loader.load(request);
+ }
+ }
+
+ // data handler
+
+ private function loadedImage(event:Event):void {
+ Globals.vars.debug.appendText("Target is "+event.target+", name"+event.target.filename+"\n");
+ images[event.target.filename]=event.target.data;
+ }
+