Title: as3 URLLoader always failing with IOError
Tags: actionscript-3;urlloader
Question: I'm having problems with URLRequest in a flex application, it fails with whatever url I try:
var r:URLRequest = new URLRequest("http://stackoverflow.com");
var l:URLLoader = new URLLoader();
l.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent):void {
trace(e);
});
l.load(r);
This is the error I get:
[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Error de secuencia. URL: http://stackoverflow.com"]
Obviously the url is not down as I'm using it right now to post this. I've also tried others such as google.com which work ok in my browser, and I get the same error. Any one knows what could be the problem?
Thank you
Comment: That was a mistake when posting the code, the actual code has IOErrorEvent, fixed it.

Comment: I also thought it could be an environment problem, however the compiled swf also fails to load any url after putting it in a webserver located in another machine. The project was created with flashdevelop, and i haven't changed any settings

Comment: Ok here is a full explanation of the issue, I'm using a library called MochiAds that loads external content. The library handles the network sandbox problem to load the ads. It's a very well known library and it seems to be working ok for everybody else. For me, it doesn't work on my local environment, and it doesn't work on the mochi hosting. After some local testing, I found out that it was failing when trying to load the ads with urlloader. I posted the url that it attempts to load in my browser and worked ok, then I tried to load other urls, and I discovered that for some reason none work

Comment: That code shouldn't even compile, your listener function is accepting a type that doesn't exist (`e:IO_ERROR` should be `e:IOErrorEvent`).

Comment: I see. Anyways I tested your code and it works fine for me with no error. I added a COMPLETE listener to it and got the expected data. Can you provide more info on the environment you're testing in?

Comment: Your latter issue of the compiled SWF is normal. `A SWF file in the local-with-filesystem sandbox may not load data from, or provide data to, a resource that is in the network sandbox.`.

Comment: Interesting. My old games all use MochiAds as well and they're working OK at the moment on a local test..

Comment: Works fine for me.  Copy and pasted.  Probably a system environment issue. Security Sandbox? though that should be a different error.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 8, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:04/25/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<actionscript-3><urlloader>', 'Title': 'as3 URLLoader always failing with IOError', 'ViewCount': 997, 'id': 16226013, 'user_AboutMe': None, 'user_AccountId': 2687731.0, 'user_DisplayName': 'user2321768', 'user_Reputation': 21.0, 'user_Views': 1.0, 'user_id': 2321768.0}}