Street fighter game question

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 :slight_smile:

Use gotoAndPlay instead of gotoAndStop :wink:

I would check out this: Creating a Platform Game

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.