0

I load a file :

var aLoader:Loader = new Loader();
aLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadedEvent);
aLoader.load(new URLRequest(url_photo), new LoaderContext(true));

function onLoadedEvent(event:Event):void{
    var li:LoaderInfo = LoaderInfo(event.target);
    var loader:Loader = li.loader;
    log(loader.content.width.toString());
}

On safari or firefox i have no problem to access at the content. But in Chrome it doesn't work and i found no error code. Only Chrome seems to work with the crossdomain.xml. Is it a lose of the loaderContext ?

The log (which works) :

function log(msg:String, caller:Object = null):void{
    var str:String = "";
    if(caller){
        str = getQualifiedClassName(caller);
        str += ":: ";
    }
    str += msg;
    trace(str);
    if(ExternalInterface.available){
        ExternalInterface.call("console.log", str);
    }
}

Thanks.

Julien Malige
  • 3,295
  • 1
  • 20
  • 39
  • it seems to be a Pepper Flash bug.. – Julien Malige Feb 05 '15 at 13:07
  • aLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadedEvent); should be always placed prior to loading. – BotMaster Feb 05 '15 at 13:48
  • It's not in the same order in my code, sorry it's a copy/paste mistake. But I used this type of solution : http://stackoverflow.com/questions/14735975/loader-complete-event-does-not-work-with-browser-as3 – Julien Malige Feb 05 '15 at 14:38

0 Answers0