Why would a guy be very friendly and flirty to me in front of others but slightly aloof and cold in private?

Around others he gives me warm and long smiles or smirks but when we are alone he looks at me like I'm some ugly piece of old furniture, turns away and keeps conversations short. He is very confident and normally likes to talk with everyone

Why would a guy be very friendly and flirty to me in front of others but slightly aloof and cold in private?
Post Opinion