myListener.onResize

I could do with some help on Stage.addListener. I’m a bit lost at the minute

Right I have an Movieclip named studio_mc sitting on stage and I have 2 buttons, 1 button slides the studio_mc to the centre of the stage using

Studio_mc.ySlideTo ( Stage.height/2,1,”easeOutExpo”)

And the other button slides the studio_mc off stage using

Studio_mc.ySlideTo ( Stage.height-250,1,”easeOutExpo”)

Both _x positions are also set up for centre stage too, no problems there and everything works fine and the movieclip moves on and off stage depending on what button is pressed. What I have a problem with is the myListener. onResize function.

What do I have to set up for the Stage listener to reset the position of the studio_mc to Stage.height/2 whilst its on stage and to Stage.height-250 if its of stage when the browser is resized, been driving me nuts

I can’t use this

var myListener:Object = new Object ();
myListener.onResize = function(){
studio_mc.ySlideTo(Stage.height/2,1,”easeOutExpo”)
};
Stage.addListener(myListener);

as the studio_mc might be off stage when the browser is resized. Any ideas would be really helpful as I’m I bit of an AS numpty.