Symbols referencing Scene's Main Timeline

(julian) #1

How can I reference the Scene’s main timeline on a persistent symbol? I’ve red in this forum that I can do it with a custom behavior, which is great, but how? Could someone post the actual code for it?

I’m working on the app version of this Hype site and it’s almost done, I only need to do one final thing referencing an external timeline within a symbol.


(Jonathan Deutsch) #2

There’s two basic ways; the first requires JavaScript but is the easiest and probably what you would want.

The basic hypeDocument APIs are always for the top-level scene, so running them would affect whatever the current scene is. As an example, if you needed to continue the main timeline of the current scene from a button press within the persistent symbol, the code would be:

hypeDocument.continueTimelineNamed('Main Timeline', hypeDocument.kDirectionForward, false);

The second way would be to trigger a custom behavior in the persistent symbol. Then each scene would need to have custom behaviors defined for that particular behavior name and they’d essentially also do the same thing; this would require a lot of repetition but no code.

(julian) #3

Thank you. First solution worked. That was great!