title: Moving MovieClip to right with x and y coordinate [actionscript 3.0] automatically
body: <p>I try to make simple program in AS 3,
  this is scenario :
  I have a MovieClip in Linkage name is Hero,
  and I want to move Hero to right with speed is 2, and if hero.x = 200 then Hero will stop at position x = 200, this is my simple code :</p>
  
  <pre><code>
  
      var hero:Hero = new Hero();
          hero.x = 0;
          hero.y = 300;
          addChild(hero);
  
      addEventListener(Event.ENTER_FRAME, animateHero);
      function animateHero(event:Event) {
  
      if (hero.x &lt;= 200){
          hero.play();
          } else { 
          hero.currentFrame(stop);
          }
          hero.x += 2;
      }
  
  </code></pre>
  
  <p>I try this code, it is running but show repeated error message in output panel:</p>
  
  <pre><code>
  
      TypeError: Error #1006: value is not a function.
          at SpriteMovement_fla::MainTimeline/animateHero()
  
  </code></pre>
  
  <p>my question :</p>
  
  <p>Is my codes wrong?, if so, please tell me how the right codes.</p>