5 Replies Latest reply on Aug 31, 2017 6:32 PM by marliton

    Identify an instance by the name

    marliton Level 3



      In an HTML5 canvas document, I'm trying to identify an element using the name when I click it. In AS3 the name property (evt.target.name) is the same instance name. With EaselJS seems to be different. I can use the name property for assign a name but I can't recover the name with evt.target.name. How can I do it?


      this.circle.name = "orange";
      this.circle.addEventListener("click", test.bind(this));
      function test(evt) {
           console.log(evt.target.name); //This doesn't works. Return null.