Добрый день, по циклу создаю кнопки. Хочу к ним привязать действия.
В итоге кнопки создаются выводятся на экран но события не обрабатываются.

Код AS3:
function newButton(text){
lectionCount=lectionCount+1;
var t:TextField = new TextField();
t.text = text;
item[lectionCount]=new SimpleButton(t); // создаю кнопку
item[lectionCount].x = 300;
item[lectionCount].y = 100+25*lectionCount;
item[lectionCount].addEventListener(MouseEvent.CLICK, clickMenu); //привязываю обработчик события
addChild(item[lectionCount]);
}
//****************************************************
function clickMenu(event:Event):void { // обработчик
trace('click');
}