title: Adding the same function to multiple buttons in Actionscript 3.0
body: <p>I am trying to add the same button function to 2 different symbols in Flash. One is the logo and the other is text that I converted to a symbol that will show itself during the end scene. </p>
  
  <p>I don't understand what I am doing wrong, but I am extremely new to Actionscript &amp; Flash.</p>
  
  <p>My code looks like this: </p>
  
  <pre><code>import flash.events.MouseEvent;
  import flash.display.MovieClip;
  import flash.display.SimpleButton;
  import flash.net.navigateToURL;
  import flash.net.URLRequest;
  
  myButton, txtButton.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
  function onClick(e:MouseEvent):void{
      navigateToURL(new URLRequest("http://www.true.land"), "_blank"); 
  }
  </code></pre>
  
  <p>But I am getting this error:</p>
  
  <blockquote>
    <p>Attempting to launch and connect to Player using URL
    C:\Users\Angela\Desktop\ASU\GIT 314\Assignment
    7\AngelaRogers_Assignment7.swf [SWF] C:\Users\Angela\Desktop\ASU\GIT
    314\Assignment 7\AngelaRogers_Assignment7.swf - 351066 bytes after
    decompression TypeError: Error #1009: Cannot access a property or
    method of a null object reference.    at
    Button/frame1()[Button::frame1:7]</p>
  </blockquote>