title: Identifying the button that triggers an event(dynamically added buttons in as3)?
body: <p>In my program i am required to create buttons and their listeners dynamically. Is there a way to identify which button triggered the event. Each button does contain a unique text, but I tried using 'this' to access the text but not successful. Please help
  Code piece provided:</p>
  
  <pre><code>for(i=0;i&lt;3;i++)
  {
     subjectCode="MTOO"+(i+1);
     var subjectBtn:MovieClip=new subjectButton();
     subjectBtn.y=y+50+pos;
     subjectBtn.x=60;
     subjectBtn.subjCode.text=subjectCode;
     subjectBtn.addEventListener(MouseEvent.CLICK, displaySubjectAttendance);
     _subList.addChild(subjectBtn);
     pos+=140;
  }
  </code></pre>