actionscript 3.0 TypeError

扶醉桌前 提交于 2019-12-02 03:03:45

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);
}

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!