Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 93817

Re: How do I continually loop frames with a 20 second pause in each frame from the same scene without going to the next scene?

$
0
0

thank you for your code.

 

I have everything in one scene now and the below code works great with for a loop with the code in Frame 55 to repeat. My problem now is that once I click on any of the buttons the reset of the frames not in the first 55 is still using the timer and advancing to the next frame. I can click through buttons before the timer advances but I need to know how to stop the time so it will not work past frame 55. Any Ideas?

 

 

Code in Frame 55:

stop();

{

    if (currentFrame == 55) {

        gotoAndPlay(1);

    }

}

 

 

 

 

Code in first Frame:

import flash.display.Scene;

import flash.events.TimerEvent;

 

stop();

 

var called:Boolean;

 

if (!called) {

 

var timer:Timer = new Timer(500,0);

timer.addEventListener(TimerEvent.TIMER, timerHandler);

timer.start();

called = true;

 

}

 

function timerHandler(event:TimerEvent):void {

 

 

if (this.currentFrame != 55) {

 

this.nextFrame();

 

} else {

 

this.stop();

 

}

}


Viewing all articles
Browse latest Browse all 93817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>