as/flex 中添加事件addEventListener()时传递参数

<textarea cols="50" rows="15" name="code" class="java">/** * @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"; } } }</textarea>

你可能感兴趣的:(Date,String,function,null,Class,import)