Advance on button press or time delay?

Hi.

I have done some searching on the forum and have seen AS to delay a movie…but my questions is this…

Is it possible to have a movie advance by either…

a. pressing a button OR
b. after a certain period of time elapses without a button press? (automatic advancing)

Thanks.

Hi,

A) Yes.
Something similar to the following whould work. This will work if the button is on the root timeline and you want the root timeline to play.


on(release) {
play();
}

B) Yes.
You can set up an interval that will call a function that will execute a command to play the movie after a set period of time has elapsed. Like so,


//set up the function to be called. Again note that this is all in the root timeline. Put the following all in the 1st frame.
function playNow() {
_root.play();
clearInterval(myInterval);
}

myInterval = setInterval(playNow, 8000);

stop();

Regards,
Viru.