0

我的 Flash 项目中的两个场景中有两个动作层。

options_button.addEventListener(MouseEvent.CLICK, testfunction);

function testfunction(event:MouseEvent):void
{
    gotoAndPlay(1, "Scene 2");
}

    }

在场景 2 的动作层中

btn_return.addEventListener(MouseEvent.CLICK, testfunctionn);

function testfunctionn(event:MouseEvent):void

{

gotoAndPlay(1, "Scene 1");

}

但是,当我单击 options_button 按钮时,会抛出此消息:

TypeError: Error #1009: Cannot access a property or method of a null object reference
at btnOptions/frame201()[btnOptions::frame201:1]
at flash.display::MovieClip/gotoAndPlay()
at btnOptions/testfunction()[btnOptions::frame1:5]

我的调试中有一个图像,它指向一个箭头 btn_return.addEventListener(MouseEvent.CLICK, testfunctionn);

编辑:我有大约 100 个空白关键帧,直到实例被“关键帧”删除所有这些,所以实例在第一帧“解决”了它。按钮应该总是从第一帧开始的故事的寓意是什么?

4

0 回答 0