Code overloading computer

I am using the following code to find out if the wall hits the corners of my character. this code is placed on the character
[AS]
topleft = _root.wall.hitTest(getBounds(_root).xMin,getBounds(_root).yMin,true);
[/AS]

Then changing it appropriately for the other three corners. I then placed dynamic text fields on the screen which link to the variables for testing purposes. This worked fine.

I then tried to use this code on my character to stop him walking through walls. Code also placed on character

[AS]
if(topleft && bottomleft){
this._x += 5;
}
[/AS]

but with this code, when the character hits the wall it overloads the computer and stops responding.

If any one can tell me why it is doing this and how I can get around this problem without massive code changes to my whole game.