Advanced Scrolling Help

Hey Kirupa!

Basically I need advanced scrolling done and hey I got it but I have run into a few problems with it here is the code


if(_root.player._x > 500){
		_root.player._x ++;
		_root.ground._x --;
	}

Now basically I need the scrolling to move as fast as the player but I do not know how to do that at all. I am sure its something real basic but I cannot figure it out :frowning:
Also how do I make it stop scrolling when he reaches the edge of the map. Because I don’t want it to be scrolling into nothing -.- it just wouldn’t look good

Thanks in advance

~WarChimp