# Move legs of button down

**URL:** <https://forum.kirupa.com/t/move-legs-of-button-down/56310>\
**Category:** flash\
**Created:** [July 2, 2004, 3:52pm UTC](https://forum.kirupa.com/t/move-legs-of-button-down/56310 "2004-07-02T15:52:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yhack](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yhack](https://forum.kirupa.com/u/yhack)\
**Post date:** [July 2, 2004, 3:52pm UTC](https://forum.kirupa.com/t/move-legs-of-button-down/56310/1 "2004-07-02T15:52:19Z")

</div>

```auto
	if (Key.isDown(Key.RIGHT)) {
		this._x += 5;
		gotoAndPlay("_root.man", 2);
	}

```

when i let go of the button the legs move

can anybody help me?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 2, 2004, 11:21pm UTC](https://forum.kirupa.com/t/move-legs-of-button-down/56310/2 "2004-07-02T23:21:08Z")

</div>

This is just a guess because I can’t see your file from here, but, if the man is on frame one not moving (just standing), maybe

```auto
	if (Key.isDown(Key.RIGHT)) {
		this._x += 5;
		gotoAndPlay("_root.man", 2);
	} else {
gotoAndStop("_root.man",1);
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 3, 2004, 8:18pm UTC](https://forum.kirupa.com/t/move-legs-of-button-down/56310/3 "2004-07-03T20:18:51Z")

</div>

ok heres the file  
please try to find the wrong bit

**this is the game at the moment, dont steal it!!! ive had my games stolen before**

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 3, 2004, 9:56pm UTC](https://forum.kirupa.com/t/move-legs-of-button-down/56310/4 "2004-07-03T21:56:39Z")

</div>

You made the legs separate movieClips that move with tweens on layers ‘right leg’ and ‘left leg’. These movieClips are nested in the movieClip of the gunner. You need to give everything instance names before you can tell them what to do. For instance, start with your first frame (at first). Put names on the right leg and left leg like ‘rleg’ and ‘lleg’. Then put a name on your guy like ‘dude’. Now, if you want the legs to stop moving use actions like:

```auto

_root.dude.rleg.gotoAndStop(1);
_root.dude.lleg.gotoAndStop(1);
//since you don't have a stop() action on the legs at all
//you can then use this to start them going again:
_root.dude.rleg.play();
_root.dude.lleg.play();

```

PS - I won’t steal your game, don’t worry. 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 4, 2004, 4:01pm UTC](https://forum.kirupa.com/t/move-legs-of-button-down/56310/5 "2004-07-04T16:01:42Z")

</div>

Im really confused… do you think you could edit my 1 and post it back?
