Collision Issue

Hey guys,

So I’m programming this platform scrolling game, working really hard at fixing up a lot of nit picky issues and I’ve come across an issue with my ground collision: when the player jumps to a higher ledge that should be too high to get atop, as long as he’s close the ground puts him at the top. This is starting to really frustrate me because I’ve done everything I can think of to remedy this.
Now, my collision mc’s (the limits) are made up of 3 different mc’s: the walls, the ground and the ceilling. I did this rather than create one limits mc so that the coding doesnt get confused.
Anyways, here’s the collision and jumping code that I use:

 
// Ground Collision
for (i=1; i<=50; i++) {
if (jumpPower<=0) {
if (!ground.hitTest(hero._x+6, hero._y-i, true) && !ground.hitTest(hero._x-6, hero._y-i, true)) {
hero._y -= i-1;
break;
} else {
hero.gotoAndStop("idle");
jumping = false;
jumpPower = 0;
}
}
}
// Jumping Collision
if (Key.isDown(Key.UP) && !jumping) {
jumping = true;
jumpPower = 8;
hero.gotoAndStop("jumping");
}
}
if (jumping) {
jumpPower--;
if (jumpPower>=8) {
jumpPower = -8;
}
if (jumpPower<=-8) {
jumpPower = -8;
}
hero._y -= jumpPower;
}

If anyone has any advice, or collision methods, or anything useful that may potentially help solve my issue, I’d be exceedingly grateful.

PS, I have a visual example of my problem attatched.

Thanks!