在调试Flash时会对ErrorMessages感到困惑

时间:2013-05-16 16:46:29

标签: actionscript-3 flash flash-cs5

TypeError:错误#1009:无法访问空对象引用的属性或方法。     在savethetiger_fla :: MainTimeline / frame168()

stop(); 
home_btn.addEventListener(MouseEvent.CLICK,home); 

function home(event:MouseEvent){ 
    gotoAndPlay(1,"scene1"); 
}

aboutus_btn.addEventListener(MouseEvent.CLICK,aboutus);

function aboutus(event:MouseEvent){ 
    gotoAndPlay(1,"Scene2"); 
}

gallery_btn.addEventListener(MouseEvent.CLICK,gallery); 
function gallery(event:MouseEvent){ 
    gotoAndPlay(1,"Scene5"); 
}

contactus_btn.addEventListener(MouseEvent.CLICK,contactus);

function contactus(event:MouseEvent){ 
    gotoAndPlay(1,"Scene4"); 
} 

1 个答案:

答案 0 :(得分:0)

您的代码看起来不错,但我们无法确定您是否正确拼写了所有内容以及分配这些操作时屏幕上是否显示按钮。

看起来有点奇怪的是这个函数的拼写

function home(event:MouseEvent){ 
    gotoAndPlay(1,"scene1"); 
}

您确定scene1代替Scene1吗? 并且没有Scene3,这是正确的吗?