Поведение BulkLoader при загрузке из Интернета - PullRequest
0 голосов
/ 19 января 2012

Я использую BulkLoader для загрузки изображений, SWF, XML и т. Д. В игру.

При локальной работе свойство content в LoadingItem всегда хорошо в зависимости от типаasset: Bitmap, если это изображение, MovieClip, если это SWF и т. д.

Когда я тестирую тот же swf, но на локальном хосте или в сети, свойство content всегда равно Loaderобъект.

Это нормально?Я пропускаю параметр или что-то?

1 Ответ

0 голосов
/ 19 января 2012

ОК, для тех, у кого такая же проблема - 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);
    }

};

По сути, происходило то, что SecurityError происходило (хотя и тихо), что устанавливало бы свойство content на Loader, а не Loader.content.

Исправлено добавление Security.loadPolicyFile() перед загрузкой.

...