# Problem with buttons!

**URL:** <https://forum.kirupa.com/t/problem-with-buttons/194001>\
**Category:** Uncategorized\
**Created:** [July 19, 2006, 8:38pm UTC](https://forum.kirupa.com/t/problem-with-buttons/194001 "2006-07-19T20:38:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dec27](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dec27](https://forum.kirupa.com/u/dec27)\
**Post date:** [July 19, 2006, 8:38pm UTC](https://forum.kirupa.com/t/problem-with-buttons/194001/1 "2006-07-19T20:38:22Z")

</div>

Hi everybody!

I just want to know why are the left and right buttons working and the up and down not?

The key arrow buttons work all four.

I tried changing the var movement to another place and the buttons work but I can’t make them stop.

Is there any tutorial I need to read about or is there a specific name to look for it on the web?

Any comment would be nice!

Thank you in advanced!:nerd:

```auto

walkAround = function () {
	left.onPress = function() {
		this.onEnterFrame = function() {
			cameraView.rotation -= .05;
		};
	};
	left.onRelease = function() {
		delete this.onEnterFrame;
	};
	if (Key.isDown(Key.LEFT)) {
		cameraView.rotation -= .05;
	}
	right.onPress = function() {
		this.onEnterFrame = function() {
			cameraView.rotation += .05;
		};
	};
	right.onRelease = function() {
		delete this.onEnterFrame;
	};
	if (Key.isDown(Key.RIGHT)) {
		cameraView.rotation += .05;
	}
	movement = 0
	up.onPress = function() {
		this.onEnterFrame = function() {
			_root.movement -= 30;
		};
	};
	up.onRelease = function() {
		delete this.onEnterFrame;
	};
	
	down.onPress = function() {
		this.onEnterFrame = function() {
			_root.movement += 30;
		};
	};
	down.onRelease = function() {
		delete this.onEnterFrame;
	};
	if (Key.isDown(Key.UP)) {
		_root.movement -= 30;
	}
	if (Key.isDown(Key.DOWN)) {
		_root.movement += 30;
	}
	cameraView.x += Math.sin(cameraView.rotation)*_root.movement;
	cameraView.z += Math.cos(cameraView.rotation)*_root.movement;
	for (var i = 0; i<objectsInScene.length; i++) {
		objectsInScene*.display();
	}
};
theScene.onEnterFrame = walkAround;

```
