我的動畫裡有7個按鈕,而在影格中寫好語法後,測試結果是1021:函數定義重複
請問哪裡有問題嗎
附上我寫的語法
a1.a2.a3.a4.a5.a6.s1是按鈕實體名稱
stop();
a1.addEventListener(MouseEvent.CLICK,myClick);
function myClick(e:MouseEvent):void {
gotoAndPlay(1,"a1");
}
a2.addEventListener(MouseEvent.CLICK,myClick);
function myClick(e:MouseEvent):void {
gotoAndPlay(1,"a2");
}
a3.addEventListener(MouseEvent.CLICK,myClick);
function myClick(e:MouseEvent):void {
gotoAndPlay(1,"a3");
}
a4.addEventListener(MouseEvent.CLICK,myClick);
function myClick(e:MouseEvent):void {
gotoAndPlay(1,"a4");
}
a5.addEventListener(MouseEvent.CLICK,myClick);
function myClick(e:MouseEvent):void {
gotoAndPlay(1,"a5");
}
a6.addEventListener(MouseEvent.CLICK,myClick);
function myClick(e:MouseEvent):void {
gotoAndPlay(1,"a6");
}
s1.addEventListener(MouseEvent.CLICK,myClick);
function myClick(e:MouseEvent):void {
gotoAndPlay(1,"s1");
}