Check component position to enable/unable mouse events

Hello,
I am trying to create a logic where if a component (head), which has an “on Mouse over” assigned to it, is in a specific location (position variable), disable Mouse Over Events for that component. If it is in any other position, enable Mouse Over Events.
I have made a logic but it doesn’t work. any ideas?
Thanks,
Gerard