Ich hatte auch schon mal das Problem:
Dann habe ich aber hinter "My.event = function" die Klammern weggelassen und es ging!