They show attraction and flirt because they are interested. You go on a date, hookup, and you thought she had a great time. Then they will seemingly "pull back" randomly. There are two reasons for this. Either:
A) She noticed a deviation in your behavior, and noticed that you were just "putting on a show". This happens to a lot of guys early in the game. They jump back into their AFC tendencies once they feel they "got" the girl. Nothing is more depressing for a girl to find out that her "smooth player" is really just a poser in disguise. Once she sees your true colors.. there is no going back.
B) She is changing her behavior to see how you REACT.
-Some guys over-react and ask her "why aren't you talking to me???". BIG MISTAKE. This will cause her to lose any/all interest in you.
-Other guys say "hmph. Ill just ignore her back until she shows interest again." This is backward thinking and VERY rarely works. Don't fall into her games and try to see if she will stick her head out and come chase you. 90% of women won't do this.
The only thing you should do is show that you're still interested and act how you always had with her. Pretend that she isn't pulling any sh!t, and get it in your head that she still really likes you. If you show her that her "distant" behavior doesn't bother you, she will be even more attracted to you because you have a strong frame.
If this doesn't work.. then you just need to cut your losses because a fickle woman is not worthy of your time. She may have met another man, or she just has too much sh!t going in her life. whatever the reason.. its her loss