帮助简单的AS3代码

时间:2011-01-24 01:45:24

标签: flash actionscript-3

  

可能重复:
  Help with simple AS3 code class

这是我的代码:

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上的有效按钮。为什么我收到此错误?我该如何解决?

0 个答案:

没有答案