Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing event listeners and error catches on some LoadingItems #142

Open
divillysausages opened this issue Mar 11, 2014 · 0 comments
Open

Comments

@divillysausages
Copy link

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)); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant