# Constraint scaling of bg image

**URL:** <https://forum.kirupa.com/t/constraint-scaling-of-bg-image/311828>\
**Category:** Uncategorized\
**Created:** [July 17, 2010, 2:16pm UTC](https://forum.kirupa.com/t/constraint-scaling-of-bg-image/311828 "2010-07-17T14:16:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fandalis](https://avatars.discourse-cdn.com/v4/letter/f/6f9a4e/32.png) [@fandalis](https://forum.kirupa.com/u/fandalis)\
**Post date:** [July 17, 2010, 2:16pm UTC](https://forum.kirupa.com/t/constraint-scaling-of-bg-image/311828/1 "2010-07-17T14:16:43Z")

</div>

Hi, i placed a fullscreen background image in my website but when i scale my browser window it also scales unproportionaly (or distorted). can anyone help me with my code so the scale is constraint to the browser window. heres the code. thanks in advance!

```auto
Stage.scaleMode = "noScale"
Stage.align = "TL";
bgTest._width = Stage.width
bgTest._height = Stage.height

myListener = new Object();
myListener.onResize = function () {
//resize background picture here
bgTest._width = Stage.width
bgTest._height = Stage.height
}
Stage.addListener(myListener);

```
