flash as3中出现场景 1, 图层✀代码✀, 帧 1,11 行 1021: 函数定义重复。 怎么回事?

2025-02-27 08:09:43
推荐回答(1个)
回答1:

这个其实很好理解,function你写了一堆相同名称的函数,都是function onclick(){},这样是不成的,建议你this.MC1.addEventListener(MouseEvent.CLICK,onclick1);
function onclick1(e:MouseEvent){
this.gotoAndPlay(130);}
this.MC2.addEventListener(MouseEvent.CLICK,onclick2);
function onclick2(a:MouseEvent){
this.gotoAndPlay(25);}
this.MC3.addEventListener(MouseEvent.CLICK,onclick3);
function onclick3(b:MouseEvent){
this.gotoAndPlay(60);}
this.MC4.addEventListener(MouseEvent.CLICK,onclick4);
function onclick4(c:MouseEvent){
this.gotoAndPlay(95);}