Пробуйте:

Код:
maxWidth = 300;
minWidth = 100;
maxHeight = 300;
minHeight = 100;
function check_func() {
if (_root.movie._x>_root.maxWidth) {
_root.movie._x = _root.maxWidth;
} else if (_root.movie._x<_root.minWidth) {
_root.movie._x = _root.minWidth;
}
if (_root.movie._y>_root.maxHeight) {
_root.movie._y = _root.maxHeight;
} else if (_root.movie._y<_root.minHeight) {
_root.movie._y = _root.minHeight;
}
}
leftbtn.onPress = function() {
movie._x -= 5;
_root.check_func();
};
rightbtn.onPress = function() {
movie._x += 5;
_root.check_func();
};
upbtn.onPress = function() {
movie._y -= 5;
_root.check_func();
};
downbtn.onPress = function() {
movie._y += 5;
_root.check_func();
};