# Scaling an image proportionally

**URL:** https://forum.kirupa.com/t/scaling-an-image-proportionally/144060
**Category:** Uncategorized
**Created:** [April 11, 2005, 1:06pm UTC](https://forum.kirupa.com/t/scaling-an-image-proportionally/144060 "2005-04-11T13:06:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![abcdefg](https://avatars.discourse-cdn.com/v4/letter/a/c77e96/32.png) [@abcdefg](https://forum.kirupa.com/u/abcdefg)
#### Post date: [April 11, 2005, 1:06pm UTC](https://forum.kirupa.com/t/scaling-an-image-proportionally/144060/1 "2005-04-11T13:06:20Z")

</div>

I need to scale an image so that it won’t distort. Of course I don’t know the dimensions of this image.

I tryed something like this but it doesn’t seem to work at all.

```auto

                loadMovie("../ImageUploadFolder/optimized_images/" + this.file, "_root.back_mc.image_panel_6.imgContainer6");
                if (this.file._width > 100) {
                    var scale = this.file._width / 100;
                    _root.back_mc.image_panel_6.imgContainer6._yscale = this.file._height * scale;
                    _root.back_mc.image_panel_6.imgContainer6._xscale = this.file._width * scale;
                }

```

Any ideas?

Thanks  
-D
