Game: walls. how?

I am making a game, where you need to move around with a character in a big maze. Now, my problem is, that i’d need an idea that how to make walls in the game? I can do everything else.

I already know a wall-type, but its very anoyying.
for example, i make a character, and a wall.
i place a simple-moving AS to the character. Then, I put an AS to the wall like this:

onClipEvent (enterframe) {
if(this.hitTest(_root.character)) {
_root.character._x -= 5
}
}

So, if the character hits the wall in the right direction, it will be pulled the other way, in four words: It stops the character:D
But, if I try to go through on the other side, it’ll be speedin up. So… i need to make boxes of these kinda walls, and its sometimes go wrong. So, i need a script, for MX6, if possible, that stops the characters in any ways.

Is it possible for MX6? If so, please tell me, It would help me a LOT.