# Proportional Image Resizing

**URL:** <https://forum.kirupa.com/t/proportional-image-resizing/318502>\
**Category:** flash\
**Created:** [January 21, 2011, 6:27pm UTC](https://forum.kirupa.com/t/proportional-image-resizing/318502 "2011-01-21T18:27:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacktorrance\_1](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@jacktorrance\_1](https://forum.kirupa.com/u/jacktorrance_1)\
**Post date:** [January 21, 2011, 6:27pm UTC](https://forum.kirupa.com/t/proportional-image-resizing/318502/1 "2011-01-21T18:27:50Z")

</div>

Hi All,

I’m relatively new to AS3.0 and Flash in general but I have made enough progress to establish a site with an xml image gallery.

I would like each image in the xml gallery to be sized depending upon the stage dimensions so that each user, depending on the screen resolution / window resolution of their browser, will see the image at the best resolution.

I think that the design of my website would support the images being displayed with the longest dimension (whether that be the height or width of the image) at a factor of 0.9 of the stage width or height (depending whether the image is portrait or landscape).

If we assume that each image in the gallery is termed imgArray[p] do I need an if / else statement to control how to display the image proportionally on the stage at a 0.9 factor?

Not sure if I’m making myself clear but I’d appreciate any input.

Many thanks/
