0

I have a api code below the problem I have; is I can start eventlistener but cant remove it so I wonder if I can remove all eventlistener in a div area to stop that event listener?

api.scene.addEventListener(api.scene.EVENTTYPE.SUBSCENE_PUBLISHED, myFunctionpicbir) = WORK;

api.scene.removeEventListener(api.scene.EVENTTYPE.SUBSCENE_PUBLISHED, myFunctionpicbir) = NOT WORK;

( so in spite of that code I want to remove all eventlistener in spesific div area)

 api.scene.addEventListener(api.scene.EVENTTYPE.SUBSCENE_PUBLISHED, myFunctionpicbir);
    
    function myFunctionpicbir() {
      alert("1")
      setTimeout(function() {
        html2canvas($('#sdv-container-sky')[0], {
          x: 500,
          y: 0,
          height: 600,
          width: 900
        }).then(function(canvas) {
          document.getElementById('kumas_cizim').appendChild(canvas);
          api.scene.removeEventListener(api.scene.EVENTTYPE.SUBSCENE_PUBLISHED, myFunctionpicbir);
          myFunctiona();
        }, 1500);
      })

also I asked a question about that api here :

momalone
  • 22
  • 4
  • Does this answer your question? [JavaScript: remove event listener](https://stackoverflow.com/questions/4402287/javascript-remove-event-listener) – Kareem Kamal Oct 17 '21 at 11:50
  • As I saw this stops spesific remove eventlistener.. like this.removeEventListener('click', myHandler); and as I told that doesnt work for that API.. so I need to stop ALL event listeners so I hope API listener will also stop. – momalone Oct 17 '21 at 11:52

0 Answers0