[Resolved] Need help,when I deal with CCNotificationCenter on html5 version

Hi, guys.
I choose to use NSNotificationCenter to deal with some events when I work on cocos2d-iphone. If I add a target and a event to NSNotificationCenter, I will remove the target from Center in the target`s destructor.like this:

  • (void)dealloc
    {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    }
    Now, on the cocos2d-html5, I find it has a CCNotificationCenter. But I was first to use JS in which I don`t find a method like a destructor. So, I don`t know when is a best time to remove the target from Center.
    Anyone can give some advices? Thx a lot.:smiley:

please tell me where the position of CCNotificatioCenter in cocos2d-html5,i can not find it.

`Zhao

`,
onExit: function() {
cc.unregisterTouchDelegate(this);
gNotification.removeAllObservers(this);
this.removeAllChildren();
this._super();
}@

@Ding cocos2d-html5-v2.2/cocos2d/support/CCNotificationCenter.js

thanks Pete .