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的指代