# Flash CS4 AS2 - Resizing problems

**URL:** <https://forum.kirupa.com/t/flash-cs4-as2-resizing-problems/314870>\
**Category:** flash\
**Created:** [October 11, 2010, 4:56pm UTC](https://forum.kirupa.com/t/flash-cs4-as2-resizing-problems/314870 "2010-10-11T16:56:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stein149](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@stein149](https://forum.kirupa.com/u/stein149)\
**Post date:** [October 11, 2010, 4:56pm UTC](https://forum.kirupa.com/t/flash-cs4-as2-resizing-problems/314870/1 "2010-10-11T16:56:14Z")

</div>

I’m working off of a website template and am not exactly sure how my elastic function works. When I export the movie and a small (about half my screen) window pops up the website looks good, however once I make the window any larger it starts cutting off the bottom of my bg image. I’ve had some success changing the code to

```auto
Stage.align = "T"; and Stage.scaleMode = "showAll";

```

but then there are just solid blocks on either side of the background image that don’t look very good.

I am hoping there is a way to fix it so the bottom will be locked in place and not get cut off when resizing the window. I appreciate any ideas, here is some code that might help:

mainpage, Frame 1

```auto

Stage.align = "TL";
Stage.scaleMode = "noScale";
_quality = "BEST";

```

mainpage, Frame 2

```auto

//Background url loaded 
if(this.background.attributes.enable==1) { Bg_enable=true; }else{ Bg_enable=false; } 
Bg_position = this.background.attributes.bgposition; 
Bg_url = this.background.attributes.path;

```

mainpage, Frame 4

```auto

//bg config    
var listenerBgr:Object = new Object();
listenerBgr.onResize = function():Void { 
if (Bg_position == "extended") {        
lie = _root.bg;        
lie._width = Stage.width;        
lie._height = Stage.height; } 
else if (Bg_position == "center") {        
lie = _root.bg;        
lie._x = (Stage.width-lie._width)/2;        
lie._y = (Stage.height-lie._height)/2; }

```

\*\*\*\*BGpage, Frame 1

```auto

Stage.align = "TL"
Stage.scaleMode = "noScale";
function resizeIm(movieIm, width_, height_) {    
var _loc3 = width_/movieIm._width;    
var _loc2 = height_/movieIm._height;        
if (_loc2 < _loc3 ) {        
movieIm._width = width_;        
movieIm._height = movieIm._height*_loc3; } 
if (_loc2 > _loc3 ) {        
movieIm._width = movieIm._width*_loc2;        
movieIm._height = height_; } };    
flagPlay = true;
S = new Object();
S.onResize = function() {    
btnStopPlay._x = Stage.width-100;    
resizeIm(_this.mainPic, Stage.width, Stage.height);}
S.onResize();
Stage.addListener(S);

```

Im stumped, thanks for any help
