Remove an event listener. If the _processing flag is true then the removal will be placed in the removals array to be processed after the event loop has completed in the emit() method.
off (BooleaneventName, ObjectevtListener, Functioncallback)
BooleaneventNameThe name of the event you originally registered to listen for.
ObjectevtListenerThe event listener object to cancel. This object is the one returned when calling the on() method. It is NOT the method you passed as the second argument to the on() method.
FunctioncallbackThe callback method to call when the event listener has been successfully removed. If you attempt to remove a listener during the event firing loop then the listener will not immediately be removed but will be queued for removal before the next listener loop is fired. In this case you may like to be informed via callback when the listener has been fully removed in which case, provide a method for this argument. The callback will be passed a single boolean argument denoting if the removal was successful (true) or the listener did not exist to remove (false).
Returns Boolean
Switch off an Event Listener
// Register event lister and store in "evt"
var evt = myEntity.on('mouseDown', function () { console.log('down'); });
// Switch off event listener
myEntity.off('mouseDown', evt);