Actionscript 3 AS3角色死亡动画结束时如何转到主时间轴中的下一帧

Actionscript 3 AS3角色死亡动画结束时如何转到主时间轴中的下一帧,actionscript-3,flash,animation,Actionscript 3,Flash,Animation,因此,我需要知道,如果我的角色(鸟)用管道击中测试对象,他在动画结束后播放模具动画,则需要转到主时间线中的游戏帧 (此代码位于主时间线层动作中) 链接1(这里您可以看到动画的不同帧第3帧是模具动画) 链接2(模具动画) 所以在这里你可以看到动画的结尾,在主时间轴的第3帧中,需要代码才能转到游戏 顺便说一句,它不在.as文件中,而是在时间轴中 谢谢你,如果你能帮助我,如果我的英语不好,我很抱歉我是荷兰人,你可以添加enterframe listener并检查动画是否完成。第3帧中类似的内容:

因此,我需要知道,如果我的角色(鸟)用管道击中测试对象,他在动画结束后播放模具动画,则需要转到主时间线中的游戏帧

(此代码位于主时间线层动作中)

链接1(这里您可以看到动画的不同帧第3帧是模具动画)

链接2(模具动画)

所以在这里你可以看到动画的结尾,在主时间轴的第3帧中,需要代码才能转到游戏

顺便说一句,它不在.as文件中,而是在时间轴中


谢谢你,如果你能帮助我,如果我的英语不好,我很抱歉我是荷兰人,你可以添加enterframe listener并检查动画是否完成。第3帧中类似的内容:

import flash.events.Event;
import flash.display.MovieClip;


var dieClip:MovieClip = this.getChildByName("Snail123fall");
//not sure what's the name of your clip but I assume it's something like that
//if your die animation clip has no name set than name it like that or any way 
//you want and use this name here

dieClip.addEventListener(Event.ENTER_FRAME, handleEnterFrame)   

private function handleEnterFrame(e:Event):void 
{
    if(dieClip.currentFrame == dieClip.totalFrames)
    {
        this.gotoAndStop(4);//game over frame       
    }
}
import flash.events.Event;
import flash.display.MovieClip;


var dieClip:MovieClip = this.getChildByName("Snail123fall");
//not sure what's the name of your clip but I assume it's something like that
//if your die animation clip has no name set than name it like that or any way 
//you want and use this name here

dieClip.addEventListener(Event.ENTER_FRAME, handleEnterFrame)   

private function handleEnterFrame(e:Event):void 
{
    if(dieClip.currentFrame == dieClip.totalFrames)
    {
        this.gotoAndStop(4);//game over frame       
    }
}