AS3.0 侦听器传参的方法

给个属性比如
mc.proper="123"
然后在函数里面引用
mc.proper="123"
  mc.addEventListener(MouseEvent.MOUSE_UP,MoneyUpListener);
public function MoneyDownListener( event:MouseEvent): void {
             event.target.startDrag();
             trace( event.target.proper)
}
 
 
方法二:
var sayHello:String = "欢迎光临";
btn1.addEventListener(MouseEvent.CLICK, function (e:MouseEvent){clickHandlerWithArg(e,sayHello)});    
function clickHandlerWithArg(e:MouseEvent,arg:String): void    
{    
var out:String= e.target + "发出事件(有参数) :" + arg;    
trace(out);    
}

你可能感兴趣的:(职场,as3.0,休闲)