Jump to a time in another scene


(Anders O Blomberg) #1

From scene A I want to have some buttons pointing to different times in the main timeline of scene B. Is this possible? Thanks for any help!


Welcome on board! Please introduce yourself 🖐
(Hans-Gerd Claßen) #2

hi,

you’ll need a global var …

button

time = yourdesttime

scene b onsceneload

hypeDocument.goToTimeInTimelineNamed(time, 'yourtimelinename')

you may work around js by using persistant symbols … depends on your needs …


(Anders O Blomberg) #3

Thank you! I think I get the idea, but I am not so familiar with how and where to create this global variable. I understand that the button, when clicked/tapped will set the variable to 1,2 or 3 etcetera, and onsceneload it will go to that place on the timeline.
So I have to find a variable tutorial and a make-the-right-calls-tutorial…
But I do understand the logic, thanks a million!


(Mark Hunte) #4

You can also possibly use a custom Behaviour.

On Scene B’s Behaviour , create a Behaviour that goes to time in timeline. Call it for example button1

Then on Scene A,

Select your button 1 and give it a 2 On Mouse Action:

Jump To scene B.
Trigger custom behaviour button1.

This should work with transitions or instant.

Each button can have its own create a Behaviour


(Anders O Blomberg) #5

http://www.epx.se/epxProblem.zip
There are two ways to navigate, a menu and some buttons (on a map). The menu works fine with two actions (go to scene, go to time), but the buttons don’t . I tried the behavior thing too, but the buttons just make it slide to time 1 on the timeline, or sometimes 8, other end.
Probably I make some mistake that I can’t see…


(strmiska) #6

would be good, if you have any example document for your problem.


(Anders O Blomberg) #7

Trying to fix that. The thing I work with is so big so I’ll strip off all that is not relevant for this. Stay tuned…


(Greg) #8

Try assigning two actions…


(Anders O Blomberg) #10

I know, my mistake.
Sorry about that!


(Anders O Blomberg) #11

Please see link to document above.


(Mark Hunte) #12

The Behaviour method works if you move the animations off the main timeline and onto a new timeline.

You can just duplicate the main time line on scene 2 in the Animations Timeline’s on the Scene inspector.
Then remove them from the original Main Time line.

(I think Hype is struggling with the logic when you use a main timeline to do this)

epxProblem.hype.zip (82.0 KB)

Note I took out the 12MB file so I could post the example back here…


Can anyone confirm this is a bug?
(Anders O Blomberg) #13

Thank you so much for this kind tip, Mark. Will try it as soon as I get back to my base camp in a day or two.


#14

In theory very nice … but it does not seem to work.


(Rick) #15

If it works, can this be translated to an external link too?

So a href link on a website that points to a specific time in a specific timeline in a specific Hype scene?


(Hans-Gerd Claßen) #16

you’ll need to script this.

window.location.hash

would be the road to go

this woud be a nice basis:


(Hans-Gerd Claßen) #17

this should work on scene load:
var checkHash = function() {
var hash = window.location.hash.substring(1).split(’?’);

for (var i = 0; i < hypeDocument.sceneNames().length; i++) {
if (hypeDocument.sceneNames()[i] == hash[0] && hypeDocument.currentSceneName() != hash[0]) {
hypeDocument.showSceneNamed(hash[0]);
hypeDocument.goToTimeInTimelineNamed(parseInt(hash[2]), hash[1])                
break;
}
}
};

if (window.loadedHashLocation != true) {
window.loadedHashLocation = true;
checkHash();
window.onhashchange = checkHash;
}

window.location.hash = "#" + hypeDocument.currentSceneName();

your url would look like:
yourDomain/yourDocument.html#yourScene?yourTimelinename?yourDestTimeInSeconds


Linking to a specific scene from inside and outside of a Tumult Hype document
(Mark Hunte) #18

This is not theory, It does work, but maybe not for your setup what ever that is ?


#19

Good Morning,

thx for your reply. This method:

hypeDocument.showSceneNamed(hash[0]);
hypeDocument.goToTimeInTimelineNamed(parseInt(hash[2]), hash[1])

we did get to work. Interesting is that we have one scene that for some reason does not work. But on scenes that we have set up fresh it works beautifully. Thank you for that!

What does not work on my machine is the demo hype file (epxProblem…). But since the problem is elegantly solved by the script above I for one am happy to have learned something new :wink:


(Mark Hunte) #20

Thanks.
It always helps to explain what does not work. The example file works here ( different Machine than I used before) But note all I changed in that example was add a Timeline that was not in the original

Any way there is always more than one way to skin a cat as they say… :relaxed:


(Rick) #21

Sorry for the delay… :sweat_smile:
Thank you very much for taking the time to answer this!