Hey, How can I use the advanced direction object with AI

I got two AI that moves towards me using position stuff

If X of AI is 200 less than Player then X+1
etc.

If The player less than 200 pixels away it will stop and start firing. But I have a few probs.

1. Get DistObj("ADO", 0)>=200
+X Position of ("Enemy")>X("Player")
+Restrict Actions for 00"-50
+("Enemy") internal flag 4 is off
{ Set X position of Enemy to ( X(" Enemy ") -1 ) }
{ Change direction to *Left* }

*This one makes it move to left if it is 200 pixels away and X of the enemy is less than Player, the internal flag turns on when it touches a barricade from the left.*

Problems = The animation won't change,
If you go out of range and then in after
a few seconds it and then in it will fire
alot more bullets.