sprite 'didRemoveListener' error?

Hi
I am getting this error when trying to remove an event listener from a sprite:
Runtime error
?:0: attempt to call method ‘didRemoveListener’ (a nil value)
stack traceback:
[C]: in function ‘didRemoveListener’
?: in function <?:226>
Anyone else seen this?
Any suggestions what causes this?

Thanks [import]uid: 13632 topic_id: 27479 reply_id: 327479[/import]

Sounds like your trying to remove a listener from somewhere above where you declared it.

Try something like this:

  
local myFunction  
--Where you declare your function  
myFunction = function(event)  
  

that will probably fix your issue, it’s definitely a scope issue [import]uid: 84637 topic_id: 27479 reply_id: 111714[/import]