Question from Groups, JS and sound.

Hello,
First I would like to apologize for my English.

I am creating a project where there are groups with text box and audios, my idea was to enter, the first box will appear and the first audio will play, when clicking on the box, it disappears and the second appears along with the second audio and so on.
As there are several slides, the idea was to leave all audios on the master slide and each group to call a specific audio on the counter.
I tried to create in JS but still do not understand the use.

I did something similar on another platform I would like to do with storyline 3.

ActivePresenter:

//Variavel caixa normal
var namePrefix = 'caixa_';
//Variavel audio
var audioPrefix = 'wd10_01a_';
var numero1 = 1;

//Função
var clickHandler = function() {
this.hide();

// Pausar narração se caixa = hide
//prez.object(audioPrefix).animate(AP.EffectType.MEDIA_STOP);

//Variavel para proxima caixa
var nextIndex = parseInt(this.name().substring(namePrefix.length)) + 1;
//Variavel proxima caixa
var nextObject = prez.object(namePrefix + nextIndex);

//Variavel proxima caixa Indica
var caixaIndica = prez.object(nameCaixaIndica);
//Se caixa hide = show e inicia audio
if (nextObject) {
nextObject.show();
prez.object(audioPrefix + numero1 + '_' + nextIndex).animate(AP.EffectType.MEDIA_PLAY);
}
//Se terminou proximo slide

else {

prez.nextSlide();
numero1 = numero1 +1;
nextIndex = 1;
}
};

//Contador
var i = 1;
var obj;
while (obj = prez.object(namePrefix + i)) {
++i;
obj.on('ap-click', clickHandler);
}


From what I researched is not possible to show and hide groups, but not using JS?

Follows the model in question.

2 Replies