Trigger symbol timeline from main timeline


#1

I’m trying to get a symbol timeline to start by clicking a button on the main timeline. But I can’t figure out how to tell the button which timeline to play.

I’m not clear on timelines. When I edit the symbol, the animations inside the symbol should be placed along the symbol’s timeline right? But when I return to the main timeline to tell the button to start the symbol timline, I can’t find any reference to it. How is the button going to know which timeline to trigger?

Any help appreciated.


(𝕄𝕚𝕔𝕙𝕒𝕖𝕝 𝔾𝕒𝕣𝕠𝕗𝕒𝕝𝕠) #2

(Brian) #3

You need to get a reference to the symbol instance by it’s ID then you can target that timeline.

var instance = hypeDocument.getSymbolInstanceById(“someInstanceName”);
instance.startTimelineNamed(“whateverYourTimelineNameIs”, hypeDocument.kDirectionForward);


#4

Do I have to use Javascript? I bought Hype because it was supposed to be simple and easy to use.


(Brian) #5

If you want to make something interactive, then yes, you need to code.


#6

Thanks for your reply. I hate Java. Is there another way? Custom behaviors?

Plus are there any good tutorials? Lynda.com is out of date.


#7

Demo Hype Project: CustBehaviorSymbol_JHSv1.hype.zip (16.8 KB)

The button “RotateSquare” triggers (On Mouse Click) the Custom Behavior “RotateSquare”.

This Custom Behaviour was created in the symbol “Square”. The behavior runs the symbol’s “Main Timeline” which rotates the square.


(Pete) #8

https://www.skillshare.com/classes/Building-Responsive-HTML5-with-Tumult-Hype-3-Pro/1432541614/classroom/discussions?via=search-layout-grid&enrolledRedirect=1


(Mark Hunte) #9

Please don’t tell people that. It is not true!!

As @JimScott has shown You do NOT need JavaScript to be interactive

It does help in many cases and is well worth learning the basics as it does give you more versatility.


(Brian) #10

I should reword. If you want to not be constrained in your interactivity, then you should learn Javascript.