Error #2032 while loading "http://web.archive.org" through URLLoader
Here is my code in AS3 ...
var request:URLRequest = new URLRequest("http://web.archive.org/web/*/http://stackoverflow.com");
var requestVars:URLVariables = new URLVariables();
var loader:URLLoader = new URLLoader();
request.method = URLR开发者_Python百科equestMethod.GET;
loader.addEventListener(Event.COMPLETE, onLoaded);
loader.load(request);
... ...
Error Detail : Unhandled ioError:. text=Error #2032
I recommend downloading Fiddler or Charles and using that to determine what the server response was.
One issue you have is that there isn't a onLoaded function created - at least in your documentation above. I also noticed that you had an * in the url. I replaced that with one of the links 20080703183923 which returns a HTML page in flash to use. Here is the code to grab the info in flash ->
var request:URLRequest = new URLRequest("http://web.archive.org/web/20080703183923/http://stackoverflow.com");
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);
loader.load(request);
function onLoaded(event:Event):void
{
trace(event.target.data);
/************************************************************\
returns the HTML printed out in the Flash Output.
You could then do whatever it is you want with it.
\************************************************************/
}
I tried to reproduce your problem. Here is what I found:
- Error 2032 is a Stream Error, which means the file could not be loaded.
- You should add always add an event handler to catch IOErrorEvent.IO_ERROR. You could use
error.getStackTrace()
orerror.message
to find out more about why the error occured. - You cannot download any resources from web.archive.org, because it doesn't seem to serve a crossdomain.xml policy file. Security in Flash prevents you from downloading a URL from a remote server which does not explicitly allow your domain to access it. This is probably the reason for your page request to fail.
精彩评论