So based on your information its still a little vague to be diagnosed.
does she have this problem frequently? how often and when does it occur?
i would say keep an eye on it, it may if occurs during activities or times of stress may be asthma but it all depends on when and where it is occurring.
does she enjoy gym class? reason why I ask is if she doesn't like it, or is scared of something she may react accordingly and "freak out" or she may be acting out to try and get out of gym class.
I would say your best bet is to talk to your daughter and see how she is feeling, if the symptoms persist take her to your family doctor. If she gets it on sporadic occasions it would still be a good idea to see your family doctor and get checked for asthma, or stress attacks. See what happens and see how your daughter feels. All future actions should be based on the way your daughter is feeling or reacting.
I would say after your additions that it could possibly be asthma as it is happening randomly. why not get her checked out just to be safe, they my put her on an inhaler which is used to dilate her lungs. Its quite safe and my sister is on one called Salibutamol or something along those lines but its pretty effective for her. Hopefully things work out and keep us posted.
Tell her to get better soon.