actionscript 3.0 TypeError

前端 未结 2 1110
南笙
南笙 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:06

    You can try validating the root.

    addEventListener(Event.ENTER_FRAME, initiateApp);
    
    function initiateApp(e:Event){
        if (root)
            MovieClip(root).gotoAndStop(2);
    }
    

    I don't understand why you are trying to go to the frame 2 using an EnterFrame Event. You simply must put a stage.gotoAndStop(2) or MovieClip(root).gotoAndStop(2) in the last frame of you animation.

提交回复
热议问题