1 Reply Latest reply on Jun 23, 2008 11:54 AM by matthew horn

    Image Loader Question

    Level 7

      I am using a Loader to get an image from a server. The url causes a
      web-service type handler to stream the requested image back to the client.

      No problem so far.

      My problem is that I need to return some kind of text based error message
      like: "Session Expired" or "You don't have access to this image etc"

      I am using the IOError event and trying to access the Loader.content object
      without much success.

      Can anyone help me with this please..



        • 1. Re: Image Loader Question
          matthew horn Level 3
          Does this help?

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()">

          import mx.controls.Alert;
          import flash.events.IOErrorEvent;
          import mx.utils.ObjectUtil;

          private function initApp():void {
          ml1.addEventListener("ioError", myErrorHandler);

          private function myErrorHandler(e:IOErrorEvent):void {
          mx.controls.Alert.show("There was an error loading the SWF");
          ml1.source = null;

          <mx:SWFLoader id="ml1"/>

          matt horn
          flex docs