в общем криво но работает

Код:
xx = Stage.width/2-mc2._xmouse;
yy = Stage.height/2-mc2._ymouse;
mc.onRelease = function() {
if (xx<Stage.width/2-mc2._xmouse && yy<Stage.height/2-mc2._ymouse {
moving2(Stage.width/2-mc2._xmouse-20,Stage.height/2-mc2._ymouse-20);
}
if (xx>Stage.width/2-mc2._xmouse && yy<Stage.height/2-mc2._ymouse) {
moving2(Stage.width/2-mc2._xmouse+20,Stage.height/2-mc2._ymouse-20);
}
if (xx<Stage.width/2-mc2._xmouse && yy>Stage.height/2-mc2._ymouse) {
moving2(Stage.width/2-mc2._xmouse-20,Stage.height/2-mc2._ymouse+20);
}
if (xx>Stage.width/2-mc2._xmouse && yy>Stage.height/2-mc2._ymouse) {
moving2(Stage.width/2-mc2._xmouse+20,Stage.height/2-mc2._ymouse+20);
}
moving(Stage.width/2-mc._xmouse,Stage.height/2-mc._ymouse;
xx = Stage.width/2-mc2._xmouse;
yy = Stage.height/2-mc._ymouse;
};