title: How to use gotoandplay scene link using class property (external code.as)
body: <p>I am using <code>gotoandplay</code> scene by scene link using this code. If I use this in the same time line (internal), it’s working properly but when I use this code in as a class, I get this error:</p>
  
  <blockquote>
    <p>Call to a possibly undefined method MovieClip.</p>
  </blockquote>
  
  <p><strong>I use this code in time timeline</strong></p>
  
  <pre><code>b_enter.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_enter1);
  function fl_ClickToGoToScene_enter1(event:MouseEvent):void
  {
      MovieClip(this.root).gotoAndPlay("p menu", "Menu");
  }
  </code></pre>
  
  <p><strong>I use this code in class</strong></p>
  
  <pre><code>package  {
  
      import flash.display.SimpleButton;
  
  
      public class next extends SimpleButton {
  
  
          public function next() {
              // constructor code
              MovieClip(this.root).gotoAndStop("p2", "page2")
          }
      }
  
  }
  </code></pre>
  
  <p>You can download the flash file using this <a href="http://www.delta-adv.com/nav/np.rar" rel="nofollow">link</a></p>