External SWF Scaling Issue Relating to Window Resize

Hello All,

I am trying to scale external swfs to the window size that exists at the point when the button is clicked. The external swf is being loaded into a dynamically created mc in the main swf. I am using a resize handler and the issue i am having is that all external swfs only become veiwable when the window is resized. After the window is resized, they become viewable and scale on the resizing of the window. I call the resize handler to upate the scale base on the window size but to no avail.

The AS (3.0) that I am using can be seen below. Any help would be greatly appreciated.

stop();

var Xpos:Number = 0;
var Ypos:Number = 0;
var defaultSWF:URLRequest = new URLRequest(“test.swf”);
var loader:Loader = new Loader ();
loader.x = Xpos;
loader.y = Ypos;
loader.load(defaultSWF);
addChild(loader);

menu_mc.about_btn.addEventListener(MouseEvent.CLICK,aboutClick);

function aboutClick(e:MouseEvent):void {

removeChild(loader);
var about:URLRequest = new URLRequest("demo1.swf");
loader.load(about);
addChild(loader);
loader.x = Xpos;
loader.y = Ypos;
trace ("click");
resizeHandler();

}

//
// Resize Handler
//

stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;

stage.addEventListener( Event.RESIZE, resizeHandler);

function resizeHandler( e:Event=null ):void
{
var w:Number = stage.stageWidth;
var h:Number = stage.stageHeight;

loader.x = (w-loader.width)/2;
loader.y = (h-loader.height)/2;

if (stage.width/stage.height>loader.width/loader.height) {
	
	loader.width = w;
	loader.scaleY = loader.scaleX;
}else{
	 loader.height = h;
                       loader.scaleX = loader.scaleY;
}

}