0

我正在使用 BulkLoader 将图像、SWF、XML 等加载到游戏中。

在本地工作时,根据资产的类型,content属性LoadingItem总是很好:Bitmap如果它是图像,MovieClip如果它是 SWF 等。

当我测试相同的 swf,但在 localhost 下,或在线时,该content属性始终是一个Loader对象。

这是正常的吗?我错过了一个参数还是什么?

4

1 回答 1

0

好的,对于那些有同样问题的人 - ImageLoader,第 57 行:

override public function onCompleteHandler(evt : Event) : void {
    try{
        // of no crossdomain has allowed this operation, this might
        // raise a security error
        _content = loader.content;
        super.onCompleteHandler(evt);
    }catch(e : SecurityError){
        // we can still use the Loader object (no dice for accessing it as data
        // though. Oh boy:
        _content = loader;
        super.onCompleteHandler(evt);
        // I am really unsure whether I should throw this event
        // it would be nice, but simply delegating the error handling to user's code 
        // seems cleaner (and it also mimics the Standar API behaviour on this respect)
        //onSecurityErrorHandler(e);
    }

};

基本上发生的事情是 aSecurityError正在发生(尽管是默默地),这会将content属性设置为 theLoader而不是Loader.content.

Security.loadPolicyFile()通过在加载前添加一个来修复它。

于 2012-01-19T14:10:48.443 回答