Do I make an array with the scenes and use math.random function?
Yep. That’s about it
Hype’s API would make things nice and easy (providing you are using unique names in all your scenes)
var scenes = hypeDocument.sceneNames();
hypeDocument.showSceneNamed(scenes[getRandomScene(scenes.length)])
function getRandomScene(length) {
return Math.floor(Math.random() * Math.floor(length));
}
3 Likes
Elegant
2 Likes
Thank you DBear!