Jun 28, 2013

Handling Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error

I've been coding Actionscript 3 for 5 - 6 years. But, somehow I'm still getting this error especially when I'm working with sound and in many times I'm still confuse to solve this error and always searching for the answer. Actually, there isn't one absolute answer, but you can make flash player to show more detailed error and from there you will have the right solution. The solution is simple, add listener for IOErrorEvent :
var s:Sound = new Sound();
s.addEventListener(IOErrorEvent.IO_ERROR, onIOErrorHandler);
function onIOErrorHandler(e:IOErrorEvent):void {
    trace("Sound Error: " + e.text);
}
In many case you'll see error like this one :
Error #2032: Stream Error. URL: file: file_name 
Simple error but so likely to happen. Hope this help :)

No comments:

Post a Comment