# Full flash resize only width

**URL:** <https://forum.kirupa.com/t/full-flash-resize-only-width/312045>\
**Category:** Uncategorized\
**Created:** [July 23, 2010, 1:51pm UTC](https://forum.kirupa.com/t/full-flash-resize-only-width/312045 "2010-07-23T13:51:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chiefrebelangel](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@chiefrebelangel](https://forum.kirupa.com/u/chiefrebelangel)\
**Post date:** [July 23, 2010, 1:51pm UTC](https://forum.kirupa.com/t/full-flash-resize-only-width/312045/1 "2010-07-23T13:51:19Z")

</div>

hey guys.

I been using a fullscreen resizable script for some time, works great for fullscreen flashes 100%height and 100%width.

Now i would like to have an image to only resizing 100% to the browser width  
but have its height as it is, and of course without distorting the image.

the code im using is the below

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

picHeight = new Object ();  
picHeight = gallery.\_height / gallery.\_width;

picWidth = new Object ();  
picWidth = gallery.\_width / gallery.\_height;

if ((Stage.height / Stage.width) \< picHeight) {  
gallery.\_width = Stage.width;  
gallery.\_height = picHeight \*gallery.\_width;  
} else {  
gallery.\_height = Stage.height;  
gallery.\_width = picWidth \* gallery.\_height;  
};

gallery.\_x = (Stage.width / 2) - (gallery.width / 2);  
gallery.\_y = (Stage.height / 2) - (gallery.\_height / 2);

sizeListener = new Object();

sizeListener.onResize = function() {

```
if ((Stage.height / Stage.width) &lt; picHeight) {

gallery._width = Stage.width;
gallery._height = picHeight * gallery._width;
} else {
gallery._height = Stage.height;
gallery._width = picWidth * gallery._height;
};    

```

gallery.\_x = (Stage.width / 2) - (gallery.width / 2);  
gallery.\_y = (Stage.height / 2) - (gallery.\_height / 2);

}

Stage.addListener(sizeListener);

i tried to modify the script but without luck, is it any possibility at all to do this, or i need to use another code then above:nose:
