最新下载
热门教程
- 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)
}
相关文章
- 趣智校园app如何注销账号 03-19
- 妖精漫画网页端官网首页入口在哪 03-19
- 卖座电影如何更换手机号 03-19
- 哔哩哔哩如何关闭弹幕 03-19
- 哪里能找到ao3镜像链接2021 03-19
- 高德地图路线规划不显示高速收费信息怎么办 03-19