# Scaling an Image Proportionatly

**URL:** <https://forum.kirupa.com/t/scaling-an-image-proportionatly/255849>\
**Category:** flash\
**Created:** [March 27, 2008, 3:50pm UTC](https://forum.kirupa.com/t/scaling-an-image-proportionatly/255849 "2008-03-27T15:50:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [March 27, 2008, 3:50pm UTC](https://forum.kirupa.com/t/scaling-an-image-proportionatly/255849/1 "2008-03-27T15:50:31Z")

</div>

Hey all.  
I’m a little stuck on this here. I can I want to resize the width of an image proportionate to the images height.

I’m having a huge blonde moment right now as I can’t wrap my head around it…

Here’s what I have…

```auto

        private function imgCompleteListener(e:Event):void {
            loader.content.x = loaderBg.x;
            loader.content.y = loaderBg.y;
            if (loader.content.height > loaderBg.height){
                loader.content.height = loaderBg.height;
                // Here's where the width should go
            }
        }

```

Thanks in advance…
