Scrolling bg, and boundaries wtf

Ok im a noob:glasses: at this programming actionscript and ive gotten all these codes and merged together this code. this is the code for my “spaceship”:to:

[COLOR=darkolivegreen]onClipEvent(load){[/COLOR]
[COLOR=darkolivegreen] moveSpeed=10;
_root.laser._visible=false;
laserCounter=1;
scrollx=_root.mainGround.ground._width/3;
scrollStart=false;
maximumBottom = Stage.height;
minimumLeft = 0;
maximumRight = Stage.width;
minimumTop = 0;[/COLOR]
[COLOR=darkolivegreen]}[/COLOR]
[COLOR=darkolivegreen][/COLOR]

[COLOR=darkolivegreen]onClipEvent (enterFrame) {[/COLOR]
[COLOR=darkolivegreen]if (Key.isDown(Key.CONTROL)) {

laserCounter++;
_root.laser.duplicateMovieClip( “laser”+laserCounter, laserCounter );
_root[“laser”+laserCounter]._visible=true;
} [/COLOR]

[COLOR=darkolivegreen]if (Key.isDown(Key.RIGHT)) {
if (this._x<scrollx){
this._x+=moveSpeed;[/COLOR]
[COLOR=darkolivegreen] } else {
scrollStart=true;
}

} else if (Key.isDown(Key.LEFT)) {
this._x-=moveSpeed;
}[/COLOR]
[COLOR=darkolivegreen]if (Key.isDown(Key.DOWN)) {
this._y+=moveSpeed;
} else if (Key.isDown(Key.UP)) {
this._y-=moveSpeed;
}

if(this._x < minimumLeft){
this._x = minimumLeft;
} else if(this._x > maximumRight){
this._x = maximumRight;
}
if(this._y < minimumTop){
this._y = minimumTop;
} else if(this._y > maximumBottom){
this._y = maximumBottom;
}
spaceship.maximumBottom = Stage.height;
spaceship.minimumLeft = 0;
spaceship.maximumRight = Stage.width;
spaceship.minimumTop = 0;
spaceship.onEnterFrame= function(){
if(this._x < this.minimumLeft){
this._x = this.minimumLeft;
} else if(this._x > this.maximumRight){
this._x = this.maximumRight;
}
if(this._y < this.minimumTop){
this._y = this.minimumTop;
} else if(this._y > this.maximumBottom){
this._y = this.maximumBottom;
}
}[/COLOR][COLOR=darkolivegreen]
}[/COLOR]
[COLOR=#556b2f][/COLOR]
[COLOR=black]This code is supposed to make it move shoot and give it boundaries .[/COLOR]
but when i press right it scrolls but then doesnt stop and the enemies dont move. and i cant move towards them. so i wanted to create a boundary from keeping the “spaceship” from going to far back and out of the floor, but now it only stops it from going to far up and nothing else works

PLEASE HELP ME!!!
i desperately need guideance.:tb: