Check my hitTest script

 
if (this.hitTest(_root.wall) && this._y == _root.wall._y+1) {
this._y += 6;
scaleSpeed = 0;
}
if (this.hitTest(_root.wall) && this._y == _root.wall._y-1) {
this._y -= 6;
scaleSpeed = 0;
} else {
if (this.hitTest(_root.wall) && this._y>=_root.wall._y-20) {
scaleSpeed = 0.0;
}
if (this.hitTest(_root.wall) && this._y>=_root.wall._y+20) {
scaleSpeed = 0.0;
} else {
if (!this.hitTest(_root.wall)) {
	scaleSpeed = 0.5;
 

what ive got is a wall MC that u can walk in font of and behind using swapDepth. what this code does is check if my character is 40px into the wall MC and if he is, it puts him back 10px. It works fine on both sides of the wall but the problem is that i dont want it to put him back so much, i realy only want to stop him, but if i lower the pushback rate then he just walks through the wall.

Any help? thanx alot

::::EDIT:::

I advanced upon my code alittle so that it duznt scale up and down between pushbacks. hopefully i wont need it if sumone can help me just to stop my manMC

Also here is a link to the SWF without my graphics…

[color=#003366]http://www.undeadninja.com/files/swap%20depthsMX.swf[/color]