That would do my head in and I'd forever be wondering if i had done something to upset them. Its a bit of a head doer, slightly confusing, would also make me more wary in the future.
Im with 4getmenot I would just take it in my stride. People are strange sometimes if you havent done anything to upset them then they maybe just grew bored. Dont let it get to you and dont chase them for attention
i find it annoying when people blow hot and cold on you, doesn't mean I'm not grown up! Its just a bit unfair to do that to someone at least without some sort of explanation as to why.
talk to the person, ask if you've done something to offend them and go from there, there are so many misundertandings in this world simply because people dont talk. its no good walking around with your miserable feelings getting bitter about it, have a good talk clear the airand find ot where you stand. then if the person doesnt want to know you move on and find real friends.