Go to the next scene with the setTimeout() method


(Dimitris Gkikas) #1

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.


#2

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


(Loves Hype) #3

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…


(Mark Hunte) #4

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

You have

hypeDocument.showNextScene

it should be

hypeDocument.showNextScene()


(Dimitris Gkikas) #5

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: