here is some code i saw made my ed mack in marmotte's rockypack

Code:
RockyLimit = _root.SpritesBackground.rocky.limit.getbounds(_root.SpritesBackground.rocky);
	function RockyMove(x, y) {
		with (_root.SpritesBackground.rocky) {
			if (!_root.GraphicsBackground.Graphics.limit.hittest(_x+x+rockylimit.xmin+1, _y+y+rockylimit.ymin+1, true)) {
				if (!_root.GraphicsBackground.Graphics.limit.hittest(_x+x+rockylimit.xmax-1, _y+y+rockylimit.ymin+1, true)) {
					if (!_root.GraphicsBackground.Graphics.limit.hittest(_x+x+rockylimit.xmin+1, _y+y+rockylimit.ymax-1, true)) {
						if (!_root.GraphicsBackground.Graphics.limit.hittest(_x+x+rockylimit.xmax-1, _y+y+rockylimit.ymax-1, true)) {
							_x += x;
							_y += y;
						}
					}
				}
			}
		}
	}
}
how does this work?