If you have ever received this error it can be quite frustrating and there are a lot of not so helpful answers out there on the web. Because of that I wanted to post this real simple solution. All you need to do is add an event listener to the item calling the URLRequest. Here is a simple example using a Sound object:
var audio:Sound = new Sound(); audio.addEventListener(IOErrorEvent.IO_ERROR, handleIOError); audio.load(new URLRequest("myfile")); function handleIOError(evt:IOErrorEvent):void { //handle error if needed }
It’s that simple. I hope this helped! If this helped please post a comment so that others can find this simple solution.
Ya it’s good to remember that wrapping that in a try..catch does not work! You need to add the IOErrorEvent listener.
2.5 years later — and your tip still helped someone.
Thank you!
~Bill