6

How to resolve Adobe Flex error: "Error #2036: Load Never Completed"?

Roman Kagan
  • 10,440
  • 26
  • 86
  • 126

4 Answers4

6

Don't forget you can also add an IOErrorEvent-listener to the loaders, so you can trace a bit more information for yourself. The code beneath is a general starter, it'll probably need a bit more information before it actually works in flash/flex.

swfLoaderInstance:SWFLoader = new SWFLoader();
swfLoaderInstance.source = "someSWFFile.swf";
swfLoaderInstance.addEventListener(IOErrorEvent.IO_ERROR, handleError);

public function handleError(event:IOErrorEvent):void{
    trace(event.target);
    //etc...
}
Timo
  • 61
  • 1
  • 2
5

The problem was with mis-locating the SWF modules. As soon as appropriate location was set for generated SWF modules - the error disappear.

Roman Kagan
  • 10,440
  • 26
  • 86
  • 126
  • In my case, the problem was also occurring when loading assets, not only .swf modules. (I fixed it by using absolute URLs: ```/dir/someSWFFile.swf``` instead of ```someSWFFile.swf```) – Nicolas C Apr 10 '17 at 13:27
1

If it's a internet browser thing, and you are using Google Chrome. Go to Histor>Clear all browsing Data. Tick in these thins only, you wouldn't want to lose the browsing data.

Empty the cache, Delete cookies and other site and plug-in data, Clear saved Autofill form data

Clear it from beginning of time. Then try to load the thing you want to. Worked for me fine:)

Ram kiran Pachigolla
  • 20,897
  • 15
  • 57
  • 78
XeX
  • 11
  • 1
1

I had the same error message. In my case, it was due to the Loader getting garbage collected.

This is the code I had issues with:

private function loadImageFromUrl( imageUrl:String ):AbstractOperation
    {
        var result:AbstractOperation = new AbstractOperation();

        var loader:Loader = new Loader();
        loader.contentLoaderInfo.addEventListener( Event.COMPLETE, function ( e:Event ):void
        {
            result.dispatchCompleteEvent( loader.content );
        } );
        loader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, function ( event:IOErrorEvent ):void
        {
            result.dispatchErrorEvent( event );
        } );
        loader.load( new URLRequest( imageUrl ) );

        return result;
    }

And this is the good code:

private var m_loaderReferences:Dictionary = new Dictionary();

private function loadImageFromUrl( imageUrl:String ):AbstractOperation
    {
        var result:AbstractOperation = new AbstractOperation();

        var loader:Loader = new Loader();
        m_loaderReferences[imageUrl] = loader; // Need to keep a reference to the loader to avoid Garbage Collection
        loader.contentLoaderInfo.addEventListener( Event.COMPLETE, function ( e:Event ):void
        {
            result.dispatchCompleteEvent( loader.content );
            delete m_loaderReferences[imageUrl];
        } );
        loader.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, function ( event:IOErrorEvent ):void
        {
            result.dispatchErrorEvent( event );
            delete m_loaderReferences[imageUrl];
        } );
        loader.load( new URLRequest( imageUrl ) );

        return result;
    }

I reference the loader from a Dictionary to avoid the GC. I remove the loader from the Dictionary when it is done loading.

Wim Deblauwe
  • 25,113
  • 20
  • 133
  • 211