# Scaling background proportionally

**URL:** <https://forum.kirupa.com/t/scaling-background-proportionally/290521>\
**Category:** flash\
**Created:** [June 16, 2009, 3:51am UTC](https://forum.kirupa.com/t/scaling-background-proportionally/290521 "2009-06-16T03:51:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [June 16, 2009, 3:51am UTC](https://forum.kirupa.com/t/scaling-background-proportionally/290521/1 "2009-06-16T03:51:31Z")

</div>

I know how to scale a background normally, but what I am doing here is a bit different. I have my main background that scales correctly. I then have a second background that gets loaded when you select a sub menu. The background starts under the submenu however and this is whats throwing me off. If you view it here: [http://aimanmotor.com/\_ronnie](http://aimanmotor.com/_ronnie) and click aiman motor on the bottom right (wait for the second bg to load) you can see it is scaling, however I need it to stay right under that white bar (the sub nav bar), but its not. This is what I am using to resize.

```auto

private function onResize(e:Event = null):void
{
	bgHolder.width = stage.stageWidth;
	bgHolder.height = stage.stageHeight;
	(bgHolder.scaleX < bgHolder.scaleY) ? bgHolder.scaleY = bgHolder.scaleX : bgHolder.scaleX = bgHolder.scaleY;
}

```

anyone know a solution?
