views:

1829

answers:

4

I have created an ashx handler that returns an image to my flex app. If I go directly to the url for example (www.mysite.com/handler.ashx?id=34) the browser will display the image. If you set the source of an image control in flex to the same address. I get "Error #2124: Loaded file is an unknown type.". Any hints

+1  A: 

There are a few things that you can check that may help:

  1. Security: "You can reference an image by using a URL, but the default security settings only permit Flex applications to access resources stored on the same domain as your application. To access images on other servers, you must use a crossdomain.xml file."

  2. Can you load or embed other images?

Review this documentation to see if there is anything you missed with loading your image: http://livedocs.adobe.com/flex/3/html/help.html?content=security2_04.html

Here is a link that can help with troubleshooting the image httpstatus: http://blog.flexexamples.com/2007/11/04/detecting-whether-an-image-loaded-successfully-in-flex/

shadenite
A: 

Make sure the MIME type returned in the response header with the image is correct. Flash Player could be getting confused if your response header says it contains "text/html" rather than something like "image/png".

joshtynjala
A: 

flash player has bug.

http://bugs.adobe.com/jira/browse/FP-42

A: 

Make sure that the served image is not Bitmap. Browsers can handle bitmaps that claim to be PNG/JPEG Flash cannot.

yanis