这是我的代码:
package com
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.filesystem.File;
import flash.filesystem.FileStream;
import flash.filesystem.FileMode;
import flash.events.Event;
import fl.accessibility.CheckBoxAccImpl;
import flash.display.MovieClip;
import fl.controls.CheckBox;
public class main extends MovieClip
{
public function main()
{
stop();
trace("b4 fate");
stage.addEventListener(Event.ENTER_FRAME, preview);
}
public function preview(e:Event):void
{
stage.addEventListener(Event.ENTER_FRAME, actions1);
}
public function actions1(e:Event):void
{
trace("b4 event listeners");
l1.addEventListener(MouseEvent.CLICK, goto2);
}
public function goto2(e:MouseEvent):void
{
trace("after rl2");
gotoAndStop(2);
}
public function actionsother(e:Event):void
{
}
}
}
我一直收到此错误:Error #1009: Cannot access a property or method of a null object reference.
l1是frame1上的有效按钮。为什么我收到此错误?我该如何解决?