Copy link to clipboard
Copied
I'm using BulkLoader to load a .swf file from a website. The problem I'm having is that occasionally, say 1 out of 50 download attempts, I get the following error message:
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
The .swf does then actually load and display properly, but I'm still concerned by this behaviour.
I've tracked the error down to this function called on a Loader object. The .swf has been downloaded by this point, and is trying to be cleaned up.
loader.unloadAndStop(true);
I can't seem to listen for this IOError event by adding listeners to the loader object. Why would unloadAndStop() be reporting a URL not found ?
Copy link to clipboard
Copied
if you execute that while something is loading or before anything is loaded, you'll probably trigger that error.
Copy link to clipboard
Copied
I don't think that's the cause in this case. I can create the problem from the following code:
private var bulkLoader:BulkLoader = new BulkLoader("Test");
bulkLoader.addEventListener(Event.COMPLETE, onComplete);
private function reload():void
{
trace("loading again");
bulkLoader.add("My_swf_url", {preventCache:true});
bulkLoader.start();
}
private function onComplete(e:Event):void
{
bulkLoader.removeAll();
reload();
}
Copy link to clipboard
Copied
where's the unloadAndStop() that triggers the error in that message 2 code?
Copy link to clipboard
Copied
It's called in the removeAll() function
Copy link to clipboard
Copied
delete the add() call.
if that eliminates the error, you probably cannot use add() when the bulkloader has no content.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now