# How I can catch Security sandbox violation error?

**URL:** <https://forum.kirupa.com/t/how-i-can-catch-security-sandbox-violation-error/258923>\
**Category:** Uncategorized\
**Created:** [April 29, 2008, 4:15pm UTC](https://forum.kirupa.com/t/how-i-can-catch-security-sandbox-violation-error/258923 "2008-04-29T16:15:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfm\_](https://avatars.discourse-cdn.com/v4/letter/d/3da27b/32.png) [@dfm\_](https://forum.kirupa.com/u/dfm_)\
**Post date:** [April 29, 2008, 4:15pm UTC](https://forum.kirupa.com/t/how-i-can-catch-security-sandbox-violation-error/258923/1 "2008-04-29T16:15:21Z")

</div>

Ok this simple script that I made

```auto
try {
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadedPicture);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    loader.load(new URLRequest("http://msnbcmedia1.msn.com/j/msnbc/Components/Photo_StoryLevel/080429/080429-sadr-city-6a.hmedium.jpg"), new LoaderContext(true));
} catch(&#1077;) {
    error_txt.appendText("ERROR! ");
}

function loadedPicture(info:Event):void {
    error_txt.appendText("NOPE ");
    addChild(info.target.content);
}

function errorHandler(info:IOErrorEvent):void {
    error_txt.appendText(" IO proxy");
}

function securityErrorHandler(info:SecurityErrorEvent):void {
    error_txt.appendText(" S proxy");
}

```

Like you see I’m trying to catch the SecurityError error, but I cannot catch it, it appears again:

> SecurityError: Error #2123: Security sandbox violation: LoaderInfo.content: [http://www.blablablabla.com/loading.swf](http://www.blablablabla.com/loading.swf) cannot access [MSN](http://msnbcmedia1.msn.com/j/msnbc/Components/Photo_StoryLevel/080429/080429-sadr-city-6a.hmedium.jpg). No policy files granted access.  
> at flash.display::LoaderInfo/get content()  
> at loading\_fla::MainTimeline/loadedPicture()

Is it not supposed to catch it with try…catch??? When I run only **NOPE** appears in error\_txt. Any ideas how I catch this error?
