Alright, so I am working on a smooth gravity script, with multiple grounds, so far it was working pretty well, until i tried to add in a second ground MC, here was my code for the gravity section at first, it worked fine :

onClipEvent (enterFrame) {
if ((this.frontleg.hitTest (_root.ground.topg)) && (this._y -= 0)) {
this._y += 0;
if (this.frontleg.leg._currentframe == 15) {
this.frontleg.gotoAndStop (1);
this.backleg.gotoAndStop (1);
this.frontarm.gotoAndStop (1);
this.backarm.gotoAndStop (1);
}
if (Key.isDown (Key.UP)) {
_root.knight.frontleg.gotoAndStop (3);
_root.knight.backleg.gotoAndStop (3);
_root.knight.frontarm.gotoAndStop (3);
_root.knight.backarm.gotoAndStop (3);
}
}else{
if (this.frontleg._currentframe == 3) {
}else{
this._y += 8;
}
}
if (this.torso.hitTest (_root.ground.leftg)) {
this._x -= 9;
}
if (this.torso.hitTest (_root.ground.rightg)) {
this._x += 9;
}
if (this.knighthead.hitTest (_root.ground.bottomg)) {
_root.knight.frontleg.lj.gotoAndStop (15);
_root.knight.backleg.lj.gotoAndStop (15);
}
}

Then I tried to add this and neither of the grounds would work anymore :

onClipEvent (enterFrame) {
if ((this.frontleg.hitTest (_root.ground1.topg)) && (this._y -= 0)) {
this._y += 0;
if (this.frontleg.leg._currentframe == 15) {
this.frontleg.gotoAndStop (1);
this.backleg.gotoAndStop (1);
this.frontarm.gotoAndStop (1);
this.backarm.gotoAndStop (1);
}
if (Key.isDown (Key.UP)) {
_root.knight.frontleg.gotoAndStop (3);
_root.knight.backleg.gotoAndStop (3);
_root.knight.frontarm.gotoAndStop (3);
_root.knight.backarm.gotoAndStop (3);
}
}else{
if (this.frontleg._currentframe == 3) {
}else{
this._y += 8;
}
}
if (this.torso.hitTest (_root.ground1.leftg)) {
this._x -= 9;
}
if (this.torso.hitTest (_root.ground1.rightg)) {
this._x += 9;
}
if (this.knighthead.hitTest (_root.ground1.bottomg)) {
_root.knight.frontleg.lj.gotoAndStop (15);
_root.knight.backleg.lj.gotoAndStop (15);
}
}

Any Idea what happened?