There is a bug with that event. It does not fire on all occasions...
I had it when applying a targeting sound to my target frame. The event does not fire correctly all the time. I circumvented it by hooking the Show event of my target health frame. If that became visible I ran the script. My code for this is:
Code:
--sound
self:RegisterEvent("PLAYER_TARGET_CHANGED", playTargetSound)
self.Health:SetScript("OnShow",function(s)
playTargetSound(self,"PLAYER_TARGET_CHANGED")
end)
You can do UnitExists("target") for unit checking aswell.
--------------------------
Sidenote on editing:
Do not just write you fixed it. Write down how! If others find your post via Google they will find no solution to an already solved problem. Which is bad.