Показать сообщение отдельно
Старый 19.09.2012, 12:22
gagaga вне форума Посмотреть профиль Отправить личное сообщение для gagaga Найти все сообщения от gagaga
  № 1  
Ответить с цитированием
gagaga

Регистрация: Apr 2012
Сообщений: 239
По умолчанию loader не грузит картинки в google chrome fp 11.2, 11.3

в коде собственно смотреть нечего, но всё же:
Код AS3:
package controller {
    import ...
 
    public class LoadAdsCommand extends BaseCommand implements ICommand{
        override public function execute(notification:INotification):void {
            var adLoader:Loader = new Loader();
            var urlRequest:URLRequest;
 
            loadAd();
 
            function loadAd():void {
                urlRequest = new URLRequest(StringUtil.substitute("http://{0}/assets/ads/{1}"
                        , ApplicationFacade.URL, notification.getBody()..Img[0].@src));
                adLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
                adLoader.load(urlRequest);
            }
            function completeHandler(event:Event):void {
                adLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, completeHandler);
                applicationProxy.ads.push((adLoader.content as Bitmap).bitmapData);
                delete notification.getBody().child("Img")[0];
                if(notification.getBody().hasOwnProperty("Img")) {
                    loadAd();
                } else {
                    sendNotification(ApplicationFacade.SHOW_AD_CMD);
                    var adRollerTimer:Timer = new Timer(10000);
                    adRollerTimer.addEventListener(TimerEvent.TIMER, function(event:TimerEvent):void {
                        sendNotification(ApplicationFacade.SHOW_AD_CMD);
                    });
                    adRollerTimer.start();
                }
            }
        }
    }
}