Skip to main content
March 28, 2007
Question

loop / pause in movie clip - duration in seconds instead of number of frames

  • March 28, 2007
  • 1 reply
  • 189 views
hi,

i want to know if there's a smart way of creating long-ish, easily editable pauses in movies clips using actionscripting (instead of just throw in dozens more frames in the timeline)?

i'm currently using a loop as such:

i++
if (i<500) {
gotoAndPlay("waitingForUser");
trace(i)
} else {
gotoAndPlay("autoScroll ");
}
this has it looping through 500 times so is obviously dependant on framerate. is there a way to do this and have it loop for for x amount of seconds instead?

many thanks,

ponch
This topic has been closed for replies.

1 reply

Inspiring
March 28, 2007
There is an undocumented method in Flash called setTimeout() that is similar
to setInterval().

function thingToDo() {
//code to do something like
gotoAndStop(_currentframe + 1);
}

code to be placed on the frame that is to be timed:

myTimer = setTimeout(thingToDo, 2000) //where 2000 is delay in milliseconds