I'm creating flash game and I have animations for character movements. How correctly setup animations to play It only 1 time after action? For example: If I click "Space" button - character jumping and "Jumping" animation starts playing forever, if character stay on the ground jumping animation continue playing. How to stop It when character stay on the ground? Or if I use attack animation It loop forever too.
In normal state character should use Hero.gotoAndStop("staying");
Here is my jumping code:
if (Hero.y_speed > 0 && Hero.hitTestObject(ground))
{
Hero.y_speed = 0;
Hero.x_speed = 0;
if (space)
{
if (true)
{
Hero.gotoAndStop("jumping");//here starts jumping animation loop non stop
stop(); //this not working
Hero.y_speed = -20;
}
else
{
}
}
}