ActionScript3.0でイベントハンドラに引数を渡す 2010年4月14日 actionscript flex イベントハンドラ 引数 ActionScript使っているとイベントハンドラに引数を渡したいっていうことが多々あると思います。 なんだかいろいろな言語触っていると忘れてしまうので、メモしておきます。 1 2 3 4 5 6 7 8 9 10 11 12 public function hoge(userid:int):void { testBtn.addEventListener(MouseEvent.CLICK,hogeHandler(userid)); } public function hogeHandler(userId:int):Function { return function(event:MouseEvent):void { Alert.show(String(userid)); } } 参考 イベントハンドラに引数を渡す カテゴリ tech この記事をXで共有 前の記事 Last.fm RPSの不具合について 次の記事 GAEでBlazeDSを使うときのセッションスコープについて Please enable JavaScript to view the comments powered by Disqus. comments powered by Disqus