ActionScript [Error # 2036: loading never completed] with dynamically generated images

I work with an image caching system that generates different images based on a URL route. Original images located outside the document root directory and cached versions are added to / cache in the web root. In short, in Flash, if I point to the Loader on the route, I get the "Load Never Completed" error for the first time (if the cached image has not yet been generated).

 Error opening URL 'http://characters.dev/cache/Pledges/16107/48_48c/jen001.jpg' Error #2036: Load Never Completed. URL: http://characters.dev/cache/Pledges/16107/48_48c/jen001.jpg 

The cached image is still generated, and the next time I run the application, the actual file will load without errors. I have the correct headers sent when creating the original image and recording it, so I wonder why Flash is not receiving a response (it seems to work fine in the browser window).

 header("Content-type:image/jpeg"); echo $this->getResponse()->setBody(file_get_contents($cachedFile)); 

Any ideas on how to fix this? Errors seem to drown out the Flash application.


If this helps, here are the response headers:

Image request:

 HTTP/1.1 200 OK Date: Tue, 23 Jun 2009 17:52:49 GMT Server: Apache X-Powered-By: PHP/5.2.6 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: PHPSESSID=6b746d4ed010c288a824522597698ea2; expires=Fri, 24-Jul-2009 17:52:50 GMT; path=/; domain=.characters.dev Content-Length: 3575 Content-Type: image/jpeg 

Request for image caching:

 HTTP/1.1 200 OK Date: Tue, 23 Jun 2009 17:53:27 GMT Server: Apache Last-Modified: Tue, 23 Jun 2009 17:52:50 GMT ETag: "24e6c62-df7-a8bd0080" Accept-Ranges: bytes Content-Length: 3575 Content-Type: image/jpeg 
+6
php flash image actionscript-3 zend-framework
source share
2 answers

Flash IDE problem seems. This is actually impossible.

+2
source share

I had a similar problem to stop the error you want to catch IOErrorEvent.IO_Error

 _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError_handler, false, 0, true); public function ioError_handler(event:IOErrorEvent):void { Alert.show(event.toString()); } 

While this got rid of the error, some of the images where not loading in Opera. In the end, I got this to work by changing the image handler code (asp.net C #) to

 context.Response.ClearContent(); context.Response.ClearHeaders(); context.Response.ContentType = "image/jpg"; context.Response.Cache.SetCacheability(HttpCacheability.NoCache); context.Response.Cache.SetNoStore(); context.Response.Cache.SetExpires(DateTime.MinValue); context.Response.BufferOutput = false; context.Response.BinaryWrite(photo); 

before I tried to view the image in the browser, the download will be downloaded, but it will not complete the download in Opera, therefore it will not trigger the download completion event.

Hope this helps (even if it's in another language)

+2
source share

All Articles