public Boolean Crafty.unbind(String eventName, Function callback)
public Boolean Crafty.unbind(String eventName, Number callbackID)
Unbind any event from any entity or global event.
var play_gameover_sound = function () {...};
Crafty.bind('GameOver', play_gameover_sound);
...
Crafty.unbind('GameOver', play_gameover_sound);
The first line defines a callback function. The second line binds that
function so that Crafty.trigger('GameOver')
causes that function to
run. The third line unbinds that function.
Crafty.unbind('GameOver');
This unbinds ALL global callbacks for the event 'GameOver'. That
includes all callbacks attached by Crafty.bind('GameOver', ...)
, but
none of the callbacks attached by some_entity.bind('GameOver', ...)
.