MovieClipLoader.loadMovie()加载适当尺寸的空白图像图像、适当、加载、空白

2023-09-09 21:31:07 作者:很久没笑了

所以增加了对动态图像的支持后,一拉的MovieClipLoader,以一个项目,我的工作,我碰到一些奇怪的行为。在本地测试,所请求的图像加载罚款,我能够使用它们,因为我喜欢。然而,当瑞士法郎在线托管,图像是不可见的,即使我没有得到一个onLoadError事件。这种行为似乎相当奇怪的和显然是不可取的。经过一些测试,我发现装有的MovieClipLoader图像的尺寸匹配的源图像的这一点,但getPixel被返回-1。

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".

我通过方法的BitmapData.draw提取图像,但我不认为正确的下线,这是问题的原因,因为我实现的功能。

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.

它不应该承载瑞士法郎在服务器上的限制,因为我可以从其他网站检索XML数据。

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

我希望它是简单的东西,而不是一个内在的问题与MovieClipLoader类。我想我会尽量排除后期来到这里。

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.

感谢。

推荐答案

一直的BitmapData.draw安全跨域。一个必须利用System.security.loadPolicyFile()的,以便允许跨域对象的绘制。

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