self Kill EventListener ? (SOLVED)

hi it is possible to self kill a EventListener ?
If yes how i can performe this ?

example:
PHP:
    vidControl.vIntro.addEventListener("timeupdate", function() { 
        if (this.currentTime > 10) {
            //Do Stuff one time
            this.removeEventListener('timeupdate',this); // And Do Self KILL, BREAK or DESTROY ?
        }
    }, false);

thank
Try putting the function in a variable and using that to add and remove the listener, I don't think you can remove an event listener if it's an anonymous function.

I'd type some code for you but I am on mobile phone. :/
Try putting the function in a variable and using that to add and remove the listener, I don't think you can remove an event listener if it's an anonymous function.

I'd type some code for you but I am on mobile phone. :/
humm something like thats ?
i give name to the anonyme function in the listener, then remove it when the function has run:
PHP:
    vidControl.vIntro.addEventListener("timeupdate", function TESTT() {
        if (this.currentTime > 10) {
            //Do Stuff one time
            this.removeEventListener('timeupdate',TESTT); // work! But is this the right way to do it? 
        }
    }, false);
That is one way of doing it, absolutely, this works for you correct? My initial thought was to assign it to a variable but the way you did it should work fine. There is no one way of doing things, there is usually plenty of ways to achieve the same result.
Code:
// My initial thought was....

var updateTimeCall = function () {
//Do stuff and remove listener by refrencing the variable name
removeEventListener('event', updateTimeCall)
}
addEventListener('event', updateTimeCall)
That is one way of doing it, absolutely, this works for you correct? My initial thought was to assign it to a variable but the way you did it should work fine. There is no one way of doing things, there is usually plenty of ways to achieve the same result.
Code:
// My initial thought was....

var updateTimeCall = function () {
//Do stuff and remove listener by refrencing the variable name
removeEventListener('event', updateTimeCall)
}
addEventListener('event', updateTimeCall)
yes is work
i found tips in this article
https://www.broken-links.com/2013/05/22/removing-event-listeners-with-anonymous-functions/

Original thread: https://forums.rpgmakerweb.com/threads/self-kill-eventlistener-solved.82079/