我正在使用 BulkLoader 将图像、SWF、XML 等加载到游戏中。
在本地工作时,根据资产的类型,content
属性LoadingItem
总是很好:Bitmap
如果它是图像,MovieClip
如果它是 SWF 等。
当我测试相同的 swf,但在 localhost 下,或在线时,该content
属性始终是一个Loader
对象。
这是正常的吗?我错过了一个参数还是什么?
我正在使用 BulkLoader 将图像、SWF、XML 等加载到游戏中。
在本地工作时,根据资产的类型,content
属性LoadingItem
总是很好:Bitmap
如果它是图像,MovieClip
如果它是 SWF 等。
当我测试相同的 swf,但在 localhost 下,或在线时,该content
属性始终是一个Loader
对象。
这是正常的吗?我错过了一个参数还是什么?
好的,对于那些有同样问题的人 - 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()
通过在加载前添加一个来修复它。