title: ActionScript3: Changing button text
body: <p>I have a button instance named Button that I have in my movie, this instance has a Dynamic Text object in it named myText, how can I change the text? I already tried Button.myText.text = "Stuff";</p>
  
  <p>I get the error "Scene 1, Layer 'Layer 1', Frame 1, Line 7  1119: Access of possibly undefined property myText through a reference with static type flash.display:SimpleButton." When I compile.</p>
  
  <p>AS:</p>
  
  <pre><code>import flash.events.MouseEvent;
  
  TheButton.addEventListener(MouseEvent.CLICK, onClick);
  
  function onClick(Event:MouseEvent):void{
      TheButton.myText.text = "Moo";
  }
  </code></pre>