Check database for specific value to continue timeline

(Arnout) #1

Hi guys and girls!

I need your help. Would it be possible to check a sql database, and if for instance a certain field contains “Continue” I would like the timeline to continue? I have the jquery/ajax check in place, but i wonder how it would be possible to tell the Hype javascript to continue the animation?

Help is really appreciated!

(Arnout) #2

Would this code be usable?
hypeDocument.goToTimeInTimelineNamed(timeInSeconds, ‘timelineName’)

like this in the html page for instance?:
if (goToTime = 10 ) {
hypeDocument.goToTimeInTimelineNamed(timeInSeconds, ‘timelineName’)


The specific Hype API function to continue a timeline is:

continueTimelineNamed("Main Timeline", hypeDocument.kDirectionForward);

There’s more detail in the documentation here:


Hi @arnout,

Of course once you have the specified return from your database and place it in a string. You can of course check for that string value and then continue a timeline based on the result.

So yes your code in theory would work.

To clarify,

• run sql check to see if field contains something. If it does return that ‘something’
• JS to check if ‘something’ matches a value, if it does execute script, if it doesn’t exit gracefully.

something like (following is pseudo code):

if (request-from-ajax.responseText === "continue") {
  hypeDocument.goToTimeInTimelineNamed(timeInSeconds, 'timelineName');
} else {
  //say something to explain what's happened

Hope this helps!


(Arnout) #6

Hi D,

Wow, thank you so much for your quick reply! Super. I’ll try later this evening.


Verstuurd vanaf mijn iPhone