I think the best way to do this is using a tile based game world, to do this you can create a 2D array to represent the playing area as a grid. A little like this
where 0's represent walls and 1's represent walkable tiles. You can then base your characters movement on the position in the array. eg if the character is positioned at grid[1][1] to move down you could do grid[1 + 1][1]. You can define areas of the grid that are patrolled by the enemy and if the player goes in one of these the enemy can calculate which direction he needs to move to follow the player (assuming he can move in that direction, i.e. no wall blocks the path) I'm sure there has been plenty of stuff written about this type of game over on the games forum http://board.flashkit.com/board/foru....php?forumid=5