Cannot jump to a scene and continue the timeline at a point in the middle. It jumps to the right scene, and momentarily shows the right point in the middle of that scene (here, 10 seconds in).
But then instantly it restarts the second scene. It does appear to work when hypeDocument.kSceneTransitionInstant is used, but no other transitions. JumpToMiddle.hype.zip (25.6 KB)
I think we can file this under “that’s the way it is”.
With that idea in mind let’s “tag team” the issue using the “On Scene Load” event in Scene 2 - in addition to the code from your original script (just below) which is triggered in Scene 1:
hypeDocument.showSceneNamed('Scene 2', hypeDocument.kSceneTransitionCrossfade, 1.1)
// only seems to work with hypeDocument.kSceneTransitionInstant
// hypeDocument.showSceneNamed('Scene 2', hypeDocument.kSceneTransitionInstant, 1.1)
hypeDocument.goToTimeInTimelineNamed(10, 'Main Timeline')
Now for the tag team:
We need to tell Hype to go to the 10 second mark twice in the cross-fade transition - once from Scene 1 and then again when Scene 2 opens.
Scene 2’s “On Scene Load” handler (in the “Scene Inspector” panel):
Note: You could write a JavaScript for the above but for my purposes here I found it simpler to use the “Scene Inspector”.
Just to chime in on the "why" - the Hype Javascript API for goToTimeInTimelineNamed() uses the current scene. An instant transition changes the current scene instantly, but when using a different transition the current scene is still the older one (the source) until the transition has finished. Thus the goToTimeInTimelineNamed() call is not operating on the destination scene but the source scene. I do consider it a design flaw, but unlikely to be resolved anytime soon as we don't often make API changes.