title: Action Script 3. How to play animation once?
body: <p>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 <code>Hero.gotoAndStop("staying");</code></p>
  
  <p>Here is my jumping code:</p>
  
  <pre><code>    if (Hero.y_speed &gt; 0 &amp;&amp; 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
              {
  
              }
          }
      }
  </code></pre>