myBtn.addEventListener("click", function(evt) {
        // do stuff...
        evt.remove(); // removes this listener.
    });

 

 

var S=this
S.btn.addEventListener("mousedown",function frame0Click(e) { S.btn.removeEventListener("mousedown",frame0Click) })

 

var name=this.on("mousedown",downF.bind(this))
this.removeF=function()
{
  this.off("mousedown",name)
}

 

 

 

在移动端,你需要在页面中增加一句

 createjs.Touch.enable(stage);

然后 mousedown 就能启到 touchstart的效果!

 

PS:JS中尤其需要注意 函数 变量的作用域,以及this的指代

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案