Preload Scene using Javascript


Is there any way to preload a scene (without calling showNextScene/showPreviousScene) using javascript?


Not sure why you want to do that, but if it is because you want to access elements from an unloaded scene…
Then look at this thread

thanks for the information.

I’m trying to create a ebook application which contains a lot of (30 ~ 50) scenes as pages. Since preload all the images would largely increase the loading time, I turn off the preload option for all the images so they will load on demand.

I noticed that before a scene is called to shown, elements DOM is not populated as all the images are not loaded. what im want to achieve is to preload the next scene when the user is reading the current scene, so when showNextScene is called, the dom and image is ready.

i tried to call showNextScene and showPreviousScene as the same time (as also suggested in the thread), this works with only one drawback: this will reset the timeline and replay the current scene.

a separate javascript function to load the scene in background would be ideal.



feed an array with filenames for each scene.
use hypes attribute ‘hype_scene_index’ to identify the next scene.
preload corresponding files …