# Sizing Image Area

**URL:** <https://forum.kirupa.com/t/sizing-image-area/273356>\
**Category:** flash\
**Created:** [October 14, 2008, 7:03pm UTC](https://forum.kirupa.com/t/sizing-image-area/273356 "2008-10-14T19:03:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sweaver72](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@sweaver72](https://forum.kirupa.com/u/sweaver72)\
**Post date:** [October 14, 2008, 7:03pm UTC](https://forum.kirupa.com/t/sizing-image-area/273356/1 "2008-10-14T19:03:15Z")

</div>

I’m trying to load an image (image.jpg) into a movie (imageLoader). I want the image loader to be 150 pixels by 150 pixels, so that only a square of image.jpg is shown (basically a thumbnail). My code is currently warping the image (because the image is not 150 by 150), but I’m not sure what I did wrong…

Here is my code:

```auto

var imageLoader:Loader;

 
function loadImage(url:String):void {

imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);

}

loadImage("image.jpg");
 
function imageLoaded(e:Event):void {

imageArea.addChild(imageLoader);
imageArea.width = 100;
imageArea.height = 100;
imageArea. x = 150;
imageArea. y = 150;

}
 
function imageLoading(e:ProgressEvent):void {
}

```

Any help would be appreciated. Thanks!
