# When the browser is resized, how do I make the movie resize?

**URL:** <https://forum.kirupa.com/t/when-the-browser-is-resized-how-do-i-make-the-movie-resize/260551>\
**Category:** flash\
**Created:** [May 16, 2008, 5:40pm UTC](https://forum.kirupa.com/t/when-the-browser-is-resized-how-do-i-make-the-movie-resize/260551 "2008-05-16T17:40:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Line](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@Line](https://forum.kirupa.com/u/Line)\
**Post date:** [May 16, 2008, 5:40pm UTC](https://forum.kirupa.com/t/when-the-browser-is-resized-how-do-i-make-the-movie-resize/260551/1 "2008-05-16T17:40:26Z")

</div>

When the browser is resized, how do I make the movie resize?

I made this page here:  
[http://www.LineDetail.com/fullscreen.php](http://www.LineDetail.com/fullscreen.php)

in the HTML parameters, I put width 100% and height 100% and in the .swf file I have:  
Stage.scaleMode = “noScale”;  
Stage.align = “TL”;

That helps make my objects not get stretched out, and the align code to help position my items.

Now, I notice if I were to shrink or make my browser stretch out. The swf doesn’t resize on it’s own to fill the space when larger or resize when you shrink the browser width/height. I’ve been told to use a listener, but I have no idea how it works, I’ve tried putting in scripts with no luck.

If you have a 2.0 script or can help me here I’d appreciate it!

Thanks,  
-Line

---

<div class="post-metadata">

**Author:** ![Line](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@Line](https://forum.kirupa.com/u/Line)\
**Post date:** [May 16, 2008, 5:48pm UTC](https://forum.kirupa.com/t/when-the-browser-is-resized-how-do-i-make-the-movie-resize/260551/2 "2008-05-16T17:48:42Z")

</div>

Here’s my theory:

Some AS2.0 script loop that Checks to see if the browser width/height has been changed.  
If change detected,

Stage.resize();

object\_mc.\_x = Stage.width/2;

in other words, it’ll reset the stage to match the browser’s new width/height

and then my object\_mc will change it’s x coordinate to match half the stage’s width as it was doing originally.

-Line

---

<div class="post-metadata">

**Author:** ![Line](https://avatars.discourse-cdn.com/v4/letter/l/b38774/32.png) [@Line](https://forum.kirupa.com/u/Line)\
**Post date:** [May 16, 2008, 6:09pm UTC](https://forum.kirupa.com/t/when-the-browser-is-resized-how-do-i-make-the-movie-resize/260551/3 "2008-05-16T18:09:21Z")

</div>

Found it in the Flash help!  
var stageListener:Object = new Object();  
stageListener.onResize = function() {

–put all your movieclip positions scales and stuff here –  
–then close off with the following: –

};  
Stage.addListener(stageListener);

ta da it works!
