最新下载
热门教程
- 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)
}
相关文章
- vivopad和ipad9哪个好 06-17
- 钉钉直播画质不清晰怎么调 06-17
- vivoX90素皮会脱皮吗介绍 06-17
- 维普论文检测系统官方入口在哪 06-17
- 小红书关注列表不更新怎么办 06-17
- 2023淘宝618每日一猜6月28日答案一览 06-17