# Minimum size restriction on Full Screen Website

**URL:** <https://forum.kirupa.com/t/minimum-size-restriction-on-full-screen-website/263220>\
**Category:** flash\
**Created:** [June 13, 2008, 1:48pm UTC](https://forum.kirupa.com/t/minimum-size-restriction-on-full-screen-website/263220 "2008-06-13T13:48:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![artriste](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@artriste](https://forum.kirupa.com/u/artriste)\
**Post date:** [June 13, 2008, 1:48pm UTC](https://forum.kirupa.com/t/minimum-size-restriction-on-full-screen-website/263220/1 "2008-06-13T13:48:26Z")

</div>

Hello,

I’m using a typical full size website that proportionally scales on browser resize.

I would like to set a minimum dimensions so the user cannot squeeze the website more than 600x420 for example. The page will then start to crop if you go beyond these dimensions.

This must be only a couple lines of code?  
Please let me know if you have any idea.  
Thanks

---

<div class="post-metadata">

**Author:** ![artriste](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@artriste](https://forum.kirupa.com/u/artriste)\
**Post date:** [June 13, 2008, 3:49pm UTC](https://forum.kirupa.com/t/minimum-size-restriction-on-full-screen-website/263220/2 "2008-06-13T15:49:42Z")

</div>

I have found an excellent tutorial for this kind of setup.

[http://www.genericwebaddress.com/articles-flash/fullscreen-flash-movie-tutorial-05](http://www.genericwebaddress.com/articles-flash/fullscreen-flash-movie-tutorial-05)

However, I would like to know if there is an even more generic solution, all in one place.  
Something that tells the stage to never shrink down below 600 x 480, instead of having to set up each functions of all your elements to stop repositioning or shrinking after those minimum dimensions are reached.

Ignore the onResize listener once the stage is below certain dimensions.  
Restart to listener once you expand it back up.

By the way, this is a portfolio which is Aligned Top Left.

Thanks!

---

<div class="post-metadata">

**Author:** ![artriste](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@artriste](https://forum.kirupa.com/u/artriste)\
**Post date:** [June 13, 2008, 4:33pm UTC](https://forum.kirupa.com/t/minimum-size-restriction-on-full-screen-website/263220/3 "2008-06-13T16:33:51Z")

</div>

Alright, I solved the problem based on the idea behind tutorial.

What you need to do basically is to set a IF statement, telling if the stage is larger than this dimension, apply the resize. Didn’t even need an Else statement. Maybe I should just to be safe?

Here is the code:

```auto

Stage.align = "TR";
Stage.scaleMode = "noScale";
sizeListener = new Object();
sizeListener.onResize = function() {
resizeVertically();
};
Stage.addListener(sizeListener);

function resizeVertically() {

// the if statement checks if the stage is at least 420px 
// hight to apply scaling/repositioning, otherwise it won't do 
// anything when you resize your browser, which is what we want

	 if (Stage.height >= 420) {

//all the element scale and position code goes here

		yourMC1._y = Stage.height/2;	
		yourMC2_mc._y = 0;
		yourMC3_mc._height = Stage.height;
	 }
}
resizeVertically();

```

Note that in my example, I only make it happen vertically.  
This is probably the first time I can contribute something to this forum, which I think can be seriously useful! It might seem extremely simple for many flash users… but for the rest of us, enjoy!

---

<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 13, 2008, 6:33pm UTC](https://forum.kirupa.com/t/minimum-size-restriction-on-full-screen-website/263220/4 "2008-06-13T18:33:11Z")

</div>

yeah you got the right idea.

```auto

function onResize()
{
    if(Stage.width <= 600)
    {
        trace("stage too small");
    }
    if(Stage.height <= 420)
    {
       trace("stage too small");
    }
}

```
