[as1] mouse repel/avoidance

I’m trying to make a movieclip avoid my mouse, like on this site:http://exopolis.com. I want the movieclip to never leave a defined area (200 x 200). I’m having a little trouble getting it to work. Here’s my code on the movieclip:

onClipEvent (enterFrame) {
if (_root._xmouse<200 && _root._xmouse>0) {
//x movement
mx = _root._xmouse;
if (mx<_x) {
dx = _x-mx;
} else {
dx = mx-_x;
}
moveSpeedx = dx/30;
if (mx>_x) {
_x = _x-moveSpeedx;
} else {
_x = _x+moveSpeedx;
}
}
if (_root._ymouse<200 && _root._ymouse>0) {
//y movement
my = _root._ymouse;
if (my>_y) {
dy = _y+my;
} else {
dy = my+_y;
}
moveSpeedy = dy/30;
if (my<_y) {
_y = _y+moveSpeedy;
} else {
_y = _y-moveSpeedy;
}
}
}

Right now the mouse is still leaving the defined area, and it slows down when my mouse gets closer rather. Any help would be appreciated.