How to set Registration Point via AS?

hi there,

i made this little script which draws two exactly the same squares, except for the rotation. But it seems the registration points of the squares aren’t in the center (of the squares). How can i set this via AS?

thnx in advance,

grenouille.

 
function drawSquare(x,y,w,alpha,i,rot) {
alpha = 100;
_root.createEmptyMovieClip("mc"+i,i);
with (_root["mc"+i]) {
lineStyle(1,0x00000,alpha);
moveTo(x,y);
lineTo(x+w,y);
lineTo(x+w,y+w);
lineTo(x,y+w);
lineTo(x,y);
}
_root["mc"+i]._rotation = rot;
}
drawSquare(100,100,50,100,1,0);
drawSquare(100,100,50,100,2,45);