MovieClipLoader.loadMovie() loads a blank image with proper dimensions

大兔子大兔子 提交于 2019-12-13 04:40:55

问题


So after adding support for dynamic images, a la MovieClipLoader, to a project that I'm working on, I came across some strange behavior. In local tests, the requested images load fine and I am able to use them as I like. However, when the .swf is hosted online, the images are not visible, even though I don't get an onLoadError event. This behavior seems rather odd and is obviously not desirable. Through some testing, I found that the dimensions of the images loaded with the MovieClipLoader matched that of the source images, but getPixel was returning "-1".

I am extracting the images through the BitmapData.draw method, but I don't think this is the cause of the problem, as my implementation functions properly offline.

The images are hosted by a website with an open crossdomain policy. I can't imagine it's a matter of crossdomain security.

It shouldn't be a restriction on the server hosting the .swf, as I am able to retrieve xml data from other websites.

I'm hoping it's something simple, and not an inherent problem with the MovieClipLoader class. I figured I'd try to rule out the latter by coming here.

Thanks.


回答1:


BitmapData.draw has crossdomain security. One must make use of System.security.loadPolicyFile() in order to allow the drawing of crossdomain objects.



来源:https://stackoverflow.com/questions/21694450/moviecliploader-loadmovie-loads-a-blank-image-with-proper-dimensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!