Manage the timelines of a symbol with a button outside the symbol

Hello,
I would like to pause a timeline of a symbol + go to the start of another timeline (of the same symbol) by clicking on a button that is outside the symbol => so I don't have access to the symbol's timelines unless I add a javascript function.
I tried this function when clicking the button:

function test(hypeDocument, element, event) {
	hypeDocument.getSymbolInstanceById('idofthesymbol').goToTimeInTimelineNamed(0, 'nametimelineinthesymbol');
	hypeDocument.getSymbolInstanceById('idofthesymbol').pauseTimelineNamed('nametimeline2inthesymbol');
}

But it doesn't work, why?
Thank you in advance for your help :slight_smile:

You can add Custom Behaviours in the symbol and then trigger them from a button action outside of the symbol.

symbCB.hype.zip (20.5 KB)


Screenshot 2021-05-31 at 13.38.53

3 Likes

Cool ! Thank you :smiley:

1 Like