I suspect the problem lies in your ground MovieClip.
If it's not high enough, it is possible that before you add gravity, the player is just above the ground, and after you add gravity, the player is just
below the ground.
A more appropriate solution to solve this problem is to project ("predict") a line showing where they player is before you add gravity and where the player is after you add gravity, and see if that line digs into the ground at all.
The simplest implementation of that is using
y = mx + c, where you know x1,y1 to be "before gravity" and x2,y2 to be "after gravity". Stick those values in to get your first equation.
Then, use
y = mx + c again for a second equation, this time x1,y1 is the left end of your ground, and x2y2 is the right end of your ground.
I won't continue with more math here, however if you do want an example you can look at this
Line Segment Intersection Article (which I have used before and found it to be very useful).
There's also some links to things like sweep line algorithms on wikipedia articles referring to
Line Segment Intersection that you may want to check out, if your ground is not flat the entire way across.
