0
異なるイベントハンドラーを使用して複数のボタンをプログラムで作成する方法や、異なる方法でパラメータを設定したイベントハンドラーを作成する方法については、いくつかの指針が必要です。私の本当の使い方はちょっと複雑ですが、これには次のようなものがあります:クリックすると削除されるボタンが必要です。Flash:動的ボタンクリックハンドラー
var Buttons:Vector.<Button> = new Vector.<Button>;
var newButton = new Button;
var int = Buttons.push(newButton);
newButton.addEventListener(MouseEvent.CLICK, button_clickHandler);
// pseudocode
button_clickHandler(event:MouseEvent):void {
if (event.button = i) { delete button i}
}
私はすべてのボタンに対してクリックイベント時にマウスの位置を確認して、クリックされた1考え出すような愚かな何かを除いて、Flashでこれを行う方法を把握することはできません。
これはまさに私が探していたものです。ありがとう。 –