Asociating events to dynmic objects


I have a problem with project. Im trying to assing a event to a control created dynamically on a script. A simple TButton is created by script and I assing event using examples code:

lB := Tbutton.Create(form);
lB.OnClick := 'myevent';

And event definition is on script:

procedure myevent(Sender);

But event never fired! I also included all necesary uses on script and add TatClassesLibrary to scripter...

Any ideas how to get work events?

Thanks in advance!

Already resolved!

Simply I must show my form as modal... 

Solved! Thanks