# Help Editing Code (Scrolling)

**URL:** <https://forum.kirupa.com/t/help-editing-code-scrolling/87625>\
**Category:** programming\
**Created:** [April 22, 2005, 11:06am UTC](https://forum.kirupa.com/t/help-editing-code-scrolling/87625 "2005-04-22T11:06:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PelvicThrusters](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@PelvicThrusters](https://forum.kirupa.com/u/PelvicThrusters)\
**Post date:** [April 22, 2005, 11:06am UTC](https://forum.kirupa.com/t/help-editing-code-scrolling/87625/1 "2005-04-22T11:06:38Z")

</div>

Hey Guys,  
I just needed a hand trying to get this \*\*\*\* code to work,  
I have tried everything i know.  
The code is:  
My MC

> 

onClipEvent (load) {  
fall = false;  
\_name = “circle”;  
jump = 0;  
speed = 8;  
jumpheight = 15;  
maxfall = -54;  
}  
onClipEvent (enterFrame) {  
xmin = getBounds(\_root).xMin;  
xmax = getBounds(\_root).xMax;  
ymin = getBounds(\_root).yMin;  
ymax = getBounds(\_root).yMax;  
if (Key.isDown(Key.SPACE) && fall == false && jump == undefined) {  
fall = true;  
jump = jumpheight;  
}  
if (jump\<\>undefined) {  
if (jump\>maxfall) {  
jump–;  
}  
\_y -= jump;  
}  
}  
onClipEvent (enterFrame) {  
if (Key.isDown(Key.LEFT)) {  
\_x -= speed;  
}  
if (Key.isDown(Key.RIGHT)) {  
\_x += speed;  
}  
}

Platforms:

> 

onClipEvent (load) {  
activated = false;  
down = false;  
}  
onClipEvent (enterFrame) {  
\_root.report.text = Math.round(\_root.circle.yMax)+" "+Math.round(yMin);  
xmin = getBounds(\_root).xMin;  
xmax = getBounds(\_root).xMax;  
ymin = getBounds(\_root).yMin;  
ymax = getBounds(\_root).yMax;  
if (\_root.circle.xMax\>xMin && \_root.circle.xMin\<xMax && \_root.circle.yMax\<yMin) {  
if (\_root.circle.yMax-\_root.circle.jump_2\>yMin) {  
\_root.circle.\_y = ymin-\_root.circle.\_height/2;  
\_root.circle.jump = undefined;  
\_root.circle.fall = false;  
activated = true;  
}  
}  
if (Math.round(\_root.circle.yMax)\>Math.round(yMin)) {  
if (hitTest(\_root.circle) && \_root.circle.xmax\<xmin) {  
\_root.circle.\_x -= \_root.circle.speed;  
}  
if (hitTest(\_root.circle) && \_root.circle.xmin\>xmax) {  
\_root.circle.\_x += \_root.circle.speed;  
}  
if (hitTest(\_root.circle) && \_root.circle.ymin\>ymax && \_root.circle.jump\>-1) {  
\_root.circle.jump = -1_(\_root.circle.jump);  
}  
}  
if (activated == true && not hitTest(\_root.circle) && \_root.circle.jump == undefined) {  
\_root.circle.jump = 0;  
activated = false;  
}  
if (hitTest(\_root.circle) && \_root.circle.ymax\>ymin && \_root.circle.jump\<\>undefined && \_root.circle.\_y\<\_y) {  
\_root.circle.\_y = ymin-\_root.circle.\_height/2;  
\_root.circle.jump = undefined;  
\_root.circle.fall = false;  
activated = true;  
}  
if (\_root.circle.ymax-\_root.circle.jump\>ymin && \_root.circle.xMin\<xMax && \_root.circle.xMax\>xMin && \_root.circle.jump\<\>undefined && \_root.circle.\_y\<\_y) {  
\_root.circle.\_y = ymin-\_root.circle.\_height/2;  
\_root.circle.jump = undefined;  
\_root.circle.fall = false;  
activated = true;  
}  
}  
onClipEvent (enterFrame) {  
if (Key.isDown(Key.LEFT)) {  
\_x += 10;  
}  
if (Key.isDown(Key.RIGHT)) {  
\_x -= 10;  
}  
}

Now that works for scrolling sideways.  
But the jump doesnt work when i add it,  
And I don’t even know how to go about making it scroll on the y axis when I jump and fall  
Thankyou for your time
