1
votes

OK I have an application that loads product images using the < mx:Image /> tag and changing the source. the .SWF is on the http side of the website and the images are on the https side of the site. so at first I was getting this error:

SecurityError: Error #2122: Security sandbox violation: Loader.content: http://www.MYDOMAIN.com/Masonic.swf cannot access https://www.MYDOMAIN.com/masonic_images/13_red_d2-MAS72479bl_red.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded. at flash.display::Loader/get content() at SmoothImage/http://www.adobe.com/2006/flex/mx/internal::contentLoaderInfo_completeEventHandl er()

So after some research I found this article: http://www.damienking.net/tutorial-using-remotely-hosted-images-flex I did what it said and I am now getting this similar error:

SecurityError: Error #2123: Security sandbox violation: Loader.content: http://www.MYDOMAIN.com/Masonic.swf cannot access https://www.MYDOMAIN.com/masonic_images/12_red_d2-MAS60338bl_red.jpg. No policy files granted access. at flash.display::Loader/get content() at SmoothImage/http://www.adobe.com/2006/flex/mx/internal::contentLoaderInfo_completeEventHandl er()

Also after I click dismiss to the error box that pops up, the images do load afterwards, but are then set to the size of the actual image not the width and height I set the component to. I have no clue what to make of that.

Any help is appreciated.

THANKS!

1
Are you setting the LoaderContext to true before accessing?dirkgently
Yes I am doing it like the tutorial said how to, in the image initialize function.JD Isaacks
Also I have other Flash apps that load https images to the http side without issues. I don't really understand why it is an issue now, they are the same domain.JD Isaacks
Well I got it to work using a proxy after reading this article: raghuonflex.wordpress.com/2007/10/11/…JD Isaacks
You should make that an answer and accept it instead of leaving it here in the comments if you got it to work.Ryan Guill

1 Answers

0
votes

I was able to get it to work by using a proxy, via the instructions on this article: http://raghuonflex.wordpress.com/2007/10/11/jsp-proxy-code-for-sourcing-cross-domain-images/?referer=sphere_related_content/ I think the images load slower and its probably not the ideal solution but at least it works now and thats better than nothing.