Moving Character and Ground

Hello,

I have what I think is an easy question. I am making a game with a character that you move using the arrow keys. When he gets to a certain point in the window I want the ground underneath to start moving down. The code below works but the character gets stuck in ground moving only and can’t move independently again. If I trace this._y I get 146 when he gets stuck. I tried a little code that would kick him back outside of that but it looked awful.


if (Key.isDown(Key.UP)) {
        if (this._y>150) {
//Move the character
            this._y = Math.max(this._y-distance, 0);
        } else {
//Move the ground down stage
            _root.ground._y += 8;
        }

else if (Key.isDown(Key.DOWN)) {
        if (this._y>150) {
//Move the Character
            this._y = Math.max(this._y-distance, 0);
        } else {
//Move the ground down up
            _root.ground._y -= 8;
        }
}


I appreciate any help you can provide.