Centering a linked MC in AS3

hey i just learned that you need the


stage.align = StageAlign.TOP_LEFT;

in order to center a mc on the stage correctly…

var mainContent = new mainContentMC;
addChild(mainContent);

stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, onChangeResize);

//setting up the positions
mainContent.x = stage.stageWidth/2;
mainContent.y = stage.stageHeight/2;

function onChangeResize(e:Event)
{
//mainMenu.x = stage.stageWidth/2;
mainContent.x = stage.stageWidth/2;
mainContent.y = stage.stageHeight/2;
}

most of you may had already known this but i thought i’d post it. :wink: