Quick Flash Tips #2: Handling ‘Load Never Completed’ IOErrorEvent
This is a potentially annoying error that occurs in Safari/Chrome when you hit refresh or close a tab containing Flash content. If you have the debug player you see:
Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.
It can crash Safari or, in the case of Chrome, show a ‘broken plugin’ screen, shutting down every instance of Flash Player in the process.
Fortunately the fix is easy. To handle it you must add an IOErrorEvent listener to every Loader instance in your project, including the ‘root’ Loader (i.e. the class that is the base of your main SWF).
To handle the main SWF simply add the following code to your base class. In ‘onIOError’ you can handle the error silently should you wish.
root.loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
a-ha :0. awesome tip!
June 15th, 2010