After creating an object (graphical component) I add an event handler to it like that:
objects[text_identifier.toUpperCase()].on(\'mousedown tap\', function()