Facing problem

Hello fellow kirupans, I have a small problem. I am making a fighting game, and I want the hero to face his enemy at all time, but I dont know how. My code is a bit messed up:

 
onClipEvent (enterFrame) {
	 if (direction) {
		 if (_x>_root.player2._x) {
			 if (_xscale<0) {
				 _xscale *= -1;
				 }
			}
	 }
}
onClipEvent (enterFrame) {
	 if (direction) {
		 if (_x<_root.player2._x) {
			 if (_xscale<0) {
				 _xscale = -100;
				 }
			}
	 }
}