Go to the next scene with the setTimeout() method

Hello. I am trying to set a timer in order to go to the next scene after 5 sec. Is there a way to do this? In my document I created two scenes and with setTimeout() method I am trying to go from the first scene to the next one but without success.

Here is my code:

<script>
setTimeout(function(){
   hypeDocument.showNextScene;
}, 500);
</script>

Not sure if is the correct one though. Any help would be great!

Thanks so much guys.

Hey Dimitris @Dimgk

One option to do this:

Add a new JavaScript function via Resources59

Then trigger it from your timeline on the 5 sec mark
27

1 Like

Is the action somehow triggered? Otherwise why not just use a regular next scene action placed on the main time line on second 5? In that case no need for a JS function…

3 Likes

The likely reason your code is not working is because you have a syntax mistake.

You have

hypeDocument.showNextScene

it should be

hypeDocument.showNextScene()

3 Likes

Thank you so much Ed, Max and Mark! I placed the next scene action on the main time line and it worked, I dont know why I didnt think of this before…

Thank you guys :slight_smile:

2 Likes