Hello guys I was wondering how could you make a timeout like to stay on a frame for x time and then after that time you get sent to another frame
Do the same as the following topic, but instead of moving, just do project.gotoAndStop(frame)
ok thanks!
I didn’t understand :|
can’t you use setTimeout
Try to put at the default the following:
this.FPSCounter = 0;
this.interval = 2*project.framerate;
onEvent('update', function () {
if(this.FPSCounter++ >= this.interval) {
project.gotoAndStop(2);
}
});
That will change the frame after 2 seconds…
If you want a different time, just change this
“2” for the desired number in seconds…
this.interval = 2*project.framerate;
ok I’ll try
wait how do I set the time
Change that number…
ok thanks! again…
Hi Jordy,
bit late to the party, but I wanted to share my code.
It is easy to make wick stop and start again - but it took my a few takes to get it to do this reliably, repeatedly and with precision.
in the default event
stop();
this.timer = Date.now()
in the update event
if ((Date.now() - this.timer) > 1000){ play() }
you can change the 1000 to any millisecond count you want.
I found this to be the most clean way of doing this
regards,
Paul