Liquid flash issue. I want my mc to scale larger and smaller....but have limits

I am at a loss. And i could use some help. I basically have a main movieclip on my root, called ‘c’. It is 1080 x 832. Large, but it’s intended for large screens.

If someone’s screen is really big, I don’t want the mc to scale up. The max scale up should be 1080 x 832.

However, many on smaller screens won’t be able to see it all, so if the user’s screen is smaller, I’d like it to scale down…proportionately. But there is a limit to how small I want it to go. Anything smaller than 731 x 560 and I want the scaling to stop.

My issues are basically, putting in the correct if statements to make this happen. I also have some confusion as to what I should be listening for, the height or the width…it seems like it would be so much easier if you could just track one of the two…but then if someone’s screen is a dragged to a weird shape, it won’t do what i want.

The other issue is centering. If you take a large MC like I have and just center it all the time. If the browser window is smaller than the MC, the flash movie bleeds out over the browser window and you lose stuff. So I’m struggling with putting in the logic that will make it center if the browser is big enough, while ensuring that if the browser is smaller, my flash doesn’t go off screen at all.

This is the code I’m using, and it ain’t working, and I’m off track, and could use some help.

Thanks.

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

// initiate postitions and scaling values for objects
c._x = Stage.width/2;
c._y = Stage.height/2;

//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
// change movieclip properties when the window is resized.

trace(Stage.width);
trace(Stage.height);

    if(Stage.height <= 832){c._y = 0 + 416}
    else{

    c._y = Stage.height/2;}
    
    if(Stage.width <= 1080){c._x = 0 + 540}
    else{

    c._x = Stage.width/2;}
    
var imageHeight = 832;
var imageWidth = 1080;
var wRatio = Stage.width/imageWidth;
var hRatio = Stage.height/imageHeight;
//Larger Ratio
if (wRatio>hRatio) {
    var ratio = wRatio;
} else {
    var ratio = hRatio;
}
//Resize

if(_global.****this == true){

c._height = imageHeightratio;
c._width = imageWidth
ratio;
}

if(Stage.height > 832){
c._height = c._height;
_global.****this = false;
trace(****this);
}
if(Stage.width > 1080){
c._width = c._width;
_global.****this = false;
trace(****this);
}

if(Stage.height < 832){

_global.****this = true;
trace(****this);
}

if(Stage.width < 1080){

_global.****this = true;
trace(****this);
}

};
Stage.addListener(sizeListener);