title: EaselJS: AS3 to Javascript conversion: on rollover of MC, gotoAndPlay frame 1 of that MC (Flash Canvas for HTML5)
body: <p>This is a Javascript issue, for an HTML5 <code>canvas</code> project in Flash.  I'm trying to get movieClip <code>cta</code> to act as a button, and once it's moused over to play <code>this.cta.gotoAndPlay(1);</code>. I'm using the code from the suggested snippets in Flash Canvas and I'm getting the following error on mouseover: <code>TypeError: this.cta is undefined</code> So how do I call <code>cta</code> from inside this function? </p>
  
  <p>FYI, the <code>alert</code> works in the code below (when the MC is moused over), and <code>this.cta.gotoAndPlay(1);</code> works also when placed in the timeline by itself outside of this codeblock. </p>
  
  <p>Here's the javascript flash(canvas) is suggesting in the code snippet.</p>
  
  <pre><code>    var frequency = 3;
      stage.enableMouseOver(frequency);
      this.cta.addEventListener("mouseover", fl_MouseOverHandler);
  
      function fl_MouseOverHandler()
      {
          alert("Moused over");
          this.cta.gotoAndPlay(1);
      }
  </code></pre>
  
  <p>Here's the old AS3.</p>
  
  <pre><code>cta.onRollOver = function(){
  this.gotoAndPlay("start");
  </code></pre>