Triggering a symbol instance to play on the main timeline


(Ralph) #1

I need to use a button to trigger a symbol instance, the symbol is sitting on the main timeline, name of symbol is ZoomInSequence

So for the button to run this I have the following

OnMouseClick Run javascript

var symbolInstance = hypeDocument.getSymbolInstanceById(‘ZoomInSequence’);
symbolInstance.startTimelineNamed(‘Main Timeline’, hypeDocument.kDirectionForward);

The function is calledZoom

javascript looks like this:

function Zoom( hypedocument, element,event)
{

var symbolInstance = hypeDocument.getSymbolInstanceById(‘ZoomInSequence’);
symbolInstance.startTimelineNamed(‘Main Timeline’, hypeDocument.kDirectionForward);
}

I cannot get this to work

anyone?

R


#2

Can you share your document or an example?


(Hans-Gerd Claßen) #3

you may struggle with id and name of an element.
If you just want to start any hypebehaviour, you can use custombehaviour instead of scripting

so here are both opportunities:
link
startSymbolTimeline.hype.zip (16.1 KB)


(Ralph) #4

Here it is

ImageSequencetest.zip (1.3 MB)


(Hans-Gerd Claßen) #5

you should – at least – read the answers given … could save you time :wink:


#6

You haven’t given your Symbol an ID. You need to give it an ID in the Identity Inspector.

As Hans says though you could just use a custom behaviour. Set one up inside the symbol and you can access it from outside.


(Ralph) #7

Will do and report back thanks