Unable to play Symbol timeline

Hi Everyone,

I have a symbol with the ID “drop1” (It’s a drop target for a drag and drop game)
It has a single timeline called “Main Timeline”, which is a simple 0.5 second fade-in effect, with a pause action on the first frame to prevent it from playing immediately.
I’m using this bit of code to tell the symbol’s timeline to play when another element is dropped onto it:

var dropTarget = "drop" + index;
hypeDocument.getSymbolInstanceById(dropTarget).startTimelineNamed("Main Timeline", hypeDocument.kDirectionForward);

The code looks correct, but the timeline doesn’t start.

I’ve done some diagnostic testing:


… it displays the correct symbol

console.log(hypeDocument.getSymbolInstanceById(dropTarget).isPlayingTimelineNamed("Main Timeline"));

… this displays “false”

console.log(hypeDocument.getSymbolInstanceById(dropTarget).durationForTimelineNamed("Main Timeline"));

… displays “0.5”, which is the correct timeline length.

hypeDocument.getSymbolInstanceById(dropTarget).goToTimeInTimelineNamed(0.3, "Main Timeline");

… goes to the correct time (0.3 milliseconds) in the timeline.

So it seems that although I’m referencing the correct timeline, it’s not playing.

Can anyone suggest where I should look or what I might have done wrong?
(By the way, the symbol timeline does play when the scene first loads and the pause action is removed from the first frame.)



i think following your logic it should be a continueTimelineName as a start will stop at the pauseaction …

1 Like

@h_classen Thank you sir, that was it!!
That makes sense: since the first action is pause, the timeline will stop at that action as soon as it’s started.
Again, thank you for all your help!

1 Like