2009-04-14 51 views
1

好的我有一个应用程序使用< mx:Image />标签加载产品图像并更改源代码。 .SWF位于网站的http端,图像位于网站的https端。所以起初我收到此错误:Flex:跨域图像加载?

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()

所以经过一番研究,我发现这篇文章:http://www.damienking.net/tutorial-using-remotely-hosted-images-flex我做了什么,它说,现在我得到这样类似的错误:

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()

而且之后我点击dismiss到弹出的错误框,图像会在之后加载,但会被设置为实际图像的大小,而不是设置组件的宽度和高度。我不知道该怎么做。

任何帮助表示赞赏。

谢谢!

+0

在访问之前是否将LoaderContext设置为true? – dirkgently 2009-04-14 17:42:37

回答