title: How do I control a movieclip using a button?
body: <p>Actionscript newbie. 
  Actionscript 3.0
  Started by following the tutorial at <a href="http://republicofcode.com/tutorials/flash/basicwebsite/" rel="nofollow">http://republicofcode.com/tutorials/flash/basicwebsite/</a>
  Everything works fine as long as the code remains in the Flash file. It is when I move it to an external file I have an issue.</p>
  
  <p>I have the following code on my action layer keyframe: </p>
  
  <pre><code>    stop();
  
  function goHome (e:MouseEvent):void{
  gotoAndStop("Home");
  }
  home_btn.addEventListener(MouseEvent.CLICK, goHome);
  
  function goAbout (e:MouseEvent):void{
  gotoAndStop("About");
  }
  about_btn.addEventListener(MouseEvent.CLICK, goAbout);
  
  function goLinks (e:MouseEvent):void{
  gotoAndStop("Links");
  }
  links_btn.addEventListener(MouseEvent.CLICK, goLinks);
  
  function goContact (e:MouseEvent):void{
  gotoAndStop("Contact");
  }
  contact_btn.addEventListener(MouseEvent.CLICK, goContact);
  </code></pre>
  
  <p>Everything works fine but I want to move the code to an external as3 file and am running into issues. </p>
  
  <p>I have added the Document class "site1" and that is the name of my external file. I removed the code from my flash file keyframe and moved it to the external file.</p>
  
  <p>Here is the code as it appears in my site1.as</p>
  
  <pre><code>    package {
  import flash.display.MovieClip;
  import flash.events.MouseEvent;
  import flash.text.TextField;
  
  public class button extends MovieClip{
  
      public function button() {
          function goHome (e:MouseEvent):void{
  gotoAndStop("Home");
  }
  home_btn.addEventListener(MouseEvent.CLICK, goHome);
  
  function goAbout (e:MouseEvent):void{
  gotoAndStop("About");
  }
  about_btn.addEventListener(MouseEvent.CLICK, goAbout);
  
  function goLinks (e:MouseEvent):void{
  gotoAndStop("Links");
  }
  links_btn.addEventListener(MouseEvent.CLICK, goLinks);
  
  function goContact (e:MouseEvent):void{
  gotoAndStop("Contact");
  }
  contact_btn.addEventListener(MouseEvent.CLICK, goContact);
      }
  }
  }
  </code></pre>
  
  <p>The problem is when I publish my Flash file it just keeps looping and not pausing for a button click. </p>
  
  <p>Any help at all would be greatly appreciated.</p>