MovieClipLoader.loadMovie() loads a blank image wi

2019-09-09 02:39发布

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条回答
祖国的老花朵
2楼-- · 2019-09-09 03:41

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

查看更多
登录 后发表回答