title: AS3 flashing dynamically appending movieclip names to goto functions
body: <p>I have a virtual on screen keyboard for a touch screen interface.
  I get the name of the key (Q, W, E, etc) by calling event.currentTarget.name
  Now each button is a movie clip with a small animation and I need to know
  which key is pressed so it can call the relevent movieclip..
  Below is the code:</p>
  
  <pre><code>function keyPressed(event:MouseEvent):void {
  
      var butID:String = event.currentTarget.name;
      trace("clicked " + butID);
  
   //////////////ERROR BELOW///////////
  
      Q.gotoAndPlay(2); &lt;-------- Q is the name of the movieclip. It has to be something like butID.gotoAndPlay(2); but it doesn't work. I'm not sure of the type of the variable either...Can any one help?
  
  /////////////////////////////
  //Below I append the letter to a text box
      if(event.currentTarget.name == "SPACE")
      {
          addText(" ");
      }
      else
      {
          addText(event.currentTarget.name);
      }
  }
  </code></pre>
  
  <p>Thanks in advance,
  Luben</p>