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

29,988

Solution 1

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

Solution 2

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...
}

Solution 3

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:)

Solution 4

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.

Share:
29,988
Roman Kagan
Author by

Roman Kagan

Roman started working as a programmer as a teenager when he was hired to hack Prolog at a Minsk artificial intelligence lab. Roman was one of the first developers using Java to create web applications. Since 1991, Roman has been consulting for companies including Hewlett-Packard, EDS, GM, Ford, Chrysler, Fanuc Robotics, Comerica and Polk.

Updated on October 16, 2020

Comments

  • Roman Kagan
    Roman Kagan over 3 years

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

  • Nicolas C
    Nicolas C about 7 years
    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)