AS3でaddEventListenerを使って、マウスイベントなどで引数を一緒に渡したい場合に無名関数を使ってやる方法
[sourcecode language=”java”]
bt3.addEventListener(flash.events.MouseEvent.CLICK,onClick3("baka"));
function onClick3(str:String) {
return function (e:MouseEvent):void{;
trace("str",str);
trace(e.target.name);
} ;
}
[/sourcecode]