Jump to Previous/ Next label?

Problem: Hi, I’m working on a timeline based project with 20 labels.
I’d like to just jump to the previous and next label with just 2 buttons.

You can do it with ‘jump to previous or next scene’ but not labels.
Is there a way to do this? I’d rather make 2 buttons than 20 for
each label. Thanks!

Saola Animate version: 3

OS: Windows 10

Hi,

You can use JavaScript to jump to the previous/next label.
Please see labelNavigation function in this project: label navigation.saolapack (2.7 KB)

Regards

Thank you- this does exactly what I’m looking for!

However, it only works in that file. I’ve copied the object, copied the code, rebuilt it.

That javascript won’t work in any other project file. What is in that file that I’m missing?

Thanks :slight_smile:

So I’ve got it working by copying parts from the label navigation.js file into the new js file

But it skips the first 10 of my labels? Why is that?

Also how do I get the new file to write all that into its own js file instead of copying it every time I export?

Thanks

On MORE testing, it seems I can have as many labels as I want.

But if I place them past a certain time in the timeline, it ignores all the labels before that.

I don’t have time to figure out exactly when, but if I put them past 1:40:00 it ignores all
the labels before that right now.

So why is this happening?

Hi,

The script sorts the label timestamps incorrectly so you see it ignores some labels.
Please search for labelTimes.sort(); (line 11) in labelNavigation function, and replace it by the following script:

  labelTimes.sort(function(a, b) {
    return a - b;
  });

I’ve updated the sample in my first answer, you can also download it again.

Regards