Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 Flash/ActionScript 3.0如何在同一场景中连续循环帧而不转到下一场景_Actionscript 3_Flash - Fatal编程技术网

Actionscript 3 Flash/ActionScript 3.0如何在同一场景中连续循环帧而不转到下一场景

Actionscript 3 Flash/ActionScript 3.0如何在同一场景中连续循环帧而不转到下一场景,actionscript-3,flash,Actionscript 3,Flash,我如何在不进入下一个场景的情况下,在同一场景中的每一帧中连续循环帧,并暂停20秒?在这些帧中有用于其他场景的按钮。下面的效果很好,直到我在场景一的最后一帧,然后它进入下一个场景并播放。我怎样才能使场景一成为一个连续的循环 stop(); var timer:Timer = new Timer(20000,0);//<-- timer.addEventListener(TimerEvent.TIMER, timerHandler); timer.start(); function tim

我如何在不进入下一个场景的情况下,在同一场景中的每一帧中连续循环帧,并暂停20秒?在这些帧中有用于其他场景的按钮。下面的效果很好,直到我在场景一的最后一帧,然后它进入下一个场景并播放。我怎样才能使场景一成为一个连续的循环

stop();

var timer:Timer = new Timer(20000,0);//<--
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();

function timerHandler(event:TimerEvent):void {
    this.nextFrame();
    //or if you want to jump e.g 5 frames
    this.gotoAndStop(this.currentFrame+5);
}
stop();

var定时器:定时器=新定时器(20000,0)// 您只需检查下一帧是否为最后一帧:

function timerHandler(event:TimerEvent):void {
    if(this.currentFrame + 1 <= this.totalFrame){ //if your desired destination is less than the total frames, then your safe to goto to the nextFrame - replace the +1 with however many frames you want to skip
        this.nextFrame();
    }else{ //if not, reset back to frame one (loop)
        this.gotoAndStop(1);
    }
}
函数timerHandler(事件:TimerEvent):无效{

如果(this.currentFrame+1),我认为需要gotoAndPlay来保存东西going@RST他们用计时器来推进时间,如果我的答案解决了你的问题,把标记看作是被接受的答案。