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:
for(i=0;i<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;
}