Hopefully you're doing gymnastics under the supervision of a coach.
Flexibility does not happen overnight. It's going to take alot of time and effort to get your body supple enought to do those stunts.
Important things to remember:
WARM UP! gently warm up your muscles to get them ready to stretch. Ever try to stretch cold silly putty? Think of that as your muscles SNAP!
Drink lots of water and avoid excesive salt- a hydrated body will perform alot better than one that is tired and thirsty.
If it hurts you're doing it wrong - If you stretch to the point of pain you are stretching too far and actually making yourself less flexible. Listen and work with your body stretches should feel like light pressure. Also breath! holding your breath indicates you've gone too far.
Now for specific stretches look up beginning Yoga postures. Most yoga sites will give detailed instructions on how to do each stretch. yoga focuses on balancing the body and has many useful postures. (look up bridge pose, pidgeon pose, fishpose, staff pose, and always finish with a childs pose)