RPG Moving character with NPC's

Im using the RPG game tutorials code for moving my character:
//////////////////////////////////////////////
onClipEvent (load) {
s = 3;
b = this.getBounds(this);
function move(x, y) {
if (_root.stopwalk == false) {
if (!_root.hit.hitTest(_x+x+b.xmin+1, _y+y+b.ymin+1, true)) {
if (!_root.hit.hitTest(_x+x+b.xmax-1, _y+y+b.ymin+1, true)) {
if (!_root.hit.hitTest(_x+x+b.xmin+1, _y+y+b.ymax-1, true)) {
if (!_root.hit.hitTest(_x+x+b.xmax-1, _y+y+b.ymax-1, true)) {
_x += x;
_y += y;
}
}
}
}
}
}
}
onClipEvent (enterFrame) {
keydown = false;
if (_root.stopwalk == false) {
if (Key.isDown(Key.UP)) {
keydown = true;
_root.hero.gotoAndStop(1);
move(0, -s);
}
if (Key.isDown(Key.DOWN)) {
keydown = true;
_root.hero.gotoAndStop(5);
move(0, s);
}
if (Key.isDown(Key.LEFT)) {
keydown = true;
_root.hero.gotoAndStop(2);
move(-s, 0);
}
if (Key.isDown(Key.RIGHT)) {
keydown = true;
_root.hero.gotoAndStop(4);
move(s, 0);
}
}
if (!keydown) {
_root.hero.char.stop();
}
}

/////////////////////////////////////

I need to figure out how to add an npc. Also if there is a better way I can have this character walk according to the art based walls its from what i see not supported with anything above flash 5.