100% works on resize but not on initial load?

Hey everyone. This issue has been beat to death, and normally I’ve got it down, but I’m having a problem with a new site I’m working on.

I’ve got two elements that stay one on the left and one on the right at all times no matter what height/width. They also resize height-wise to fit height, but don’t resize-width, just adjust space.

It all works just fine, but only after resizing the window. On loading it still shows it at 800x600.

I also know that it’s in Flash, not on the HTML end because it happens in the flash preview as well.

Here’s the code I have:


Stage.scaleMode = "noScale";
Stage.align = "c";

var HPositioner:Number = (Math.round((Stage.width - 800) / 2));
var VPositioner:Number = (Math.round((Stage.height - 600) / 2));

function HPositionCubes () {
   if (Stage.width >= 801) {
	   var HPositioner:Number = (Math.round((Stage.width - 800) /2));
	   setProperty(femaleBody, _x, 0 - HPositioner); 
	   setProperty(maleBody, _x, (800 + HPositioner) - 319);
   } else {
	   setProperty(femaleBody, _x, 0);
	   setProperty(maleBody, _x, 800 - 319);
   }
}

function VPositionCubes () {
   if (Stage.height >= 601) {
	   var VPositioner:Number = (Math.round((Stage.height - 600) /2));
	   setProperty(femaleBody, _y, 0 - VPositioner);
	   setProperty(maleBody, _y, 0 - VPositioner);
	   setProperty(bg, _y, 0- VPositioner);
   } else {
	   setProperty(femaleBody, _y, 0);
	   setProperty(maleBody, _y, 0);
	   setProperty(bg, _y, 0);
   }
}

maleBody._height = Stage.height;
femaleBody._height = Stage.height;
HPositionCubes();
VPositionCubes();
setProperty(bg, _width, Stage.width);
setProperty(bg, _height, Stage.height);

var resizeListener:Object = new Object();
Stage.addListener(resizeListener);
resizeListener.onResize = function () {
     setProperty(femaleBody, _height, Stage.height);
     setProperty(maleBody, _height, Stage.height);
	 setProperty(bg, _height, Stage.height);
	 setProperty(bg, _width, Stage.width);
     HPositionCubes();
     VPositionCubes();
}

This is driving me nuts. Any help would be greatly appreciated.