We experienced a similar situation with our 2-1/2 year old this year. We just had our second child the first week of August. Prior to my pregnancy, our daughter was loving, kind, obeyed pretty much all the time, and had all kinds of energy. After I began showing and we began to talk about the baby and remodeling/moving around furniture to make room for the baby, she began getting whiny and opted to do the opposite of what we requested of her. At her in-home daycare, the sitter said she was getting pretty moody and at times wanted to be left alone, but then there were times she just wanted to be held. My husband and I thought that maybe we were putting too much on her by talking about the baby that was coming, etc. so we began watching how much we talked about him. We started focusing more on her again and how she could help when the baby got here (i.e., helping with diapers, holding him, playing with him). We even took her shopping to buy the baby a gift, which she loved. I made sure that every night, I had an activity with her that didn't include talking about the baby.
Once her brother arrived, she was great about it all. She brought him her gift, and he also had a gift waiting for her at the hospital. Anytime he cries she rushes to him and holds his hand or gives him a kiss. We're still juggling having time with her without the baby around...while he's sleeping, but since we began talking with her more about how she can help with the baby rather than there's a baby coming and no mention of what her role will be, that seemed to let her know that she wasn't going to be replaced...we needed her to help us with him. She still gets sensitive...I think more when we're a little more preoccupied with the baby, but that just causes us to focus back on her again.
Hope that helps a little bit.
S.