Quick question, I've got a simple function that creates some surfaces and animates them through defining a function 'animate' to be called every Engine prerender. This behaves as it should, however, removing this listener on prerender with Engine.removeListener does not work.
function _createCube(){
//create of some surfaces and modifiers
Engine.on('prerender',animate);
surface.on('click',function(){
_stopAnimation.call(this);
}
}
function _stopAnimation(){
Engine.removeListener('prerender',animate);
}
It does work, but you may have an error in your code. The following example code shows a simple working example of a using the
removeListener
Working jsBin Example Here Click on the counter to start and stop listener.