# \[Flash8\] Need Help witha Script

**URL:** <https://forum.kirupa.com/t/flash8-need-help-witha-script/231695>\
**Category:** flash\
**Created:** [July 6, 2007, 8:47pm UTC](https://forum.kirupa.com/t/flash8-need-help-witha-script/231695 "2007-07-06T20:47:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Q\_Dizzle](https://avatars.discourse-cdn.com/v4/letter/q/ecae2f/32.png) [@Q\_Dizzle](https://forum.kirupa.com/u/Q_Dizzle)\
**Post date:** [July 6, 2007, 8:47pm UTC](https://forum.kirupa.com/t/flash8-need-help-witha-script/231695/1 "2007-07-06T20:47:04Z")

</div>

In my game: [http://img64.imageshack.us/my.php?image=pacmanms6.swf](http://img64.imageshack.us/my.php?image=pacmanms6.swf)  
I need it to be so when i run into a wall is stop (got it) and the screen stops scrolling (need help)

this is my code (off the site)

onClipEvent (load) {  
jumping = true;  
jump = 0;  
speed = 15;  
}  
onClipEvent (enterFrame) {  
if (\_root.wall.hitTest(this.\_x, this.\_y, true)){  
maxmove = 0;  
}else{  
maxmove = 20;  
}  
if (!\_root.ground.hitTest(this.\_x, this.\_y, true) && !jumping) {  
this.\_y += 6;  
}  
if (\_root.dead) {  
this.gotoAndStop(“dead”);  
} else {  
speed \*= .85;  
if (speed\>0) {  
dir = “right”;  
} else if (speed\<0) {  
dir = “left”;  
}  
if (dir == “right”){  
this.\_x += speed;  
\_root.\_x -= speed;  
}  
if (dir == “left”) {  
this.\_x += speed;  
\_root.\_x -= speed;  
}  
if (Key.isDown(Key.LEFT)) {  
if (speed\>-maxmove) {  
speed–;  
}  
this.gotoAndStop(2);  
this.\_xscale = -30;  
} else if (Key.isDown(Key.RIGHT)) {  
if (speed\<maxmove) {  
speed++;  
}  
this.\_xscale = +30;  
this.gotoAndStop(2);  
}  
if (speed\<1 && speed\>-1 && !attacking) {  
speed = 0;  
this.gotoAndStop(1);  
}  
if (attacking = false){  
gotoAndStop(1);  
}  
if (speed\<1 && speed\>-1 && !attacking) {  
speed = 0;  
this.gotoAndStop(“idle”);  
}  
if (speed\<1 && speed\>-1 && !attacking) {  
speed = 0;  
this.gotoAndStop(“idle”);  
}  
if (speed\<1 && speed\>-1 && !attacking) {  
speed = 0;  
this.gotoAndStop(“idle”);  
}  
if (\_root.wall.hitTest(this.\_x, this.\_y, true)){  
this.\_x+=5;  
}  
if (Key.isDown(Key.UP) && !jumping) {  
jumping = true;  
}  
if (jumping) {  
this.gotoAndStop(“jump”);  
this.\_y -= jump;  
jump -= .5;  
if (jump\<0) {  
falling = true;  
}  
if (jump\<-15) {  
jump = -15;  
}  
if (jump\<-15) {  
jump = -15;  
}  
}  
if (\_root.ground.hitTest(this.\_x, this.\_y, true) && falling) {  
jump = 10;  
jumping = false;  
falling = false;  
}  
}  
if (\_root.platform.hitTest(this.\_x, this.\_y, true) && falling) {  
jump = 10;  
jumping = false;  
falling = false;  
}  
if (jump\<-15) {  
jump = -15;  
}  
}

my walls instance is wall, ground is ground and character is character. please help (in the game the wall is to the left.)
