AS 3.0 event handler with the reference implementation

 

Flash AS 3.0 event handler with the reference implementation

 

//要实现带参的事件处理函数
function tra(e:MouseEvent,i:int):void{
	trace("参数是:"+i);
}
//使用此中间函数实现
function EventUp(f:Function,i:int):Function{
	return function(e:Event){f.apply(null,[e].concat(i))};
}
//使用方法
EventUp(tra,1);

Reference: https://blog.csdn.net/YKing_cc/article/details/86690372

Guess you like

Origin www.cnblogs.com/yangjiale/p/11261387.html