# Street fighter game question

**URL:** https://forum.kirupa.com/t/street-fighter-game-question/185038
**Category:** Uncategorized
**Created:** [April 10, 2006, 2:12pm UTC](https://forum.kirupa.com/t/street-fighter-game-question/185038 "2006-04-10T14:12:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mcarr1973](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mcarr1973](https://forum.kirupa.com/u/mcarr1973)
#### Post date: [April 10, 2006, 2:12pm UTC](https://forum.kirupa.com/t/street-fighter-game-question/185038/1 "2006-04-10T14:12:20Z")

</div>

Hello all that reads,

I have my charcter(boxer) named my\_mc on the main timeline if you double click inside this movieclip you see my boxer has a punch labeled frame, kick labled frame and a knee labled frame. above the labels I tried putting actions to return my boxer to his original state of standing but it dosent work??? this is my code in frame 1 on the main timeline:

// stop the mc  
my\_mc.stop();  
// when you press a key  
my\_mc.onKeyDown = function()  
{  
// if it’s the A key  
if (Key.getCode() == 65) {  
// send the movie clip’s playhead to frame labeled kick  
this.gotoAndStop(“punch”);

}  
// if it’s the S key  
else if (Key.getCode() == 83)  
{  
// send the movie clip’s playhead to frame labeled punch  
this.gotoAndStop(“kick”);  
}  
// and so on

// if it’s the D key  
if (Key.getCode() == 68 {  
// send the movie clip’s playhead to frame labeled kick  
this.gotoAndStop(“knee”);  
}  
};  
// add the listener to the movie clip  
Key.addListener(my\_mc);

I have tried putting this.gotoAndPlay(“punch”); instaed of this.gotoAndStop but then it will just play through all of his motions.

My question is how do I do it so that when I push “a” for punch the boxer punches and then returns his punch instead of being stuck whith his arm out until I hit the next button?

Hopefully Someone can help  
michael

P.S. if anyone has a street fighter game or something like it could you send me the fla.file as a learning tool 🙂

---

<div class="post-metadata">

### Author: ![Ophyr](https://avatars.discourse-cdn.com/v4/letter/o/41988e/32.png) [@Ophyr](https://forum.kirupa.com/u/Ophyr)
#### Post date: [April 10, 2006, 2:33pm UTC](https://forum.kirupa.com/t/street-fighter-game-question/185038/2 "2006-04-10T14:33:42Z")

</div>

Use gotoAndPlay instead of gotoAndStop 😉

---

<div class="post-metadata">

### Author: ![Psykloak1](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@Psykloak1](https://forum.kirupa.com/u/Psykloak1)
#### Post date: [April 10, 2006, 8:49pm UTC](https://forum.kirupa.com/t/street-fighter-game-question/185038/3 "2006-04-10T20:49:31Z")

</div>

I would check out this: [Creating a Platform Game](http://www.kirupa.com/developer/mx2004/platform_game.htm)

Its a tutorial for a platform, not a fighter, but theres alot of similarities, including different “states” as seperate frames in a main movie clip.
