错误#1009 - 我找不到为什么它说“空对象引用”

时间:2015-02-03 22:08:34

标签: actionscript-3 flash mouseevent

我的.fla上有这个错误的问题。请问你能帮帮我吗 ? 我调试我的文件,找到问题的位置,但无法解决它。它说:

  

TypeError:错误#1009:无法访问null的属性或方法   对象参考。在   lacdeder_v3_fla :: MainTimeline /帧1()[lacdeder_v3_fla.MainTimeline ::帧1:49]

我的代码是:

stop ();

btn_chap1_1.addEventListener(MouseEvent.CLICK, btn_chap1_11);
btn_chap1_2.addEventListener(MouseEvent.CLICK, btn_chap1_22);
btn_chap1_3.addEventListener(MouseEvent.CLICK, btn_chap1_33);
btn_chap2_1.addEventListener(MouseEvent.CLICK, btn_chap2_11);
btn_chap2_2.addEventListener(MouseEvent.CLICK, btn_chap2_22);
btn_chap2_3.addEventListener(MouseEvent.CLICK, btn_chap2_33);
btn_chap3_1.addEventListener(MouseEvent.CLICK, btn_chap3_11);
btn_chap3_2.addEventListener(MouseEvent.CLICK, btn_chap3_22);
btn_chap3_3.addEventListener(MouseEvent.CLICK, btn_chap3_33);

function btn_chap1_11(event:MouseEvent):void {
    gotoAndStop("chap1_1");
}

function btn_chap1_22(event:MouseEvent):void {
    gotoAndStop("chap1_2");
}

function btn_chap1_33(event:MouseEvent):void {
    gotoAndPlay("chap1_3");
}

function btn_chap2_11(event:MouseEvent):void {
    gotoAndStop("chap2_1_1");
}

function btn_chap2_22(event:MouseEvent):void {
    gotoAndStop("chap2_2_1");
}

function btn_chap2_33(event:MouseEvent):void {
    gotoAndPlay("chap2_3");
}

function btn_chap3_11(event:MouseEvent):void {
    gotoAndStop("chap3_1");
}

function btn_chap3_22(event:MouseEvent):void {
    gotoAndStop("chap3_2");
}

function btn_chap3_33(event:MouseEvent):void {
    gotoAndStop("chap3_3");
}

date1910.addEventListener(MouseEvent.CLICK, go1910);
date1938.addEventListener(MouseEvent.CLICK, go1938);
date1955.addEventListener(MouseEvent.CLICK, go1955);
date1969.addEventListener(MouseEvent.CLICK, go1969);
date1974.addEventListener(MouseEvent.CLICK, go1974);

function go1910(event:MouseEvent):void {
    gotoAndStop("chap2_1_1");
}

function go1938(event:MouseEvent):void {
    gotoAndStop("chap2_1_2");
}

function go1955(event:MouseEvent):void {
    gotoAndStop("chap2_1_3");
}

function go1969(event:MouseEvent):void {
    gotoAndStop("chap2_1_4");
}

function go1974(event:MouseEvent):void {
    gotoAndStop("chap2_1_5");
}

btn_village1.addEventListener(MouseEvent.CLICK, allervillage1);
btn_village2.addEventListener(MouseEvent.CLICK, allervillage2);
btn_village3.addEventListener(MouseEvent.CLICK, allervillage3);
btn_village4.addEventListener(MouseEvent.CLICK, allervillage4);

function allervillage1(event:MouseEvent):void {
    gotoAndStop("village1")
}

function allervillage2(event:MouseEvent):void {
    gotoAndStop("village2")
}

function allervillage3(event:MouseEvent):void {
    gotoAndStop("village3")
}

function allervillage4(event:MouseEvent):void {
    gotoAndStop("village4")
}

1 个答案:

答案 0 :(得分:0)

date1910为null,您需要在代码中的某个位置或舞台上定义它。