Timeline Action timestamps in scene

We use Hype for most of our interactive modules since we lost Flash. Our educational content we create uses navigation extensively. We have been using Timeline actions in scenes to pause the user and when they click the forward arrow it continues the timeline, and the back arrow goes back in the timeline and plays from the last pause timeline action.

We currently are using custom data that is being accessed by the navigation buttons to start and stop and move the user in a timeline. The problem is we are hard coding in the stop times on each scene and timeline for navigation in the custom data. If we need to change something in the presentation we have to change the custom data for every stop point.

Is there a way to get all the timeline actions timestamps on scene load? I haven't had any luck finding out and easy way to do this.

Thanks

Yes, you can scan the metadata of a scene using Hype Document Loader.
It is a hack that could break down the line, but it works for now …

goToCustomBehaviorNameInMainTimeline.hype.zip (41,6 KB)

2 Likes

Is there any chance that the stop points are evenly spaced on a timeline? If so then you could use the API to get the timeline duration and calculate from there.

Otherwise the only other way is to hack at the export data, which as @MaxZieb inferred is unsupported because it may change.

However it has been a longstanding feature requests to have labels for timeline actions that can be addressed directly ("go to time at timeline label named X"), which sounds like it could probably solve your case especially if there was a corresponding API to get all labels and read their times.

3 Likes

That is an absolutely fascinating approach. I ran that code in my project and the amount a useful information I've been trying to get at is outstanding. I can make this work for my current project, but I am trying to create a function that will work for navigation going forward. I'd have to cross my fingers that the export data never changes.

Thanks for all your contributions in the Hype community.

1 Like

I wish the timeline actions were spaced evenly, but the voice over audio for our projects varies in length for each section which changes where we put the timeline action.

If that longstanding feature every comes to fruition I can retire my navigation function which would be ideal. I will share my navigation function once I get it working in case somebody else runs into the same problem.

1 Like

Here is a version with chapter markers.

Updated download including fix (see discourse below):
goToChapter.hype.zip (27,3 KB)


The previous marker and next marker logic still isn't optimized for a playing head logic. It records markers it passes and previous marker, then jumps to the last current marker index -1 and next marker to the last current marker +1. I guess it would also make sense to check if the play head is already past the current marker time, and then rather behave like going to current marker as seen at the beginning of the video.


Update: Here is a version that plays around with a last chapter idea. There is a threshold of 0.33 seconds after a marker and if that is passed it considers the marker just passed the last, else it jumps to the previous marker:

Updated download including fix (see discourse below):
goToChapterWithLast.hype.zip (33,9 KB)

1 Like

That's true. Adobe Edge Animate had used timeline labels since 2015.

2 Likes

Yeah. It was really crucial to Flash too. Many designer used it to create their first “loops” and it was often a gateway going from simple timeline logic to full on action scripting at the time. It also, introduced people to using movieclips and loops in a timeline as simple state machines. This is somewhat possible with the multiple timelines feature in Hype, though with some quirks as editing elements in the main timeline often shifts/breaks/modifies elements on sub timelines).

This feature request was also on my wishlist for Hype 4. I guess I am using this thread for putting it on the wishlist for 5.


Apart, of the general demonstration on how to extract markers (with disclaimer), in the second example when using a chapter control … I just realize instead of determining the last chapter index based on the last time it was triggered (as we are using custom behavior here) one can just determine the last and next index by comparing the current timeline time index to the generated lookup and find next and last markers that way :man_facepalming:. It is actually pretty simple. So, having a hacked label API and interface already allows multiple use cases… now we just need it to be sanctioned through an official interface and API.


If a new label full on graphical interface for labels isn’t planned for Hype 5, having a way to extract keyframe info (JS object/list) would probably be a intermediary trick, as seen here. Difference to this being that the API would be official and supported.

1 Like

While not labels in the programming sense, I do appreciate how the timeline tooltips at least let you know what each timeline action is doing.

2 Likes

Doesn't seem to work for custom behavior, though. Too bad.

Hi @MaxZieb that's a really cool extension! :slight_smile:
one issue: starting a chapter at 0 let's the Hypeevents do a battle (Hype seems to set cb too at start and end of the timeline) that the custombehavior wins and the lookup is not yet set. simply moving the init of the custombehavior to the end of the documentrender may solve it?

I am removing the custom behavior listener. It is not necessary as explained (see facepalm emoji) to find chapters. Just didn’t get around to it yet.

ah ... but it's so smart to use the cb's :fox_face: :slight_smile: ... looking forward :slight_smile:

I updated the chapter versions above … no more custom behavior listener to determine current chapter. I was thinking maybe always adding a default chapter marker at the beginning and end of a timeline would be a nice idea (in the lookup, that is). Food for thought.


I did not remove custom behavior as a way to set them, just the listener to determine the last chapter. Now, it is simply fetched by comparing the current time to the lookup.


BTW, having the chapter marker be custom behavior has a pleasant upside, you can just react to the play head passing a chapter by setting up an action stack that triggers in such cases (scene panel).

1 Like