title: AS3 linking to a webpage
body: <p>I am creating a banner in flash using AS3 and want to be able to click on the banner to link to a webpage.</p>
  
  <p>I created a clear button to the size of the banner and have placed it on the top layer, named <code>click</code>.</p>
  
  <p>I put this code in the first frame of the <code>click</code> layer:</p>
  
  <pre><code>buttonOne.addEventListener(MouseEvent.CLICK, launchOne);
  
  function launchOne(event:MouseEvent):void {
        var swfOne:URLRequest=new URLRequest("http://www.mypage.com");
        navigateToURL(swfOne, "_self");
  }
  </code></pre>
  
  <p>Flash automatically added to the top:</p>
  
  <pre><code>import flash.events.MouseEvent;
  import flash.net.URLLoader;
  </code></pre>
  
  <p>When trying to run the code, I get the error message:</p>
  
  <pre><code>Scene 1, Layer 'click', Frame 1, Line 4 1120: Access of undefined property buttonOne.
  </code></pre>
  
  <p>All I want to do is be able to link to a website with AS3...can someone provide me the code?</p>
  
  <p>Thanks!</p>