Skip to content

Missing event listeners and error catches on some LoadingItems #142

Description

@divillysausages

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions