/**
* @author:ycccc8202
* @用途:注册事件进行传递参数的代理类
* @date:2007.8.26
* @example:
* import CYPL.utils.JEventDelegate
stage.addEventListener(MouseEvent.MOUSE_DOWN,JEventDelegate.create(mouseDownHandler,"a","b"));
function mouseDownHandler(e:MouseEvent,...arg) {
trace(e)
trace(arg)
}
*/
package CYPL.utils{
import flash.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";
}
}
}
stage.addEventListener(MouseEvent.MOUSE_DOWN,JEventDelegate.create(mouseDownHandler,"a","b"));