How do you add Timeline Actions to Top Layer objects?

Problem:
(1) I’m trying to add the following Timeline actions to an object in the Top Layer, but the timelines are not appearing for me to select them. Am I preventing it from appearing somehow?

On Click > Continue Timeline
On Click > Pause Timeline
On Click > Start Timeline

(2) Also how can I do this using the Execute JavaScript action?
the following works for me:

//Pause Timeline 1
prez.pauseTimeline('Timeline 1');
//Start Timeline 1
prez.startTimeline('Timeline 1');

But how do I add the Continue Timeline action? The following JavaScript doesn’t work for me:

prez.continueTimeline('Timeline 1');

ActivePresenter version: 9.3.0

OS: Windows 11

Hi,
Please see the answers below:

1.Timeline Actions Not Appearing

Timeline actions like Continue, Pause, and Start are not available for objects that display over multiple slides. These actions only work for objects that exist on a single slide.
2. JavaScript to Continue Timeline

To resume a paused timeline via JavaScript, please use:

prez.pauseTimeline('Timeline 1', false);

This acts like a Continue Timeline action.

Hope this helps!

1 Like

Thank you Hang this helps a lot!:slightly_smiling_face:

Can I just check that applying the following JavaScript code to an object in the Top Layer won’t break my slides somehow? I want to be able to click a top layer object to affect multiple timelines across multiple slides:

On Click > Execute JavaScript (Play Timelines)

// Array of timeline names 
const timelineNames = ['Timeline 1', 'Timeline 2', 'Timeline 3’]; 

// Loop through each timeline name and play it 
timelineNames.forEach(timeline => { prez.pauseTimeline(timeline, false); });

On Click > Execute JavaScript (Pause Timelines)

// Array of timeline names 
const timelineNames = ['Timeline 1', 'Timeline 2', 'Timeline 3’];

// Loop through each timeline name and pause it 
timelineNames.forEach(timeline => { prez.pauseTimeline(timeline); });

On Click > Execute JavaScript (Start Timelines)

// Array of timeline names 
const timelineNames = ['Timeline 1', 'Timeline 2', 'Timeline 3’]; 

// Loop through each timeline name and start it 
timelineNames.forEach(timeline => { prez.startTimeline(timeline); });

Thanks for your response.

Unfortunately, it’s not possible to use a Top Layer object to control timelines across multiple slides. JavaScript only works within the current slide’s context.

Regards,

1 Like