Custom Audio Scripting - HELP! (stop all other timelines when a new timeline is activated)

In my project I have multiple audio hotspots -
I am struggling to find a way to stop the current timeline when another timeline is activated.

I have multiple facts (1-5) that each have their own state - when triggered, an audio Icon for that fact appears along with some text. Pressing the audio icon starts the corresponding timeline (1-5).

If I select another fact and trigger the audio before the previous audio clip has finished, they play on top of one another. The goal is to stop all other audio when a new state is activated.

I have tried to stop the timelines through actions when a new fact is selected with no avail-

I don’t know why this doesnt work?

I then tried a script using the “active” event which did not work either

This feels like it should have an extremely simple solution but I am a noob at code and having a hard time grasping custom scripts. Can anyone help?

My attempt at using the “active” event with scripting

Do you have your Audio files in a sub symbol? or the main hierarchy (on the left side of ZapWorks)?
This will change how you will need to do things.

Steve

They are in the main hierarchy right now

Here is a zpp file for studio that has an info page with 5 fact pages.
As you press the button it will change the page to the next one. It stops the audio and start the next one. (it is the same audio file added 5 times).

Hope it helps.
Steve

Timeline Help.zpp (321.7 KB)