# Problem resizing proportionately

**URL:** <https://forum.kirupa.com/t/problem-resizing-proportionately/224959>\
**Category:** flash\
**Created:** [May 7, 2007, 3:31pm UTC](https://forum.kirupa.com/t/problem-resizing-proportionately/224959 "2007-05-07T15:31:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandesign](https://avatars.discourse-cdn.com/v4/letter/b/b5e925/32.png) [@brandesign](https://forum.kirupa.com/u/brandesign)\
**Post date:** [May 7, 2007, 3:31pm UTC](https://forum.kirupa.com/t/problem-resizing-proportionately/224959/1 "2007-05-07T15:31:08Z")

</div>

OK, I’ve tried a few different but similar methods of resizing background images in a movie clip to take up the full size of the browser. They work, but the problem is the photos aren’t resizing proportionately. I’m trying to pull off something more like [redtettemer.com](http://redtettemer.com)  
where the image stretches and the other side goes off screen to keep the proportions.  
Heres a couple versions of the code I tried:

Portfolio\_bg is the movie clip that calls in swf files which contain background animations and images.

Stage.align = “TL”;  
Stage.scaleMode = “noScale”;

//All movie clips you then use will automatically NOT scale. To get them to scale add this code to your actions layer:

portfolio\_bg.\_xscale = Stage.width \*.10;  
portfolio\_bg.\_yscale = Stage.height \*.15;

stageListener = new Object();  
// Create a function for the event you want to listen for  
stageListener.onResize = function ()  
{  
portfolio\_bg.\_xscale = Stage.width \*.10;  
portfolio\_bg.\_yscale = Stage.height \*.15;

// Code for response to browser resizing here  
}  
// Assign a listener for the Stage object  
Stage.addListener(stageListener);

aaaand attempt number 2:

//scale stage background with browser window  
Stage.scaleMode = “noScale”;  
Stage.align = “TL”;

var stageListener:Object = new Object ();  
stageListener.onResize = positionContent;  
Stage.addListener(stageListener);

function positionContent():Void {  
portfolio\_bg.\_width = Stage.width;  
portfolio\_bg.\_height = Stage.height;

}

positionContent();

any help would be much appreciated as I’ve been working on this for a while.
