title: EaselJS Sprite gotoAndPlay won't loop
body: <p>I used EaselJS to animate a Sprite. I managed to make it move to the right and to the left. The point is I used <code>gotoAndPlay</code> to animate my sprite when moving, but my Sprite only does the animation once, then stops on the last frame. I tried to change the frequency, to activate the loop, but nothing works. I hope you can figure out where my mistake is, thank you.
  Here is my code:</p>
  
  <pre><code>var stage,
  img = new Image(),
  bg = new Image(),
  bgBitmap,
  link,
  text,
  clavier = {
      gauche: 0,
      droite: 0
  };
  
  window.onkeydown = keyPress;
  window.onkeyup = keyRelease;
  
  function keyPress(e) {
  var i;
  if (e.keyCode == 37) {
      clavier.gauche = 1;
      for (i = 0; i &lt; 10; i++) {
          link.gotoAndPlay("wkLeft");
      }
  }
  if (e.keyCode == 39) {
      clavier.droite = 1;
      link.gotoAndPlay("wkRight");
  }
  }
  
  function keyRelease(e) {
  if (e.keyCode == 37) {
      clavier.gauche = 0;
      link.gotoAndPlay("stand");
  }
  if (e.keyCode == 39) {
      clavier.droite = 0;
      link.gotoAndPlay("stand");
  }
  }
  
  function init() {
  stage = new createjs.Stage('mon_canvas');
  
  bg.src = "img/bg.png";
  bg.onload = creationBg();
  
  img.src = "img/img.png";
  img.onload = creationPerso();
  
  createjs.Ticker.useRAF = true;
  createjs.Ticker.setFPS(60);
  createjs.Ticker.addEventListener("tick", stage);
  createjs.Ticker.addEventListener("tick", tick);
  }
  
  function creationPerso() {
  var ss = new createjs.SpriteSheet({
      images: [img],
      frames: {
          height: 90,
          width: 90,
          regX: 45,
          regY: 45
      },
      animations: {
          wkRight: {
              frames: [5, 9, true, 6],
              speed: 0.1
          },
          stand: [15],
          wkLeft: {
              frames: [0, 4, true, 6],
              speed: 0.1
          }
      }
  });
  link = new createjs.Sprite(ss, "stand");
  link.x = stage.canvas.width / 2;
  link.y = 280;
  stage.addChild(link);
  }
  
  function tick() {
  deplacement();
  scene.update();
  }
  
  function creationBg() {
  bgBitmap = new createjs.Bitmap(bg);
  bgBitmap.regX = 400;
  bgBitmap.regY = 300;
  bgBitmap.x = 400;
  bgBitmap.y = 100;
  bgBitmap.scaleX = 1;
  bgBitmap.scaleY = 1;
  stage.addChild(bgBitmap);
  }
  
  function deplacement() {
  if (clavier.gauche == 1) {
      link.x = link.x - 1;
  }
  if (clavier.droite == 1) {
      link.x = link.x + 1;
  }
  
  }
  
  window.onload = init;
  </code></pre>