Rotation doesn't work once background moves

Hi,

I am programming enemy AI so that if he sees you and you are within a certain distance, he fires at you. As I am doing this in a side scrolling game, when the background, which contains the enemy, moves, the rotation of the enemy doesn’t lock on to the good guy. The rotation works fine at the beginning when nothing is moving but as soon as it starts moving, the enemy doesn’t lock on again he just stays at the same place.

Could someone help me please? I am posting the Fla which contains the code for moving the background and the enemy’s rotation.

Thanks

Abs