Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble With ActionScript Loader Events
    primarykey
    data
    text
    <p>I am working with a loader to request an image from a WMS(Web Mapping Service). Everything thing is fine and dandy with a valid request. </p> <p>When a bad request is made to a WMS, a Standard Exception Document(XML) is usually returned. However, the loader doesn't fire any event (specifically the Complete or IOError events) when a bad request is made. </p> <p>Does anyone have any suggestions on how I can trap anything that is not an image that might be returned?</p> <pre><code>override protected function loadMapImage(loader:Loader):void { // update parameter values _params = new URLVariables(); _params.request = "GetMap"; _params.format = "image/png"; _params.version = "1.1.1"; _params.layers = this.layers; _params.styles = ""; _params.transparent = "TRUE"; _params.bbox = map.extent.xmin + "," + map.extent.ymin + "," + map.extent.xmax + "," + map.extent.ymax; _params.srs = "EPSG:" + map.spatialReference.wkid; _params.width = map.width; _params.height = map.height; _urlRequest = new URLRequest(this.url); _urlRequest.data = _params; configureListeners(loader.contentLoaderInfo); loader.load(_urlRequest); } private function configureListeners(dispatcher:IEventDispatcher):void { //dispatcher.addEventListener(Event.INIT, initHandler); //dispatcher.addEventListener(Event.UNLOAD, unloadHandler); dispatcher.addEventListener(Event.COMPLETE, completeHandler); //dispatcher.addEventListener(Event.OPEN, openHandler); //dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler); //dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); //dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler); dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler); //dispatcher.addEventListener(Event.ACTIVATE, activateHandler); //dispatcher.addEventListener(Event.DEACTIVATE, deactivateHandler); } private function ioErrorHandler(event:IOErrorEvent):void { trace('ioErrorHandler event'); } private function completeHandler(event:Event):void { trace('completeHandler event'); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload