title: Simple Actionscript 3 for button
body: <p>I was very familiar with AS2 and am just getting familiarized with AS3.</p>
  
  <p>I have a movieclip that serves as a button. On hover, Flash plays the second frame of that movieclip. My question is how can I create a reusable function that can play the second frame of any movie clip that it gets applied to without having to specify the movieclip each time. The code below obviously can only be applied to "btn_next". I wrongfully assumed that changing 'btn_next.gotoAndPlay(2)' to 'this.gotoAndPlay(2)' would work but the 'this' doesn't target the button calling the function.</p>
  
  <pre><code>btn_next.addEventListener(MouseEvent.ROLL_OVER mouseOverHandler)
  
  function mouseOverHandler (event: MouseEvent):void {
      btn_next.gotoAndPlay(2);
  }
  </code></pre>
  
  <p>Any help would be most appreciated. Thanks in advance!</p>
  
  <p>D</p>