In your original post you said your wife more or less thinks you are a prideful, arrogant bad guy. It is hard to know what someone else thinks. If your wife said these things to you, then you need to understand why she thinks these things. If you don’t really know how she feels, have a sincere conversation with the goal of finding out so you can have a better marriage. If you do not see the situation from your wife’s perspective, you will not be effective in changing her opinion of you.
Affairs are a betrayal of trust, whether emotional, ‘nearly physical’, or physical. Flirting harms your marriage. How would you feel if your wife did these things? Have you made a sincere apology? Are you making amends? You need to do this on a daily basis to show your wife you value her and are committed to your marriage.
What can you do to change your behaviors that harm your marriage? It is your behaviors that will make or break your marriage.