Centralise container if Stage.height > 1000

Hello.

I have a container its loaded content (700 pixels) is aligned to top but when the Stage.height is > 1000, I want to have the container to be centralised and its footer is always aligned to the bottom no matter what the Stage height is.

Right now the footer doesn’t align to the bottom whichever height the Stage is. What went wrong in my codes?

My flash file is embedded to be ‘exact fit’ and ‘100%’

Stage.scaleMode = “noScale”;
fscommand(“fullscreen”, “true”);

var stageListener:Object = {};
stageListener.onResize = reposition;

Stage.addListener(stageListener);

function reposition():Void {
if (Stage.width > 1000) {
sWidth = Stage.width;
} else {
sWidth = 1000
}
if (Stage.height > 900) {
container._y = (Stage.height - 700)/2
footer_mc._y = Stage.height - footer_mc.height;
} else {
container._y = Stage.height - Stage.height
footer_mc._y = Stage.height - footer_mc.height;
}
// footermc._y = Stage.height;
}

reposition();
container.loadMovie(“base.swf”,1);
stop();