# How can I constain the aspect ratio of a dynamic image?

**URL:** <https://forum.kirupa.com/t/how-can-i-constain-the-aspect-ratio-of-a-dynamic-image/222752>\
**Category:** flash\
**Created:** [April 16, 2007, 6:39pm UTC](https://forum.kirupa.com/t/how-can-i-constain-the-aspect-ratio-of-a-dynamic-image/222752 "2007-04-16T18:39:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nlyttle](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@nlyttle](https://forum.kirupa.com/u/nlyttle)\
**Post date:** [April 16, 2007, 6:39pm UTC](https://forum.kirupa.com/t/how-can-i-constain-the-aspect-ratio-of-a-dynamic-image/222752/1 "2007-04-16T18:39:07Z")

</div>

This is the site I’m working on…  
[http://www.bus15.com/clients/shalowitz/Flash/](http://www.bus15.com/clients/shalowitz/Flash/)

and here’s what I’d like to do…

You see the image being loaded into the background (which is a duplicate of the current image being displayed) is currently set to:

```auto
backgroundMC._width = Stage.width;
backgroundMC._height = Stage.height;

```

However, ideally, I’d like the image to fill the screen without distorting the aspect ratio of the image and center itself on the screen. Does anyone know if this is possible?

Thanks!
