How can you avoid flirting, especially if you are in a serious and secure relationship:
Be open with your partner. Talk as comfortably as possible about flirtatious conduct.
Learn to respect your partner.
Set boundaries with people to avoid slipping into flirtations.
I provide a survey to support the need to respect your partner in this audio clip.