Guard AI Help

Hi, im no good at AI for a start so please forgive me. I need my enemy guard in this .fla to be able to patrol a small square on the screen and then if the hero comes close within a certain range of this patrolling enemy guard then the enemy guard will chase the hero. And when the enemy guard who is currently folllwing the hero comes close to him he will play his attack animation.

If thats not already difficult then i need to remind you that the enemy needs to be playing the correct animation each time depending on the direction he’s facing in. Its basically Zelda style AI for enemys but i have no idea how to do it :pa: .