as2 or other graphics technique, set Bounds in short code

if (_bounds != undefined) {
mc._x = Math.max(_bounds.xMin, Math.min(mc._x, _bounds.xMax));
mc._y = Math.max(_bounds.yMin, Math.min(mc._y, _bounds.yMax));
}

Posted in: AS3