Having an affair an be emotional as opposed to physical. Some people think that if you haven't had sexual contact with another person that you have not had an affair. I disagree.
To me, a close friendship becomes an affair when the emotional importance of it begins to overtake the importance of your primary relationship. When you tell your secrets to and spend more time with the person than you do your with your partner, and the sight or idea of your close friend begins to make your heart race and your palms sweaty, you're moving in the wrong direction. When your usually innocuous conversations take on a flirtatious tone and eventually a sexual tone, the affair is taking root.
If you engage in online sex chat or phone sex, you're cheating. If you declare your affection to that person, you're cheating. If you spend more time with that person after acknowledging your affection, even without sex, it becomes like dating, and you're cheating.
If you disagree, ask your spouse or SO how they would feel about it. If they think you're cheating, you're cheating.