0

我这里有 4 个在主舞台上的影片剪辑,其中一个影片剪辑中有 5 个影片剪辑

btn_mc5在我添加了事件侦听btn_mc9器的内部content_mc,但他们没有做任何事情。此外,他们正在生成一条从“”行开始的错误消息content_mc.btn_mc5.addEventListener(MouseEvent.MOUSE_DOWN, btn5up);

TypeError:错误#1010:术语未定义且没有属性。在 Untitled_fla::MainTimeline/frame2()

import flash.events.MouseEvent;

stop();

btn_mc1.gotoAndStop(2);
btn_mc2.stop();
btn_mc3.stop();
btn_mc4.stop();

content_mc.stop();

btn_mc1.addEventListener(MouseEvent.MOUSE_DOWN, btn1up);
btn_mc2.addEventListener(MouseEvent.MOUSE_DOWN, btn2up);
btn_mc3.addEventListener(MouseEvent.MOUSE_DOWN, btn3up);
btn_mc4.addEventListener(MouseEvent.MOUSE_DOWN, btn4up);

content_mc.btn_mc5.addEventListener(MouseEvent.MOUSE_DOWN, btn5up);
content_mc.btn_mc6.addEventListener(MouseEvent.MOUSE_DOWN, btn6up);
content_mc.btn_mc7.addEventListener(MouseEvent.MOUSE_DOWN, btn7up);
content_mc.btn_mc8.addEventListener(MouseEvent.MOUSE_DOWN, btn8up);
content_mc.btn_mc9.addEventListener(MouseEvent.MOUSE_DOWN, btn9up);

function btn1up(event:MouseEvent):void{
    content_mc.gotoAndStop(1);
    reset();
    btn_mc1.gotoAndStop(2);
}
function btn2up(event:MouseEvent):void{
    content_mc.gotoAndStop(2);
    reset();
    btn_mc2.gotoAndStop(2);
}
function btn3up(event:MouseEvent):void{
    content_mc.gotoAndStop(3);
    reset();
    btn_mc3.gotoAndStop(2);
}
function btn4up(event:MouseEvent):void{
    content_mc.gotoAndStop(4);
    reset();
    btn_mc4.gotoAndStop(4);
}
function btn5up(event:MouseEvent):void{
    content_mc.gotoAndStop(1);
    content_mc.btn_mc5.gotoAndStop(1);
}
function btn6up(event:MouseEvent):void{
    content_mc.gotoAndStop(6);

}
function btn7up(event:MouseEvent):void{
    content_mc.gotoAndStop(7);
}
function btn8up(event:MouseEvent):void{
    content_mc.gotoAndStop(8);
}
function btn9up(event:MouseEvent):void{
    content_mc.gotoAndStop(9);
}

function reset():void{
    for(var i = 1; i<= 4; i++){
        var btn_name = getChildByName("btn_mc"+i);
        btn_name.gotoAndStop(1);
        }
}
4

0 回答 0