This is a great question, and probably one that a lot of other teachers have as well. The attention craving student can definitely be a challenge. I don't know if there is a magic answer that will suddenly solve this issue, or "fix" this type of behavior, but I do have a few thoughts about handling it:
*Stay unemotional when dealing with the attention seeking behavior. This type of student seems to thrive on getting a rise out of the teacher. Do whatever you can to not let this happen.
*Be clear about your expectations. Sometimes teachers assume that students know how they should act in a classroom setting. This isn't always the case. Direct and clear expectations often work wonders. Explaining why the behavior isn't appropriate won't hurt either.
*Talk to the student privately. Sometimes attention getters change their tune when they are shown respect in a one on one situation. Talk calmly and try to see if there is anything the two of you can come up with together to improve the situation.
*Don't make idle threats. The word "threat" may sound harsh, but it is really just a promise of a consequence. Whatever you do, FOLLOW THROUGH! If you say you are going to do something, do it-both the positive and the negative. At some point, there should be consequences of some kind for repeated misbehavior. Few things weaken your authority more than not being true to your word.
*Pick your battles. In other words, don't make mountains out of mole hills. Everything is not an emergency. Some things are better off just letting go.
Hope that helped. Good luck!
Doug(The Discipline Dr)