/** * @author:ycccc8202 * @用途:注册事件进行传递参数的代理类 * @date:2007.8.26 * @example: * import com.ycccc.utils.JEventDelegate stage.addEventListener(MouseEvent.MOUSE_DOWN,JEventDelegate.create(mouseDownHandler,"a","b")); function mouseDownHandler(e:MouseEvent,...arg) { trace(e) trace(arg) } */ package com.projectstateview.comm.method { import flash.events.Event; public class JEventDelegate { public function JEventDelegate() { } public static function create(f:Function,... arg):Function { return function(e:Event):void { f.apply(null,[e].concat(arg)); } } public static function toString():String { return "Class JEventDelegate"; } } }