2 Replies Latest reply on Dec 29, 2009 2:21 PM by lvelicanu

    jpeg image loaded with Loader->loadBytes() does not display when app is deployed on remote server

    lvelicanu

      I am loading a JPEG  image from the server, using the Loader->loadBytes() and that works when the app is deployed under my local Tomcat server.  When I deploy it on other servers the image is not displayed,  instead of the image I see II*

       

      On the server side I have java, Spring, BlazeDs and I use RemoteObject on the client.

      The code that loads the image looks like below:


      private function imageLoadResultHandler(event:ResultEvent):void {
          var result:ArrayCollection = event.result as ArrayCollection
          var bytes : ByteArray = result.getItemAt(0) as ByteArray;

          _loader = new Loader();
          _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler);
          _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loaderFaultHandler);
          _loader.loadBytes(bytes);
      }                

      private function loaderCompleteHandler(event:Event):void {
          var loaderInfo:LoaderInfo = event.currentTarget as LoaderInfo;
          var img:Image = new Image();
          img.source = loaderInfo.content;
          myPanel.addChild(img);
      }
         
      <mx:RemoteObject id="ro" destination="imageLoadService">
           <mx:method name="loadImage" result="imageLoadResultHandler(event)" fault="faultHandler(event)" />
      </mx:RemoteObject>


      Any help with this problem is much appreciated.

      Thank you,

      Lumi Velicanu