actionscript 3.0 TypeError

前端 未结 2 1116
南笙
南笙 2021-01-24 04:11

Im getting this annoying error and I can`t figure out what the problem might be...

TypeError: Error #1009: Cannot access a property or method of a null object refe

2条回答
  •  暖寄归人
    2021-01-24 05:03

    Try this:

    addEventListener(Event.ADDED_TO_STAGE, this.ready);
    
    function ready(e:Event) {
        removeEventListener(Event.ADDED_TO_STAGE, ready);
        addEventListener(Event.ENTER_FRAME, initiateApp);
    }
    
    function initiateApp(e:Event){ 
            MovieClip(root).gotoAndStop(2);
    }
    

提交回复
热议问题