我有一个按钮列表:
同意按钮不同意按钮容器.clickButton1 容器.clickButton2
Container 是另一个影片剪辑,里面是最后两个按钮。
我怎样才能把它放在数组中并将所有相同的侦听器应用于每个侦听器?
var buttonArray:Array = new Array("agreeButton", "disagreeButton", "container.clickButton1", "container.clickButton2");
for (var i:int=0; i<buttonArray.length; i++) {
this[buttonArray[i]].addEventListener(MouseEvent.ROLL_OVER, mouseRollOver);
this[buttonArray[i]].addEventListener(MouseEvent.ROLL_OUT, mouseRollOut);
this[buttonArray[i]].addEventListener(MouseEvent.CLICK, mouseClick);
}