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


(Arnout) #2

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

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


#3

The specific Hype API function to continue a timeline is:

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

There’s more detail in the documentation here: http://tumult.com/hype/documentation/


#4

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');
  hypeDocument.continueTimelineNamed("timelineName");
} else {
  //say something to explain what's happened
}

Hope this helps!

D


(Arnout) #6

Hi D,

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

Arnout

Verstuurd vanaf mijn iPhone