I got the code and it worked but If i want to constrain to rectangle where do i put the dimesnsions

-----------------------------------
on (press) {
drag = true;
xd = _x-_root._xmouse;
yd = _y-_root._ymouse;
Mouse.hide();
}
on (release, releaseOutside) {
drag = false;
xfinal = _root._xmouse;
yfinal = _root._ymouse;
Mouse.show();
}
on (release) {
}
------------------------------------

plz help I'll be thankful