HOW Resize a Movieclip When window opens?

I’ve used Greensocks Tween lite to build a photo gallery that resizes with the window browser. The only problem is that when I first open up the window the gallery is not properly scaled to fit the window size. How can I make is so when you first open up the window the movieclip is told to resize to the current window size? Here is my code below.

import gs.;
import fl.transitions.
;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.dispatchEvent(new Event(Event.RESIZE));
var wTween:Tween;
var hTween:Tween;

//GREEN SOCK
//Code to center the gallery and scale it with the window size
stage.addEventListener(Event.RESIZE, resizeListener);
function resizeListener (e:Event):void
{
var startWidth:int = gallery.width;
var startHeight:int = gallery.height;
var startX:int = gallery.x;
var startY:int = gallery.y;

gallery.width = stage.stageWidth-40;
gallery.height = stage.stageHeight-40;

if (gallery.scaleX < gallery.scaleY)
   { gallery.scaleY = gallery.scaleX; }
else 
   { gallery.scaleX = gallery.scaleY; }

gallery.x = (gallery.stage.stageWidth / 2) - (gallery.width / 2);
gallery.y = (gallery.stage.stageHeight / 2) - (gallery.height / 2);

TweenLite.from(gallery, .5, {width:startWidth, height:startHeight, x:startX, y:startY});

}

//smoothing

function loadProdComplete(e:Event):void {
trace("stage width: " + stage.width);
trace("stage height: " + stage.height);
var bit:Bitmap = e.target.content;
if(bit != null)
bit.smoothing = true;
gallery.addChild(e.target.content);

}

function loadImage (event: MouseEvent):void {
i++; // this adds 1 to our index variable
if(i>=images.length) { i = 0; }
trace("Index: "+i);
loader.load(new URLRequest(images*));
trace("Image: " + images*);
//stage.dispatchEvent(new Event(Event.RESIZE));
}

// VARIABLES
var loader = new Loader();
var i:int = 0;
var images:Array = new Array(
http://farm4.static.flickr.com/3603/3665894767_4c0490ebe6.jpg”,
http://farm4.static.flickr.com/3364/3665894125_658397d3ec.jpg
);

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
loader.load(new URLRequest(images*));
gallery.addEventListener(MouseEvent.CLICK, loadImage);