Preload Scene using Javascript


(Simon) #1

Hello!

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

Thanks,
Simon


How to download(pre download) next scenes in first scenes.?
(Mark Hunte) #2

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


(Simon) #3

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.

Thanks,
Simon


(Hans-Gerd Claßen) #4

hi,

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