-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Some of the LoadingItems are missing event listeners relating to security, meaning that if there was a problem, the SWF will crash (and if you're using the debug player, you get a nice dialog box).
To change:
ImageItem:
loader.contentLoaderInfo.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onErrorHandler, false, 0, true);
URLItem
loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, super.onSecurityErrorHandler, false, 0, true);
Include the relevant removeEventListener() as well
Also, as most of the load() calls on the respective loaders throw different errors, at the minute, most of them only catch SecurityError, meaning if another was thrown, same problem, the SWF crashes.
For all LoadingItems, replace:
}catch( se : SecurityError){ onSecurityErrorHandler(_createErrorEvent(se)); }
with:
}catch( se : SecurityError){ onSecurityErrorHandler(_createErrorEvent(se)); }catch ( e:Error) { onErrorHandler(_createErrorEvent(e)); }