![]() |
please!! help me with LoaderContext().checkPolicyFile
Уважаемые flash спецы помогите пожалуйста решить проблему с закачкой gif анимации. Необходимо загрузить gif-ки из другого домена по отношению к хост домену флеш модуля, т.е. Флеш фиджет лежит например по адресу: www.mydomain.com, ему необходимо загрузить гиф-рисунки с www.seconddomain.com/gif. В доке вычитал такое решение:
Security.loadPolicyFile("http://www.mydomain.com/test/crossdomain.xml"); ... ... var context:LoaderContext = new LoaderContext(); context.checkPolicyFile = true; loader.load(request, context); //----- в crossdomain.xml : <cross-domain-policy> <allow-access-from domain="*" secure="false"/> </cross-domain-policy> 'локально' - из среды Flashcs3 все работает нормально, НО если выложить под IIS, все равно получаю сообщение об ошибке(при попытке доступа к loader.content): SecurityError: Error #2123: Security sandbox violation: LoaderInfo.content: http://www.mydomain.com/test/widget.swf cannot access www.seconddomain.com/gif/submit_but.gif. No policy files granted access. at flash.display::LoaderInfo/get content() at com.techwire.classes::ResourceLoader/completeBmpHandler() код класса: public class ResourceLoader extends Dispatcher { public function ResourceLoader():void { ... Security.loadPolicyFile("http://www.mydomain.com/test/crossdomain.xml"); loader = new Loader(); request = new URLRequest(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeBmpHandler); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioBmpErrorHandler) ... } public function loadResources(urlsArray:Array=null):void { var context:LoaderContext = new LoaderContext(); context.checkPolicyFile = true; request = new URLRequest(my_url); //loader.load(request); loader.load(request, context); } private function completeBmpHandler(event:Event):void { count++; /* resources.push(Bitmap(Loader(event.target.loader).content)); */ var loader:Loader = event.target.loader; var textureMap:BitmapData = event.target.content.bitmapData.clone(); ... ... } |
Это русскоязычный форум, поэтому задайте свой вопрос по-русски, с учетом пунктов 3 и 5 правил раздела.
|
| Часовой пояс GMT +4, время: 02:25. |
Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.