最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
addEventListener注册事件传递参数的方法
时间:2022-07-02 17:19:22 编辑:袖梨 来源:一聚教程网
import .events.Event
public class JEventDelegate {
public function JEventDelegate() {
}
public static function create(f:Function,... arg):Function {
return function(e:Event){
f.apply(null,[e].concat(arg));}
};
public static function toString():String {
return "Class JEventDelegate";
}
}
}
使用格式如下:
import com.ycccc.utils.JEventDelegate
stage.addEventListener(MouseEvent.MOUSE_DOWN,JEventDelegate.create(mouseDownHandler,"a","b"));
function mouseDownHandler(e:MouseEvent,...arg) {
trace(e)
trace(arg)
}
相关文章
- 鹅鸭杀超级金水铃模式怎么玩 08-07
- 牧场物语风之繁华集市生日日期怎么看 08-07
- 口袋新旅途如何捕捉颓颓鹰 08-07
- DNF狄瑞吉版本女漫游加点攻略 08-07
- 鹅鸭杀士兵怎么玩 08-07
- DNF狄瑞吉版本协战师加点攻略 08-07