We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

How to remove event listeners from objects?

Home Forums Programming How to remove event listeners from objects?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #47785
    dotimo
    Customer

    Greetings, everyone!

    Is there a solution to metioned problem?

    The situation : when i remove an object and then create an object with same name , event listeners from first object remain on second…
    An object have same name for better classification , because there are many objects on scene, and names play important role in organizations of dicionaries.

    For now, best what i can think is write a list of object names with setted listeners and when creating new object with same name check list and do not set event listener again…

    But more straight way to remove event listener is hoped for…

    Also in docs i saw .hasEventListener() method (https://www.soft8soft.com/docs/api/en/core/EventDispatcher.html)
    But it has no reference of how to use it. When i tried app.scene.getObjectByName(‘objName’).hasEventListener() i get false, but it has on hover listener.

    Thanks !!

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.