How to jump to the specific timeline of a scene from another scene by element On Mouse Click?


(Alex) #1

Hello,

If there are several timelines in a scene, It is easy to jump to specific time of specific timeline in a scene By using On Mouse Click.

But, is it possible to jump to the specific timeline of a scene from another scene by element On Mouse Click?

Thanks a lot.

Alex


Jump to specific frame in another scenes timeline
Jump to specific frame in another scenes timeline
(Mark Hunte) #2

You should be able to construct a Custom behaviour for going to the specific time on scene 1.
On scene 2 mouse click action -> Go to Scene 1 (INSTANT transition) , Trigger Custom Behaviour

In most cases you will want to use instant transition. Otherwise you will get things like the animation will show at the specified time in the timeline but then restart once the scene has fully loaded

You can get around this with some tricks.

For example make the timeline relative. You can then have a crossfade transition that will in effect start the other timeline from the current position rather than jumping back to the start.

customBRel_Fade.hype.zip (25.5 KB)


(Alex) #3

thanks so much.

I just guess you used Javascript, right? but I can not find the “goToTimeOnScene” javascript in resource.


Any extension used?

Thanks.

Alex


(Alex) #4

here is the difference between yours and mine:

but I did add a custom behavior on first scene:

Attached, please check my test project file:

timeline test.hype.zip (16.6 KB)


(Mark Hunte) #5

Er… no I used the Native Hype the Action selections.

It looks like you forgot to add the trigger Custom Behaviour on the scene two button. After the Jump to scene


(Alex) #6

oh God, yes, thanks so much:)

Alex


(Familie Grüneberg) #9

Hi everyone.

im new to Hype 3 but love it. At this moment I struggle to get this to work properly, so I have 2 different scenes! When I click an object in scene 1 I want it to start another scene but not from the beginning but a specific time on a specific timeline.

I tried it with a javascript which works when I use full seconds to jump to. I want to jump to a specific frame and don’t know the correct syntax for this.

Right now it looks like this:

hypeDocument.showSceneNamed('scene2', hypeDocument.kSceneTransitionCrossfade, 0);
hypeDocument.goToTimeInTimelineNamed(1, 'test')

hypeDocument.stopTimelineNamed('test', hypeDocument.kDirectionForward, false);

I want to take out the “1” in goToTimeInTimelineNamed and put in e.g. “00:00,29”

Is this possible?

Thanks in advance!
KnoRke

FYI - my programing skills are VERY basic :slight_smile:


(Familie Grüneberg) #10

Thanks alot for the quick reply!

But I’m not seeing where he puts the time value where scene 1 should begin when pressing the button on scene 2. There is a custom behavior with “goToTimeOnScene” selected but without a specific value?

Am I missing something here?


(Familie Grüneberg) #11

Nevermind, got it :slight_smile: