You need to move the onclick event outside the add button object.
editor.addButton(...);
editor.on('click', function(e) {
alert('Insert logic here');
});
The syntax has also changed a little. This TinyMCE Migration Guide might help explain more.