# Yes is another walking problem. I AM A NEWB AT AS

**URL:** <https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924>\
**Category:** Uncategorized\
**Created:** [July 8, 2004, 8:27pm UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924 "2004-07-08T20:27:54Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![mixedtrigeno](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@mixedtrigeno](https://forum.kirupa.com/u/mixedtrigeno)\
**Post date:** [July 8, 2004, 8:27pm UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/1 "2004-07-08T20:27:54Z")

</div>

thanks to anyone that is reading this.

ok this is what i have so far:

-mc called “jump”-dont know yet how many frames will be  
-mc called “stand”-3 frames long  
-mc called “walk”-24 frames long  
-mc called “shooting”-10 frames long (dont know how many frames will be yet but lets assume)

now my question WHAT IS THE ACTION SCRIPT TO MAKE THIS THING WORK WELL. i have tried but the problem is that when i release the “right” or “left” key the “walk” mc keeps playing until it reaches the end.

and i swear I WILL make a tutorial about this cuse there isn’t really one that just teaches you just that. no hitTest no scrolling no nothing just how to make your hero in the game walk left right jump and shoot.  
so please help me so i can help others also thanks a lot.

if you need any more information to help me out please let me know i have tried the little i know to get it to work and have come back with nothing.

---

<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 9, 2004, 2:06am UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/2 "2004-07-09T02:06:20Z")

</div>

hmm…

When I do anything like this, I like making one movie clip and having frame labels in it. For example, a movie clip called person with a labels called “standing”, “walking” and “jumping”. All of these would be looped (e.g. at the end of the walking sequence "gotoAndPlay(“walking”)).

That way I can say something like:

> onClipEvent(keyDown) {  
> if (Key.isDown(Key.RIGHT)) {  
> // goto the walking sequence  
> this.gotoAndPlay(“walking”);  
> // make the guy face right  
> this.\_xscale = 100;  
> }  
> if (Key.isDown(Key.LEFT)) {  
> // goto the walking sequence  
> this.gotoAndPlay(“walking”);  
> // make the guy face left  
> this.\_xscale = -100;  
> }  
> if (Key.isDown(Key.UP)) {  
> // goto the jumping sequence  
> this.gotoAndPlay(“jump”);  
> }  
> }  
> onClipEvent(keyUp) {  
> this.gotoAndPlay(“standing”);  
> }

This would go in the guy’s actions and. Of coarse, this is just a rough outline.

Hope this helps a bit.

---

<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 10, 2004, 7:09pm UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/3 "2004-07-10T19:09:39Z")

</div>

so you saying at the end of each of my walking stand jumping animations i should put a “gotoandplay(1)” so that the walking keeps on looping instead of putting a “stop”?

and by the way i have to create a variable called speed=whatever but where to indicate the speed i want the guy to move at but where will i put that on the AS you provided me with?

---

<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 11, 2004, 12:45am UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/4 "2004-07-11T00:45:42Z")

</div>

you wont unless you use something liek a var

---

<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 12, 2004, 7:57pm UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/5 "2004-07-12T19:57:41Z")

</div>

ok i got the guy to walk fine using the code i was provided with even though it took like half an hour to realize that it wasnt working cuse i didnt name the instance mc. but i have a lil problem when i press down he crouches the thing is i dont know how to make him crouch so that if you facing left and you crouch he crouches facing that way and the same for the right.

i tried adding and please dont laught…ok go ahead and laught hahaha

to the crouching action but

```auto

if (Key.isDown(Key.LEFT)) {
this.gotoAndPlay("walking");
this._xscale = -100;
this._xscale= 100;

```

but as you guys know it didnt work.

and one thing isnt there a phisics coding i have to do to make the guy jump? please correct me if i am right and where will i put that code sorry am good at math but i havent take phisics yet.

---

<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 13, 2004, 1:34am UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/6 "2004-07-13T01:34:44Z")

</div>

For the crouching sequence, you have left as the crouching button, i’m not sure if this is what you want. What the xscale does, is if it is 100, the direction is normal, but if it is -100, the direction is inverted. You only need to put this in the \<right\> and \<left\> commands, because they change the direction. In the crouching command, the xscale should already be set to the correct direction, so if you just make it go to the crouching sequence, that should be fine.

As for the physics, it would be easier to help if I knew what kind of game you’re making. Eg. Will there be different levels?

The .fla would also be nice

---

<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 13, 2004, 12:17pm UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/7 "2004-07-13T12:17:44Z")

</div>

yep, fla and we’ll see what we can do …

---

<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 13, 2004, 8:50pm UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/8 "2004-07-13T20:50:09Z")

</div>

no sorry is not the left is the down arrow i just put as an example. and when i get home ill post the code cuse i am trying to avoid posting the fla file cuse i am trying to keep the game under wraps until it is actually done …AND I PROMISE YOU it will be THE BEST flash game you will ever see if not it will be among the best. and thanks for the help everyone. without this forum i wouldnt be able to even get started on the game.

---

<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 13, 2004, 8:51pm UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/9 "2004-07-13T20:51:32Z")

</div>

oh and yes there will be dif. levels up to 6 i am thinkin so far.

---

<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 13, 2004, 10:44pm UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/10 "2004-07-13T22:44:32Z")

</div>

sounds good.

---

<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 14, 2004, 3:09am UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/11 "2004-07-14T03:09:59Z")

</div>

tell us when its done, havent played an awsome flash game in a long time.

---

<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 17, 2004, 6:35am UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/12 "2004-07-17T06:35:02Z")

</div>

if anyone of you guys would like to help me script the game. and help me with part of the background work since is a lot of work to do background in art base so that the game doesnt take as long to finish anyone is more then welcome the only condition is to keep the game fla under wraps until it is complete. thanks to AS brains that would like to contribute to making the game.

ill give you a lil something about what the game will include just to see if you want to be part of it…

-like i said before i am thinking at least 6 levels  
-a few puzzles to solves  
-since i cant do the saving feature i am doing the password feature  
-about 5-7 weapons  
-and the big hint is…youll be driving a tank-and maybe other vehicles…

anyone interested in helping please email me or pm me or post

[mixedtrigenito@hotmail.com](mailto:mixedtrigenito@hotmail.com)

NOTE:i do flash game/animation just because i love to draw and i love the idea of someone seen my work and going " wow this is great"

---

<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 17, 2004, 6:36am UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/13 "2004-07-17T06:36:47Z")

</div>

oh sorry one thing i forgot to mention i am still havin problem with the crouchin animation when i crouch if i am facin left its still faces to right when i do and if i am facing right it faces right. i wanted so that when i am facin left and you crouch it stays looking that way.

---

<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 20, 2004, 11:35am UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/14 "2004-07-20T11:35:10Z")

</div>

I did it in my game by setting a flag for crouching:

```auto

if (Key.isDown(Key.RIGHT)) {
_root.char.faceright = true;
} else if (Key.isDown(Key.LEFT)) {
_root.char.faceright = false;
}
 
// after all the other key checks
 
if (_root.char.faceright) { // this is for a character that faces right by default.
_root.char._xscale = 100
} else {
_root.char._xscale = -100
}

```

---

<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 20, 2004, 4:15pm UTC](https://forum.kirupa.com/t/yes-is-another-walking-problem-i-am-a-newb-at-as/56924/15 "2004-07-20T16:15:41Z")

</div>

> [@dal platinum](#):
>
> I did it in my game by setting a flag for crouching:
> 
> ```auto
> 
> if (Key.isDown(Key.RIGHT)) {
> _root.char.faceright = true;
> } else if (Key.isDown(Key.LEFT)) {
> _root.char.faceright = false;
> }
>  
> // after all the other key checks
>  
> if (_root.char.faceright) { // this is for a character that faces right by default.
> _root.char._xscale = 100
> } else {
> _root.char._xscale = -100
> }
> 
> ```

thanks for the code man but your coding is really long and you are using 8 lines of coding for that.  
and i found a way to do it with just 3 lines of code. but thanks a lot though

```auto

onClipEvent(EnterFrame) {
if (Key.isDown(Key.DOWN)) {
// goto the walking animation
this.gotoAndStop("crouch");
}

```

by the way wat type of game are you making?
