# Resize loaded jpg

**URL:** <https://forum.kirupa.com/t/resize-loaded-jpg/235326>\
**Category:** Uncategorized\
**Created:** [August 10, 2007, 8:38am UTC](https://forum.kirupa.com/t/resize-loaded-jpg/235326 "2007-08-10T08:38:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryan786](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@ryan786](https://forum.kirupa.com/u/ryan786)\
**Post date:** [August 10, 2007, 8:38am UTC](https://forum.kirupa.com/t/resize-loaded-jpg/235326/1 "2007-08-10T08:38:47Z")

</div>

hi guys. I’m using a loader to load a jpg. After it’s loaded, I want to resize it. Problem is, when I go to resize it, I get a runtime error saying:

```auto
 SecurityError: Error #2122: Security sandbox violation: LoaderInfo.content: http://address_omitted_here.swf cannot access http://address_omitted_here.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
    at flash.display::LoaderInfo/get content()
    at viewer_fla::MainTimeline/initHandler()

```

Here’s the code I was using to load it:

```auto
function initHandler(e:Event):void {
    
    e.target.loader.x = 0; e.target.loader.y = 0;
    if (e.target.content.width > e.target.content.height) {
        e.target.content.width = Global.STAGE_WIDTH;
        e.target.content.scaleY = e.target.content.scaleX;
        e.target.loader.y += (Global.STAGE_HEIGHT - e.target.content.height)/2;
    } else if (e.target.content.height >= e.target.content.width) {
        e.target.content.height = Global.STAGE_HEIGHT;
        e.target.content.scaleX = e.target.content.scaleY;
        e.target.loader.x += (Global.STAGE_WIDTH - e.target.content.width)/2;
    }
    Global.picsLoaded++;
}
for (i=1; i<=Global.NUMPICS; i++)
{
    loader = new Loader();
    loader.load(new URLRequest(this["p"+i]));
    //loader.load(new URLRequest("p"+i+".jpg"));
    loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
    clip.getChildByName("pic"+i).addChild(loader);
    clip.getChildByName("pic"+i).alpha = 0;
}

```

I can load the pictures fine, it’s just when I try to resize them with

```auto
e.target.content

```

that I get the error. How else can I resize the pictures?
